00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SCHEDITLINE_H
00021 #define SCHEDITLINE_H
00022
00023 #include <qcanvas.h>
00024 #include <qptrlist.h>
00025 #include <qlistbox.h>
00026 #include <qlabel.h>
00027 #include <qspinbox.h>
00028 #include <qpixmap.h>
00029 #include <qpainter.h>
00030
00031 #include "spinvalue.h"
00032 #include "doscolourbox.h"
00033 #include "linestyle.h"
00034 #include "scheditprefs.h"
00035
00036 class KDialogBase;
00037 class SpinValue;
00038
00039
00040
00044 class ScheditLinePrefs : public ScheditPrefs {
00045 Q_OBJECT
00046 public:
00047 typedef struct {
00048 QPen pen;
00049 } Data;
00050
00051 private:
00052 LabelIni laColour;
00053 DosColourBox dcb;
00054 QLabel si1;
00055 LabelIni laStyle;
00056 LineStyle ls;
00057 QLabel si2;
00058 LabelIni laWidth;
00059 SpinValue svWidth;
00060 Data data;
00061
00062 void readPreferences ( KConfigGroup * config );
00063 void writePreferences ( KConfigGroup * config );
00064
00065 protected:
00066 void renderPage ();
00067
00068 public:
00069 ScheditLinePrefs (KDialogBase * dlg,
00070 QString qsTitle,
00071 QString qsKey );
00072 void hideValue (void);
00073 void hideStyle (void);
00074 QPen getPen (void);
00075 void setupPainter (QPainter& painter);
00076 };
00077
00081 class ScheditLine : public QCanvasLine {
00082 private:
00083 #pragma pack (push,1)
00084 typedef struct {
00085 unsigned char ucType;
00086 unsigned short int usStartX;
00087 unsigned short int usStartY;
00088 unsigned short int usEndX;
00089 unsigned short int usEndY;
00090 unsigned char ucStyle;
00091 unsigned short int ausScrap [3];
00092 } WireHdr;
00093 #pragma pack (pop)
00094
00095 WireHdr header;
00096
00097 void common ( void );
00098
00099 static QPtrList<ScheditLinePrefs> aSetupPages;
00100
00101
00102
00103 public:
00104 ScheditLine ( QCanvas * canvas,
00105 unsigned char * & puc );
00106
00107 ScheditLine ( QCanvas * canvas,
00108 QPoint qpStart,
00109 QPoint qpEnd,
00110 int iStyle );
00111
00112
00113
00114 int rtti () const;
00115
00116 void draw ( QPainter& painter );
00117
00118 static void setup ( KDialogBase * dlg );
00119
00120 static void readProperties ( KConfig * config );
00121
00122 static void writeProperties ( KConfig * config );
00123 };
00124
00125 #endif