gSAFE  1.3.8
guilib.h
1 /* gSAFE - LIB
2  general Sql dAtabase FrontEnd
3  http://hyperprog.com/gsafe/
4 
5  (C) 2005-2013 Peter Deak (hyper80@gmail.com)
6 
7  License: GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
8 
9  guilib.h
10 */
11 
12 #ifndef GSAFE__GUILIB_HEADER_FILE_X_
13 #define GSAFE__GUILIB_HEADER_FILE_X_
14 
15 #include <QtCore>
16 #include <QtGui>
17 
18 #ifndef COMPILED_WITH_QT4X
19 #include <QtWidgets>
20 #endif
21 
22 #ifdef WEBKITBASED_HTMLSHOW
23 #ifndef COMPILED_WITH_QT4X
24 #include <QtWebKitWidgets>
25 #else
26 #include <QtWebKit>
27 #endif
28 #endif
29 
30 #include "datalib.h"
31 
33 /* @{ */
34 
35 #define EXT_EDIT_PROCESS "externaledit.bat"
36 
37 #define NEED_UPDATE 0
38 #define CLICK_ON_CELL 1
39 
48 #define KEEP_ALL 0
49 #define FULL_CLEAN 1
50 #define START_CLEAN 2
51 #define END_CLEAN 3
52 
53 
59 #define DONT_DELETE_DATA 0
60 #define DELETE_DATA 1
61 
62 class QLabel;
63 class QLineEdit;
64 class QComboBox;
65 class QTextEdit;
66 class QCheckBox;
67 class QDateEdit;
68 class QToolButton;
69 class QVBoxLayout;
70 class QHBoxLayout;
71 class QGridLayout;
72 class QPoint;
73 class QKeyEvent;
74 
76 
82 class HArrayButton : public QPushButton
83 {
84  Q_OBJECT
85 
86  public:
88  static int defaultSizeX,defaultSizeY;
89 
91  HArrayButton(QString text,QWidget *parent);
92  ~HArrayButton(void);
93 
100  static QLayout * abc_filt(QWidget *parent,const QObject *receiver,const char *member);
101 
102  private slots:
103  int clickHandler(void);
104 
105  signals:
106  void clickedValue(QString text);
107 };
108 
111 class HSpinBox : public QFrame
112 {
113  Q_OBJECT
114 
115  public:
118  HSpinBox(QWidget *parent);
120  ~HSpinBox(void);
121 
123  void setMinValue(int v) { min = v; check(); }
125  void setMaxValue(int v) { max = v; check(); }
127  int value(void) { return val; }
128 
129  public slots:
131  int setValue(int v);
132 
133  protected:
134  int val;
135  int min,max;
136  QString oldtext;
137 
138  QLineEdit *le;
139 
140  protected slots:
141  void check(void);
142  int leChanged(const QString& t);
143  int bUp(void);
144  int bDown(void);
145 
146  protected:
148  void wheelEvent(QWheelEvent *e);
149 
150  signals:
152  void valueChanged(int);
153 };
154 
155 /* NOT DOCUMENTED: Helper class of HTableBrowser. Do not use directly.
156  * The HTableBrowser class uses this to qsort the elements. */
157 class HTableBrowserElementPair
158 {
159  public:
160  HTableBrowserElementPair(HTableBrowserElement *lp,HTableBrowserElement *rp)
161  { left = lp; right = rp; }
162 
163  HTableBrowserElement *left;
164  HTableBrowserElement *right;
165 };
166 
198 class HTableBrowser : public QFrame
199 {
200  Q_OBJECT
201 
202  public:
205  HTableBrowser(QWidget *parent);
207  ~HTableBrowser(void);
208 
212  void setColumnColor(int col,QColor c);
213 
214  public slots:
215 
233  void queryToStart(void);
234  void queryToTop(void);
235  void queryToCurrent(void);
236 
237  public:
238 
251  QStringList *queryNextValues(void);
258  QString *queryNextKey(void);
259 
261  int numberOfElements(void);
262 
275  QStringList *valuesByIndex(int n);
282  QString *keyByIndex(int n);
283 
285  bool hasKey(QString key);
286 
287  public slots:
288 
290  int fulshDrawingCache(void);
291 
293  int clear();
294 
299 
303  int removeAllElementByKey(QString key);
304 
307  int setHeadTexts(QStringList h);
308 
317  int setCurrentElement(QString c,QString t="");
318 
320  int setCurrentElement(int index);
321 
323  int setTopElement(int index);
324 
333  void sort(int keycol);
334 
336  int cursorToBegin(void);
338  int cursorToEnd(void);
339 
340  public:
341 
342  int mouseRightClickPosX;
343  int mouseRightClickPosY;
344 
349  QString currentKey(void);
354  QString topKey(void);
355 
363  void setSpecSort(int col,QString specsortname);
364 
366  void setBackgroundColor(QColor c);
368  void setCursorColor(QColor c) { color_cursor = c; }
370  void setHeaderColor(QColor c) { color_header = c; }
372  void setHeaderColorCursor(QColor c) { color_header_cursor = c; }
373 
374  //================================================================
375  private:
376  int limitCache(void);
377  QLinkedList<HTableBrowserElement *> cachedElements;
378  int cacheLimit;
379 
380  private:
381  QColor color_cursor;
382  QColor color_header;
383  QColor color_header_cursor;
384  QColor color_background;
385 
386  bool asc;
387  bool asc2;
388  int keycolumn;
389  int keycolumn2;
390  int sortmode; // 0-normal 1-dropchar
391 
392  void q_sort (void);
393  void q_sort_run(HTableBrowserElementPair *p);
394  bool ch(bool m,HTableBrowserElement *a,HTableBrowserElement *b);
395 
396  QStack<HTableBrowserElementPair *> *q_sort_stack;
397 
398  QString lastkey;
399 
400  int oldw,oldh,old_col_scroll;
401 
402  QMutex cacheMutex;
403 
404  protected:
405  QString last_right_clicked;
406  int number;
407  int curc;
408  HTableBrowserElement *start,*end,*top,*cur,*query_cursor;
409  int col_scroll;
410 
411  static bool staticinit;
412  static QPixmap *pix_up;
413  static QPixmap *pix_down;
414  static QPixmap *pix_asc;
415  static QPixmap *pix_desc;
416  static QPixmap *pix_asc2;
417  static QPixmap *pix_desc2;
418 
419  QFontMetrics *fm;
420  QList<int> colw;
421  QList<QColor> colc;
422  QList<QString> spec_sort;
423  QStringList head;
424  int rowh;
425  int plusw;
426  int showrow;
427  QString seek;
428  bool inscroll;
429 
430  QMap<int,QColor> precolor;
431 
432  protected:
434  bool stepUp(void);
436  bool stepDown(void);
438  bool mouseNetClick(QMouseEvent *e,int rmode = NEED_UPDATE);
439 
440  protected:
441  void paintEvent(QPaintEvent *e);
442  void keyPressEvent(QKeyEvent *e);
443  void mousePressEvent(QMouseEvent *e);
444  void mouseReleaseEvent(QMouseEvent *e);
445  void mouseDoubleClickEvent(QMouseEvent *e);
446  void mouseMoveEvent(QMouseEvent *e);
447  void wheelEvent(QWheelEvent *e);
448  void resizeEvent(QResizeEvent *e);
449 
450  signals:
453  void activateItem(const QString& s);
456  void alternateActivateItem(const QString& s);
459  void itemChanged(const QString& s);
460 };
461 
466 {
467  public:
468  int index;
469  QString key;
470  QStringList *rows;
471 
472  bool owncolor;
473  int ocr,ocg,ocb;
474 
476  QPixmap *cachePixmap;
477 
478  public:
482  HTableBrowserElement(QString k,QStringList *c);
483 
488  HTableBrowserElement(QString k,QString v1,QString v2="",QString v3="",QString v4="",QString v5="",
489  QString v6="",QString v7="",QString v8="",QString v9="");
491  ~HTableBrowserElement(void);
492 
494  QString operator[](int i);
496  QString getCVal(int i) { return (*rows)[i]; }
497 
501  HTableBrowserElement * setColor(int r,int g,int b);
506 
508  int size(void);
509 
513 
516 
517  public:
520 };
521 
529 class HDispPlainDataMatrix : public QFrame
530 {
531  Q_OBJECT
532 
533  protected:
534  QString genhtml_parameters;
535  HPlainDataMatrix *data;
536  HTableBrowser *list;
538 
539  public:
554  HDispPlainDataMatrix(QWidget *parent,HBase *d,bool htmlmode=false,int keyfield=-1,int ddata=DONT_DELETE_DATA);
556  ~HDispPlainDataMatrix(void);
557 
558  public:
562  void setGenHtmlParameters(QString p) { genhtml_parameters = p; }
563 
565  void setColumnColor(int col,QColor color) { list->setColumnColor(col,color); }
566 
567  public slots:
569  int dialogPrint(void);
571  int dialogXml(void);
573  int dialogHtmlShow(void);
574 
576  int slotActivateItem(const QString k);
578  int itemAlternateActivated(const QString& s);
579 
580  signals:
582  void activateItem(QString k);
583 };
584 
614 class HPlainDMD : public QDialog
615 {
616  Q_OBJECT
617 
618  private:
619  HDispPlainDataMatrix * dpdm;
620  public:
623  HPlainDMD(QWidget *parent,HBase *d,bool htmlmode=false);
625  ~HPlainDMD(void);
626 
629 
630 };
631 
637 class HDispTable : public QFrame
638 {
639  Q_OBJECT
640 
641  protected:
642 
643  bool ro_mask;
644  int datamode;
647  QVBoxLayout *layout;
648 
649  public:
655  HDispTable(QWidget *parent,HTable *d,int datamodep = FULL_CLEAN,int ddata=DONT_DELETE_DATA);
657  ~HDispTable(void);
658 
660  HTable *getDataClass(void) { return data;};
661 
662  public slots:
663 
666  int updateDisplay(void);
667 
669  int dialogPrint(void);
671  int dialogXml(void);
672 
676  int addStretchToEnd(void);
677 
678  signals:
681  void updateDisplaySignal(void);
682 };
683 
691 class HDispList : public QFrame
692 {
693  Q_OBJECT
694 
695  protected:
696  int datamode;
700 
701  public:
707  HDispList(QWidget *parent,HList *d,int datamodep = FULL_CLEAN,int ddata=DONT_DELETE_DATA);
709  ~HDispList(void);
710 
712  HList *getDataClass(void) { return data;}
715 
716  public slots:
717 
720  int updateDisplay(void);
721 
723  int dialogPrint(void);
725  int dialogXml(void);
726 
728  int toBegin() { list->cursorToBegin(); return updateDisplay(); }
730  int toEnd() { list->cursorToEnd(); return updateDisplay(); }
731 
734  int sortByColumn(int col);
735 
738  int itemActivated(const QString& s);
741  int itemAlternateActivated(const QString& s);
743  int litemChanged(const QString& s);
744 
745  signals:
747  void listItemChanged(void);
748 
749  protected:
750  void keyPressEvent(QKeyEvent *e);
751 
752 };
753 
754 // ///////////////////////////////////////////////////////////////////////////////
755 // / data fields /////////////////////////////////////////////////////////////////
756 // ///////////////////////////////////////////////////////////////////////////////
757 
764 class HDispDataField : public QFrame
765 {
766  Q_OBJECT
767 
768  protected:
769  HDataField *data;
770  bool ro_mask;
771  bool tbool;
772 
773  QHBoxLayout *sublayout;
774  public:
775  static QHBoxLayout *static_sublayout;
776 
777  public:
778  HDispDataField(QWidget *parent,HDataField *d,bool _ro_mask=false);
779  ~HDispDataField(void);
780 
781  virtual void enableControl(void);
782  virtual void disableControl(void);
783 
784  public slots:
785  int updateDisplaySlot(void);
786  int timedUpdateSlot(void);
787 
788  public slots:
789  int enableControlSlot(void) { enableControl(); return 0; }
790  int disableControlSlot(void) { disableControl(); return 0; }
791 
792  protected:
793  void paintEvent(QPaintEvent *e);
794 
795  private:
796  int blink;
797 
798 };
799 
803 class HDispKey : public HDispDataField
804 {
805  Q_OBJECT
806 
807  protected:
808  QLabel *explain,*key;
809 
810  public:
811  HDispKey(QWidget *parent,HDataField *d,bool _ro_mask=false);
812  ~HDispKey(void);
813 
814  virtual void enableControl(void);
815  virtual void disableControl(void);
816 
817  public slots:
818  int updateDisplaySlot(void);
819  int updateStaticGuiElementsSlot(void);
820 
821 };
822 
827 {
828  Q_OBJECT
829 
830  protected:
831  QLabel *explain;
832  QLineEdit *edtext;
833  QLabel *nedtext;
834  QLabel *tailtext;
835 
836  public:
837  HDispSmallText(QWidget *parent,HDataField *d,bool _ro_mask=false);
838  ~HDispSmallText(void);
839 
840  virtual void enableControl(void);
841  virtual void disableControl(void);
842 
843  public slots:
844  int textUpdate(const QString& n);
845  int updateDisplaySlot(void);
846  int updateStaticGuiElementsSlot(void);
847 };
848 
853 {
854  Q_OBJECT
855 
856  protected:
857  QLabel *explain;
858  QTextEdit *edtext;
859  QTextEdit *nedtext;
860  public:
861  HDispLargeText(QWidget *parent,HDataField *d,bool _ro_mask=false);
862  ~HDispLargeText(void);
863 
864  virtual void enableControl(void);
865  virtual void disableControl(void);
866 
867  public slots:
868  int textUpdate(void);
869  int updateDisplaySlot(void);
870  int updateStaticGuiElementsSlot(void);
871 };
872 
877 {
878  Q_OBJECT
879 
880  protected:
881  QLabel *explain;
882  QComboBox *edval;
883  QLabel *nedtext;
884  QLabel *tailtext;
885  public:
886  HDispCharHash(QWidget *parent,HDataField *d,bool _ro_mask=false);
887  ~HDispCharHash(void);
888 
889  virtual void enableControl(void);
890  virtual void disableControl(void);
891 
892  public slots:
893  int itemSelected(int index);
894  int updateDisplaySlot(void);
895  int updateStaticGuiElementsSlot(void);
896 };
897 
902 {
903  Q_OBJECT
904 
905  protected:
906  QLabel *explain;
907  QComboBox *edval;
908  QLabel *nedtext;
909  QLabel *tailtext;
910  public:
911  HDispNumHash(QWidget *parent,HDataField *d,bool _ro_mask=false);
912  ~HDispNumHash(void);
913 
914  virtual void enableControl(void);
915  virtual void disableControl(void);
916 
917  public slots:
918  int itemSelected(int index);
919  int updateDisplaySlot(void);
920  int updateStaticGuiElementsSlot(void);
921 };
922 
927 {
928  Q_OBJECT
929 
930  protected:
931  QLabel *explain;
932  HSpinBox *edval;
933  QLabel *nedtext;
934  QLabel *tailtext;
935  public:
936  HDispNumber(QWidget *parent,HDataField *d,bool _ro_mask=false);
937  ~HDispNumber(void);
938 
939  virtual void enableControl(void);
940  virtual void disableControl(void);
941 
942  public slots:
943  int valueUpdate(int value);
944  int updateDisplaySlot(void);
945  int updateStaticGuiElementsSlot(void);
946 };
947 
952 {
953  Q_OBJECT
954 
955  protected:
956  QLabel *explain;
957  QLabel *nedtext;
958  public:
959  HDispStatic(QWidget *parent,HDataField *d,bool _ro_mask=false);
960  ~HDispStatic(void);
961 
962  virtual void enableControl(void);
963  virtual void disableControl(void);
964 
965  public slots:
966  int updateDisplaySlot(void);
967  int updateStaticGuiElementsSlot(void);
968 };
969 
974 {
975  Q_OBJECT
976 
977  protected:
978  QLabel *explain;
979  QCheckBox *edval;
980  QLabel *nedtext;
981 
982  public:
983  HDispCheck(QWidget *parent,HDataField *d,bool _ro_mask=false);
984  ~HDispCheck(void);
985 
986  virtual void enableControl(void);
987  virtual void disableControl(void);
988 
989  public slots:
990  int valueUpdate(void);
991  int updateDisplaySlot(void);
992  int updateStaticGuiElementsSlot(void);
993 };
994 
999 {
1000  Q_OBJECT
1001 
1002  protected:
1003  QLabel *explain;
1004  QLineEdit *edtext;
1005  QLabel *nedtext;
1006  QLabel *tailtext;
1007 
1008  public:
1009  HDispFloating(QWidget *parent,HDataField *d,bool _ro_mask=false);
1010  ~HDispFloating(void);
1011 
1012  virtual void enableControl(void);
1013  virtual void disableControl(void);
1014 
1015  public slots:
1016  int textUpdate(const QString& n);
1017  int updateDisplaySlot(void);
1018  int updateStaticGuiElementsSlot(void);
1019 };
1020 
1025 {
1026  Q_OBJECT
1027 
1028  protected:
1029  QLabel *explain;
1030  QDateEdit *edval;
1031  QCheckBox *unk;
1032  QLabel *nedtext;
1033 
1034  public:
1035  HDispDate(QWidget *parent,HDataField *d,bool _ro_mask=false);
1036  ~HDispDate(void);
1037 
1038  virtual void enableControl(void);
1039  virtual void disableControl(void);
1040 
1041  public slots:
1042  int valueUnkUpdate(void);
1043  int valueUpdate(const QDate& d);
1044  int updateDisplaySlot(void);
1045  int updateStaticGuiElementsSlot(void);
1046 };
1047 
1052 {
1053  Q_OBJECT
1054 
1055  protected:
1056  QLabel *explain;
1057  QLabel *nedtext;
1058 
1059  public:
1060  HDispTimestamp(QWidget *parent,HDataField *d,bool _ro_mask=false);
1061  ~HDispTimestamp(void);
1062 
1063  virtual void enableControl(void);
1064  virtual void disableControl(void);
1065 
1066 
1067  public slots:
1068  int updateDisplaySlot(void);
1069  int updateStaticGuiElementsSlot(void);
1070 };
1071 
1072 class SqlChooseDialog;
1077 {
1078  Q_OBJECT
1079 
1080  protected:
1081  QLabel *explain;
1082  QComboBox *edval;
1083  QLabel *nedtext;
1084  QToolButton *rfbutt;
1085  QPushButton *pbutt;
1086 
1087  SqlChooseDialog *pupup_dialog;
1088 
1089  public:
1090  HDispSqlChoose(QWidget *parent,HDataField *d,bool _ro_mask=false);
1091  ~HDispSqlChoose(void);
1092 
1093  virtual void enableControl(void);
1094  virtual void disableControl(void);
1095 
1096  void setToolbarbuttonSignalOn(QString text);
1097  void setToolbarbuttonSignalOff();
1098 
1099  HSqlChoose *getHSqlChoose(void) { return ((HSqlChoose *)data); }
1100 
1101  public slots:
1102  int itemSelected(int index);
1103  int refresh(void);
1104  int updateDisplaySlot(void);
1105  int updateStaticGuiElementsSlot(void);
1106 
1107  int popupSelector(void);
1108  int itemSelected(const QString& s);
1109 
1110 
1111 };
1112 
1113 /* NOT DOCUMENTED: This is not a disp field class. This class is part of the HDispSqlChoose.
1114  * If the HSqlChoose in disabled easy mode, (popup selection) this class will be the popup selection dialog.
1115  * It connects to the slot of HDispSqlChoose and notify the selected record this way. */
1116 class SqlChooseDialog : public QDialog
1117 {
1118  Q_OBJECT
1119 
1120  private:
1121  QString popupped_key;
1122 
1123  public:
1124  SqlChooseDialog( HDispSqlChoose* p);
1125  ~SqlChooseDialog();
1126 
1127  HTableBrowser* table;
1128  QPushButton* button;
1129  bool disabled_recvkey;
1130  bool key_received;
1131  QString received_key;
1132 
1133  protected:
1134  HDispSqlChoose* parent;
1135 
1136  QVBoxLayout* SqlChooseDialogLayout;
1137  QHBoxLayout* layout1;
1138 
1139  bool have_extra_func;
1140 
1141  public slots:
1142  int nullButtonPressed(void);
1143  int buttonPressed(void);
1144  int listviewitemSelected(const QString& s);
1145  int updateList(void);
1146 
1147  /* This slot is called when the plus toolbarbutton is pushed. (See HSqlChoose::addToolButton())
1148  * This slot is emits the callToolButtonHandler signal (down here) which is can be connected to the handler slot
1149  * which do the effective work. (That external work which defined by you in HSqlChoose::addToolButton() ) \n
1150  * This event chain is designed because of this class need a meta-data refresh after you do the external work.
1151  * That slot (which you define) can change the list of values, so the list need to be updated before the user select an item. \n
1152  * That's why I need a passing middle slot to grab the event when the external work finishes.
1153  * If I would directly connect to the toolbutton signal, the class could not refresh the values in the necessary time */
1154  int toolbarButtonClicked(void);
1155 
1156  int receivedASelectedKey(QString key);
1157 
1158  int popUpMenuActivated(const QString& key);
1159 
1160  /* The extra popup menu activates this slots.
1161  * Because the popup menu only can call slots without key,
1162  * this slots are emits the sigToExtraFunc signals (down here) which can pass the selected key values too.
1163  * That signals are connected with the target slots. */
1164  int popup_catch_0(void);
1165  int popup_catch_1(void);
1166  int popup_catch_2(void);
1167  int popup_catch_3(void);
1168  int popup_catch_4(void);
1169 
1170  int captureNotify(QString tblname);
1171 
1172  signals:
1173  void callToolButtonHandler(void);
1174  void itemSelected(const QString& s); //this connected to the parents
1175 
1176  void sigToExtraFunc_0(QString key);
1177  void sigToExtraFunc_1(QString key);
1178  void sigToExtraFunc_2(QString key);
1179  void sigToExtraFunc_3(QString key);
1180  void sigToExtraFunc_4(QString key);
1181 };
1182 
1184 
1192 class HShowPrintHtml : public QDialog
1193 {
1194  Q_OBJECT
1195 
1196 private:
1197  QString html;
1198 
1199 #ifdef WEBKITBASED_HTMLSHOW
1200  QWebView *te;
1201 #else
1202  QTextEdit *te;
1203 #endif
1204 
1205 public:
1206  HShowPrintHtml(QWidget *parent);
1207  ~HShowPrintHtml(void);
1208 
1209 public:
1210  void setContent(QString str);
1211  void setWinTitle(QString t);
1212 
1213 public slots:
1214  void slotPrint(void);
1215  void slotStart(void);
1216  void slotSave(void);
1217 };
1218 
1219 // ///////////////////////////////////////////////////////////////////////////////////////////
1220 // // OTHER CLASSES //////////////////////////////////////////////////////////////////////////
1221 // ///////////////////////////////////////////////////////////////////////////////////////////
1222 
1237 class HPleaseWaitWindow : public QWidget
1238  {
1239  Q_OBJECT
1240 
1241  private:
1242  int sizex,sizey;
1243  int lastx,lasty;
1244  int seq;
1245  int refreshTime;
1246 
1247  HPleaseWaitWindow(int sizex_=80,int sizey_=80,int refreshTime_=80);
1248  ~HPleaseWaitWindow();
1249 
1250  public slots:
1252  void progress(void);
1253 
1254  protected:
1255 
1256  QTime t;
1257  void mouseMoveEvent(QMouseEvent *me);
1258  void mousePressEvent(QMouseEvent *me);
1259 
1261  void paintEvent(QPaintEvent *pe);
1262 
1263  public:
1266 
1269  static HPleaseWaitWindow * start(void);
1274  static void step (void);
1277  static void end (void);
1278  };
1279 
1281 
1309 class HDecorDialog : public QDialog
1310 {
1311  Q_OBJECT
1312 
1313  public:
1320  HDecorDialog(QWidget *parent,QString title,int no_action_closetime);
1321 
1322  public:
1324  void setTitleFont(QFont f);
1331 
1333  QColor bgcolor;
1337  QColor frcolor;
1342  QColor titlecolor;
1343  QColor indcolor;
1346  int crossmargin;
1347 
1348  private slots:
1349  int incr_t(void);
1350 
1351  protected:
1352  void paintEvent(QPaintEvent *pe);
1353 
1354  void mousePressEvent(QMouseEvent *e);
1355  void mouseMoveEvent(QMouseEvent *e);
1356  void keyPressEvent(QKeyEvent *e);
1357 
1358  private:
1359  QFont titlefont;
1360  QString title;
1361  int no_action_closetime;
1362  int end_t;
1363  int t_t;
1364  int t_time;
1365 };
1366 
1367 
1374 class HPressButton : public QFrame
1375 {
1376  Q_OBJECT
1377 
1378  public:
1383  HPressButton(QWidget *parent,QString text,QString code="");
1385  ~HPressButton(void);
1386 
1388  void setColor(int red,int green,int blue);
1390  void setEffect(int effectwidth);
1392  void setMargin(int margin);
1394  void setTextPointSize(int size);
1395 
1396  private:
1397  bool enablestat;
1398  bool hidestat;
1399  int cmargin;
1400  int c3deffect;
1401 
1402  QFont font;
1403  bool willmid;
1404  bool mid;
1405  bool down;
1406  QString textstr,idstr;
1407 
1408  int r,rd,g,gd,b,bd;
1409 
1410  void calcSize();
1411  //static int mx,my;
1412  HPressButtonSizeSyncronizer* size_sync;
1413  public:
1414 
1421 
1427  void setSizeSyncronizer(HPressButtonSizeSyncronizer* ss) { size_sync = ss; }
1428 
1429  public slots:
1431  int recalcSize();
1433  int setHide();
1435  int setShow();
1439  int setEnabled(bool enable);
1440 
1441  protected:
1442  void paintEvent(QPaintEvent *e);
1443 
1444  void keyPressEvent(QKeyEvent *e);
1445  void keyReleaseEvent(QKeyEvent *e);
1446 
1447  void mousePressEvent(QMouseEvent *e);
1448  void mouseReleaseEvent(QMouseEvent *e);
1449  void mouseMoveEvent(QMouseEvent *e);
1450 
1451  signals:
1453  void clicked(void);
1455  void clickedCode(QString code);
1456 };
1457 
1461 {
1462  private:
1464  {
1465  mx = 0;
1466  my = 0;
1467  }
1468 
1469  private:
1470  int mx,my;
1471  friend class HPressButton;
1472 };
1473 
1479 class HDynTableDispConnector : public QObject
1480 {
1481  Q_OBJECT
1482 
1483 public:
1485  HDynTableDispConnector(HDynTable *dynt,QTableWidget *qtw);
1486  ~HDynTableDispConnector(void);
1487 
1488 private:
1489  typedef struct
1490  {
1491  QString name;
1492  int r,c;
1493  QTableWidgetItem *glink;
1494  } cellData;
1495 
1496  HDynTable *dynt;
1497  QList<cellData> cells;
1498  bool ccprogress;
1499  bool rfprogress;
1500 
1501 public slots:
1503  int refreshGui(void);
1505  int slotCellChanged(int row,int column);
1506 
1507 signals:
1510  void dataChangedByGui(void);
1511 
1512 };
1513 
1514 /* @} */
1515 
1516 #endif
int recalcSize()
Definition: guilib.cpp:4694
void queryToCurrent(void)
Definition: guilib.cpp:1976
QStringList * queryNextValues(void)
Definition: guilib.cpp:1989
QString currentKey(void)
Definition: guilib.cpp:772
HDispPlainDataMatrix * getHDispPlainDataMatrix(void)
Definition: guilib.h:628
QString * queryNextKey(void)
Definition: guilib.cpp:2003
bool hasKey(QString key)
Definition: guilib.cpp:2016
void setColumnColor(int col, QColor color)
Definition: guilib.h:565
void setHeaderColor(QColor c)
Definition: guilib.h:370
int dialogPrint(void)
Definition: guilib.cpp:2641
HSpinBox(QWidget *parent)
HSpinBox ////////////////////////////////////////////////////////////////////.
Definition: guilib.cpp:531
HPlainDMD(QWidget *parent, HBase *d, bool htmlmode=false)
Definition: guilib.cpp:2318
static void step(void)
Definition: guilib.cpp:4471
HTableBrowser * getBrowserObjectClass(void)
Definition: guilib.h:714
#define DONT_DELETE_DATA
Definition: guilib.h:59
~HDispPlainDataMatrix(void)
Definition: guilib.cpp:2308
static HPressButtonSizeSyncronizer * createSizeSyncronizer(void)
Definition: guilib.cpp:4890
void setColumnColor(int col, QColor c)
Definition: guilib.cpp:819
int setHeadTexts(QStringList h)
Definition: guilib.cpp:758
QStringList * rows
The visible data of the element.
Definition: guilib.h:470
int setEnabled(bool enable)
Definition: guilib.cpp:4667
void sort(int keycol)
Definition: guilib.cpp:1563
int setValue(int v)
Definition: guilib.cpp:631
int dialogPrint(void)
Definition: guilib.cpp:2426
int toBegin()
Definition: guilib.h:728
int dialogPrint(void)
Definition: guilib.cpp:2282
int crossthick
Definition: guilib.h:1345
HTableBrowserElement * elementByIndex(int n)
Definition: guilib.cpp:1936
HDispTable(QWidget *parent, HTable *d, int datamodep=FULL_CLEAN, int ddata=DONT_DELETE_DATA)
Definition: guilib.cpp:2524
QString * keyByIndex(int n)
Definition: guilib.cpp:1958
int cursorToBegin(void)
Definition: guilib.cpp:1096
HTableBrowserElement * next
Pointer to the next element.
Definition: guilib.h:518
HTable * data
The HTable data pointer;.
Definition: guilib.h:646
int datamode
Data handling mode.
Definition: guilib.h:696
HTableBrowser * list
The HTableBrowser object.
Definition: guilib.h:699
#define FULL_CLEAN
Definition: guilib.h:49
void activateItem(QString k)
HPressButtonSizeSyncronizer * getSizeSyncronizer(void)
Definition: guilib.h:1424
~HDispTable(void)
Definition: guilib.cpp:2657
int dialogXml(void)
Definition: guilib.cpp:2434
HTableBrowserElement * currentElement(void)
Definition: guilib.cpp:1013
void setSpecSort(int col, QString specsortname)
Definition: guilib.cpp:940
int clear()
Definition: guilib.cpp:786
void queryToStart(void)
Definition: guilib.cpp:1970
QPixmap * cachePixmap
Definition: guilib.h:476
int titleheight
Definition: guilib.h:1339
int setCurrentElement(QString c, QString t="")
Definition: guilib.cpp:951
QString getCVal(int i)
Definition: guilib.h:496
int deletedata
Data allocation handling mode.
Definition: guilib.h:537
HTableBrowserElement * setColor(int r, int g, int b)
Definition: guilib.cpp:2094
static QLayout * abc_filt(QWidget *parent, const QObject *receiver, const char *member)
Definition: guilib.cpp:460
int addElement(HTableBrowserElement *e)
Definition: guilib.cpp:830
void progress(void)
Definition: guilib.cpp:4413
~HSpinBox(void)
Definition: guilib.cpp:661
int setTopElement(int index)
Definition: guilib.cpp:990
int sortByColumn(int col)
Definition: guilib.cpp:2419
bool owncolor
If this attribute is true the element has own color.
Definition: guilib.h:472
static HPleaseWaitWindow * start(void)
Definition: guilib.cpp:4461
void wheelEvent(QWheelEvent *e)
Definition: guilib.cpp:651
void setBackgroundColor(QColor c)
Definition: guilib.cpp:749
bool stepUp(void)
Definition: guilib.cpp:1020
QColor bgcolor
Definition: guilib.h:1333
void dataChangedByGui(void)
void setEffect(int effectwidth)
Definition: guilib.cpp:4675
int fulshDrawingCache(void)
Definition: guilib.cpp:1596
static void end(void)
Definition: guilib.cpp:4478
void setTitleFont(QFont f)
Definition: guilib.cpp:4524
int removeAllElementByKey(QString key)
Definition: guilib.cpp:884
void setMinValue(int v)
Definition: guilib.h:123
int deletedata
Data allocation handling mode.
Definition: guilib.h:697
int slotCellChanged(int row, int column)
Definition: guilib.cpp:4984
int addStretchToEnd(void)
Definition: guilib.cpp:2623
int deletedata
Data allocation handling mode.
Definition: guilib.h:645
HTableBrowserElement * prev
Pointer to the previous element.
Definition: guilib.h:519
static int defaultSizeX
Definition: guilib.h:88
int setShow()
Definition: guilib.cpp:4660
bool dont_reset_timer
Definition: guilib.h:1330
Definition: datalib.h:312
HDispPlainDataMatrix(QWidget *parent, HBase *d, bool htmlmode=false, int keyfield=-1, int ddata=DONT_DELETE_DATA)
Definition: guilib.cpp:2196
int updateDisplay(void)
Definition: guilib.cpp:2670
~HPressButton(void)
Definition: guilib.cpp:4649
QStringList * valuesByIndex(int n)
Definition: guilib.cpp:1946
void setMaxValue(int v)
Definition: guilib.h:125
bool anywhere_click_close
Definition: guilib.h:1327
int slotActivateItem(const QString k)
Definition: guilib.cpp:2266
HDecorDialog(QWidget *parent, QString title, int no_action_closetime)
Definition: guilib.cpp:4491
int updateDisplay(void)
Definition: guilib.cpp:2455
void itemChanged(const QString &s)
QString operator[](int i)
Definition: guilib.cpp:2113
HTableBrowser(QWidget *parent)
Definition: guilib.cpp:692
void setHeaderColorCursor(QColor c)
Definition: guilib.h:372
HDispList(QWidget *parent, HList *d, int datamodep=FULL_CLEAN, int ddata=DONT_DELETE_DATA)
Definition: guilib.cpp:2350
int itemAlternateActivated(const QString &s)
Definition: guilib.cpp:2511
HList * data
The HList data pointer.
Definition: guilib.h:698
int dialogXml(void)
Definition: guilib.cpp:2649
void clicked(void)
~HTableBrowser(void)
Definition: guilib.cpp:764
HArrayButton(QString text, QWidget *parent)
Definition: guilib.cpp:443
bool mouseNetClick(QMouseEvent *e, int rmode=NEED_UPDATE)
Definition: guilib.cpp:1308
HTableBrowserElement * topElement(void)
Definition: guilib.cpp:1006
HTableBrowserElement * queryNextElement(void)
Definition: guilib.cpp:1979
int ocb
If the owncolor is true these variables holds the color.
Definition: guilib.h:473
void alternateActivateItem(const QString &s)
int setHide()
Definition: guilib.cpp:4654
void activateItem(const QString &s)
void listItemChanged(void)
HTableBrowserElement(QString k, QStringList *c)
Definition: guilib.cpp:2037
HDynTableDispConnector(HDynTable *dynt, QTableWidget *qtw)
Definition: guilib.cpp:4899
int cursorToEnd(void)
Definition: guilib.cpp:1104
int itemAlternateActivated(const QString &s)
Definition: guilib.cpp:2276
int toEnd()
Definition: guilib.h:730
HTableBrowserElement * clearColor(void)
Definition: guilib.cpp:2103
int itemActivated(const QString &s)
Definition: guilib.cpp:2502
void queryToTop(void)
Definition: guilib.cpp:1973
void paintEvent(QPaintEvent *pe)
Definition: guilib.cpp:4438
~HPlainDMD(void)
Definition: guilib.cpp:2341
HPressButton(QWidget *parent, QString text, QString code="")
Definition: guilib.cpp:4623
int datamode
Data handling mode.
Definition: guilib.h:644
int dialogHtmlShow(void)
Definition: guilib.cpp:2298
HList * getDataClass(void)
Definition: guilib.h:712
int litemChanged(const QString &s)
Definition: guilib.cpp:2412
int index
Index of the element.
Definition: guilib.h:468
void swapWith(HTableBrowserElement *x)
Definition: guilib.cpp:2161
int closerwidth
Definition: guilib.h:1341
~HDispList(void)
Definition: guilib.cpp:2442
int numberOfElements(void)
Definition: guilib.cpp:1931
QString topKey(void)
Definition: guilib.cpp:779
static HPleaseWaitWindow * pww
Definition: guilib.h:1265
void setColor(int red, int green, int blue)
Definition: guilib.cpp:4721
bool ro_mask
Readonly mask.
Definition: guilib.h:643
int dialogXml(void)
Definition: guilib.cpp:2290
QString key
Key value of the element.
Definition: guilib.h:469
void setCursorColor(QColor c)
Definition: guilib.h:368
bool stepDown(void)
Definition: guilib.cpp:1047
void valueChanged(int)
QColor frcolor
Definition: guilib.h:1337
~HTableBrowserElement(void)
Definition: guilib.cpp:2085
void setTextPointSize(int size)
Definition: guilib.cpp:4687
HTable * getDataClass(void)
Definition: guilib.h:660
void updateDisplaySignal(void)
void clickedCode(QString code)
int framewidth
Definition: guilib.h:1335
int value(void)
Definition: guilib.h:127
void setGenHtmlParameters(QString p)
Definition: guilib.h:562
void setMargin(int margin)
Definition: guilib.cpp:4681
void setSizeSyncronizer(HPressButtonSizeSyncronizer *ss)
Definition: guilib.h:1427