gwenhywfar 5.12.0
fox16_gui_dialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 begin : Fri Jan 22 2010
3 copyright : (C) 2010 by Martin Preuss
4 email : martin@libchipcard.de
5
6 ***************************************************************************
7 * Please see toplevel file COPYING for license details *
8 ***************************************************************************/
9
10#ifdef HAVE_CONFIG_H
11# include <config.h>
12#endif
13
16#include "fox16_htmllabel.hpp"
17#include "fox16_htmltext.hpp"
18
19#include "theme.h"
20
21#include <gwenhywfar/dialog_be.h>
22#include <gwenhywfar/directory.h>
23#include <gwenhywfar/debug.h>
24
25#include <list>
26#include <string>
27#include <assert.h>
28
29#include <fxkeys.h>
30
31
32#define FOX16_DIALOG_WIDGET_REAL 0
33#define FOX16_DIALOG_WIDGET_CONTENT 1
34
35#define FOX16_DIALOG_STRING_TITLE 0
36#define FOX16_DIALOG_STRING_VALUE 1
37
38
39
40
41
48
49
50FXIMPLEMENT(FOX16_GuiDialog, FXObject, FOX16_GuiDialogMap, ARRAYNUMBER(FOX16_GuiDialogMap))
51
52
53
55 :FXObject()
56 ,CppDialog()
57 ,_gui(NULL)
58 ,_widgetCount(0)
61 ,m_sizeChanged(FALSE) {
62}
63
64
65
67 :FXObject()
68 ,CppDialog(dlg)
69 ,_gui(gui)
70 ,_widgetCount(0)
73 ,m_sizeChanged(FALSE) {
74}
75
76
77
79 if (_mainWidget)
80 delete _mainWidget;
81 if (!m_iconList.empty()) {
82 std::list<FXIcon*>::iterator it;
83
84 for (it=m_iconList.begin(); it!=m_iconList.end(); it++)
85 delete *it;
86 m_iconList.clear();
87 }
88 if (m_iconSource)
89 delete m_iconSource;
90
91 if (!m_radioGroups.empty()) {
92 std::list<RadioButtonGroup*>::iterator it;
93
94 for (it=m_radioGroups.begin(); it!=m_radioGroups.end(); it++)
95 delete *it;
96 }
97}
98
99
100
102 CppDialog *cppDlg;
103
104 cppDlg=CppDialog::getDialog(dlg);
105 if (cppDlg)
106 return dynamic_cast<FOX16_GuiDialog*>(cppDlg);
107 return NULL;
108}
109
110
111
112FXIcon *FOX16_GuiDialog::getIcon(const char *fileName) {
113 GWEN_STRINGLIST *sl;
114
116 if (sl) {
117 GWEN_BUFFER *tbuf;
118 int rv;
119 FXIcon *ic;
120
121 tbuf=GWEN_Buffer_new(0, 256, 0, 1);
122 rv=GWEN_Directory_FindFileInPaths(sl, fileName, tbuf);
123 if (rv<0) {
124 DBG_ERROR(GWEN_LOGDOMAIN, "here (%d)", rv);
125 GWEN_Buffer_free(tbuf);
126 return NULL;
127 }
128
129 if (m_iconSource==NULL)
130 m_iconSource=new FXIconSource(FXApp::instance());
131
132 DBG_DEBUG(GWEN_LOGDOMAIN, "Loading [%s]", GWEN_Buffer_GetStart(tbuf));
133 ic=m_iconSource->loadIconFile(GWEN_Buffer_GetStart(tbuf));
134 if (ic==NULL) {
135 DBG_ERROR(GWEN_LOGDOMAIN, "Could not load icon [%s]", GWEN_Buffer_GetStart(tbuf));
136 GWEN_Buffer_free(tbuf);
137 return NULL;
138 }
139 m_iconList.push_back(ic);
140 GWEN_Buffer_free(tbuf);
141 return ic;
142 }
143 else {
144 DBG_ERROR(GWEN_LOGDOMAIN, "No media paths in dialog");
145 return NULL;
146 }
147}
148
149
150
152 FXDialogBox *dialogBox;
153 int rv;
154
155 dialogBox=_mainWidget;
156
157 /* execute dialog */
158 dialogBox->show(PLACEMENT_OWNER);
159 rv=dialogBox->execute();
161
162 if (rv==0) {
163 /* aborted */
164 return 0;
165 }
166 else
167 /* accepted */
168 return 1;
169}
170
171
174 int index,
175 int value,
176 int doSignal) {
177 DBG_DEBUG(GWEN_LOGDOMAIN, "SetIntProperty([%s], %d)", GWEN_Widget_GetName(w), value);
178
179 switch(GWEN_Widget_GetType(w)) {
181 return GWEN_ERROR_GENERIC;
182
184 return GWEN_ERROR_GENERIC;
185
187 THEMECOMBOBOX *f;
188
190 assert(f);
191
192 switch(prop) {
194 if (value<f->getNumItems()) {
195 f->setCurrentItem(value, doSignal?TRUE:FALSE);
196 return 0;
197 }
198 else {
199 DBG_ERROR(GWEN_LOGDOMAIN, "Index %d out of range in widget [%s]", value, GWEN_Widget_GetName(w));
200 return GWEN_ERROR_INVALID;
201 }
202
204 f->clearItems();
205 return 0;
206
207 default:
208 break;
209 }
210 break;
211 }
212
214 FXRadioButton *f;
215
217 assert(f);
218
219 switch(prop) {
221 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
222 return 0;
223
224 default:
225 break;
226 }
227 break;
228 }
229
231 FXProgressBar *f;
232
234 assert(f);
235
236 switch(prop) {
238 f->setProgress(value);
239 return 0;
240
242 if (value!=0) {
243 DBG_ERROR(GWEN_LOGDOMAIN, "MinValue should be 0!");
244 return GWEN_ERROR_INVALID;
245 }
246 return 0;
247
249 f->setTotal(value);
250 return 0;
251
252 default:
253 break;
254 }
255 break;
256 }
257
259 FXSpinner *f;
260
262 assert(f);
263
264 switch(prop) {
266 f->setValue(value);
267 return 0;
268
270 FXint lo, hi;
271
272 f->getRange(lo, hi);
273 lo=value;
274 f->setRange(lo, hi);
275 return 0;
276 }
277
279 FXint lo, hi;
280
281 f->getRange(lo, hi);
282 hi=value;
283 if (hi<lo)
284 hi=lo;
285 f->setRange(lo, hi);
286 return 0;
287 }
288
289 default:
290 break;
291 }
292 break;
293 }
294
297 FXFoldingItem *fi;
298
300 assert(f);
301
302 switch(prop) {
304 fi=f->getItem(value);
305 if (fi) {
306 f->killSelection();
307 f->setCurrentItem(fi, doSignal?TRUE:FALSE);
308 f->selectItem(fi);
309 f->makeItemVisible(fi);
310 }
311 else {
312 DBG_ERROR(GWEN_LOGDOMAIN, "Value %d out of range", value);
313 return GWEN_ERROR_INVALID;
314 }
315 return 0;
316
318 f->setHeaderSize(index, value);
319 return 0;
320
322 switch(value) {
324 /* simply fall-through */
326 f->setListStyle(FOLDINGLIST_BROWSESELECT);
327 return 0;
329 f->setListStyle(FOLDINGLIST_EXTENDEDSELECT);
330 return 0;
331 ;
332 }
333 DBG_ERROR(GWEN_LOGDOMAIN, "Unknown SelectionMode %d", value);
334 return GWEN_ERROR_INVALID;
335
337 FXFoldingItem *ti;
338
339 ti=f->getItem(index);
340 if (ti==NULL) {
341 DBG_ERROR(GWEN_LOGDOMAIN, "Index %d out of range", index);
342 return GWEN_ERROR_INVALID;
343 }
344 ti->setSelected((value==0)?FALSE:TRUE);
345 return 0;
346 }
347
349 f->clearItems();
350 return 0;
351
353 int i;
354
355 for (i=0; i<f->getNumHeaders(); i++) {
356 if (i==index) {
357 switch(value) {
359 f->setHeaderArrowDir(i, MAYBE);
360 break;
362 f->setHeaderArrowDir(i, TRUE);
363 break;
365 f->setHeaderArrowDir(i, FALSE);
366 break;
367 }
368 }
369 else
370 f->setHeaderArrowDir(i, MAYBE);
371 }
372
373 switch(value) {
375 break;
377 f->sortByColumn(i, true);
378 break;
380 f->sortByColumn(i, false);
381 break;
382 }
383 }
384 return 0;
385
387 int i;
388
389 for (i=0; i<f->getNumHeaders(); i++) {
390 FXbool b;
391
392 b=f->getHeaderArrowDir(i);
393 if (b!=MAYBE) {
394 if (b==TRUE)
395 f->sortByColumn(i, true);
396 else
397 f->sortByColumn(i, false);
398 break;
399 }
400 }
401 }
402 return 0;
403
404
405 default:
406 break;
407 }
408 break;
409 }
410
412 FXCheckButton *f;
413
415 assert(f);
416
417 switch(prop) {
419 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
420 return 0;
421
422 default:
423 break;
424 }
425 break;
426 }
427
429 FXTabBook *f;
430
432 assert(f);
433
434 switch(prop) {
436 f->setCurrent(value, doSignal?TRUE:FALSE);
437 return 0;
438
439 default:
440 break;
441 }
442 break;
443 }
444
446 FXSwitcher *f;
447
449 assert(f);
450
451 switch(prop) {
453 f->setCurrent(value, doSignal?TRUE:FALSE);
454 return 0;
455
456 default:
457 break;
458 }
459 break;
460 }
461
478 ;
479 }
480
481 {
482 FXWindow *f;
483
485 assert(f);
486
487 switch(prop) {
489 f->recalc();
490 f->resize(value, f->getHeight());
491 m_sizeChanged=TRUE;
492 return 0;
494 f->recalc();
495 f->resize(f->getWidth(), value);
496 m_sizeChanged=TRUE;
497 return 0;
499 if (value==0)
500 f->disable();
501 else
502 f->enable();
503 return 0;
504
506 f->setFocus();
507 return 0;
508
510 if (value==0) {
511 f->hide();
512 f->recalc();
513 }
514 else {
515 f->show();
516 f->recalc();
517 }
518 return 0;
519
536 ;
537 }
538 }
539
540 DBG_WARN(0, "Function is not appropriate for this type of widget (%s)",
542 return GWEN_ERROR_INVALID;
543}
544
545
546
549 int index,
550 int defaultValue) {
551 switch(GWEN_Widget_GetType(w)) {
554 return defaultValue;
555
557 THEMECOMBOBOX *f;
558
560 assert(f);
561
562 switch(prop) {
564 return f->getCurrentItem();
565
567 return f->getNumItems();
568
569 default:
570 break;
571 }
572 break;
573 }
574
576 FXRadioButton *f;
577
579 assert(f);
580
581 switch(prop) {
583 return (f->getCheck()==TRUE)?1:0;
584
585 default:
586 break;
587 }
588 break;
589 }
590
592 FXProgressBar *f;
593
595 assert(f);
596
597 switch(prop) {
599 return f->getProgress();
600
602 return 0;
603
605 return f->getTotal();
606
607 default:
608 break;
609 }
610
611 break;
612 }
613
615 FXSpinner *f;
616
618 assert(f);
619
620 switch(prop) {
622 return f->getValue();
623
625 FXint lo, hi;
626
627 f->getRange(lo, hi);
628 return lo;
629 }
630
632 FXint lo, hi;
633
634 f->getRange(lo, hi);
635 return hi;
636 }
637
638 default:
639 break;
640 }
641
642 break;
643 }
644
647 FXFoldingItem *fi;
648 int i=0;
649
651 assert(f);
652
653 switch(prop) {
655 fi=f->getCurrentItem();
656 if (fi==NULL)
657 return defaultValue;
658 else {
659 FXFoldingItem *ti;
660
661 ti=fi;
662 while( (ti=ti->getPrev()) )
663 i++;
664
665 return i;
666 }
667
669 return f->getNumItems();
670
672 return f->getHeaderSize(index);
673
675 switch(f->getListStyle()) {
676 case FOLDINGLIST_BROWSESELECT:
678 case FOLDINGLIST_EXTENDEDSELECT:
680 default:
682 }
683 break;
684 }
685
687 FXFoldingItem *ti;
688 int i=index;
689
690 ti=f->getFirstItem();
691 while(ti && i) {
692 ti=ti->getNext();
693 i--;
694 }
695
696 if (ti)
697 return (ti->isSelected()==TRUE)?1:0;
698 return defaultValue;
699 }
700
702 int i;
703
704 for (i=0; i<f->getNumHeaders(); i++) {
705 if (i==index) {
706 FXbool b;
707
708 b=f->getHeaderArrowDir(i);
709 if (b==MAYBE)
711 else if (b==TRUE)
713 else
715 }
716 }
717 DBG_ERROR(GWEN_LOGDOMAIN, "Column %d out of range", index);
718 }
719 return defaultValue;
720
721 default:
722 break;
723 }
724
725 break;
726 }
727
729 FXCheckButton *f;
730
732 assert(f);
733
734 switch(prop) {
736 return (f->getCheck()==TRUE)?1:0;
737
738 default:
739 break;
740 }
741
742 break;
743 }
744
746 FXTabBook *f;
747
749 assert(f);
750
751 switch(prop) {
753 return f->getCurrent();
754
755 default:
756 break;
757 }
758
759 break;
760 }
761
763 FXSwitcher *f;
764
766 assert(f);
767
768 switch(prop) {
770 return f->getCurrent();
771
772 default:
773 break;
774 }
775
776 break;
777 }
778
795 break;
796 }
797
798 /* generic properties every widget has */
799 {
800 FXWindow *f;
801
803 assert(f);
804
805 switch(prop) {
807 return f->getWidth();
808
810 return f->getHeight();
811
813 return (f->isEnabled()==TRUE)?1:0;
814
816 return (f->hasFocus())?1:0;
817
819 return f->id();
820
837 ;
838 }
839 }
840
841
842 DBG_WARN(0, "Function is not appropriate for this type of widget (%s)",
844 return defaultValue;
845}
846
847
848
851 int index,
852 const char *value,
853 int doSignal) {
854
855 FXString strValue;
856 FXString htmlValue;
857
858 if (value && *value) {
859 strValue=FOX16_Gui::getRawText(value);
860 htmlValue=FOX16_Gui::getHtmlText(value);
861 }
862
863 switch(GWEN_Widget_GetType(w)) {
865 return GWEN_ERROR_GENERIC;
867 return GWEN_ERROR_GENERIC;
868
871
873 assert(f);
874
875 switch(prop) {
877 f->setText(htmlValue);
878 return 0;
879
880 default:
881 break;
882 }
883 break;
884 }
885
888
890 assert(f);
891
892 switch(prop) {
894 f->setText(htmlValue);
895 f->makePositionVisible(strValue.length());
896 return 0;
897
899 f->setText(f->getText()+htmlValue);
900 return 0;
901
903 f->setText("");
904 return 0;
905
906 default:
907 break;
908 }
909 break;
910
911 }
912
914 THEMEBUTTON *f;
915
917 assert(f);
918
919 switch(prop) {
921 f->setText(value);
922 return 0;
923
925 f->setTipText(htmlValue);
926 return 0;
927
928 default:
929 break;
930 }
931 break;
932 }
933
935 FXTextField *f;
936
938 assert(f);
939
940 switch(prop) {
942 f->setText(value, doSignal?TRUE:FALSE);
943 return 0;
944
946 f->setTipText(htmlValue);
947 return 0;
948
949 default:
950 break;
951 }
952 break;
953 }
954
956 FXText *f;
957
959 assert(f);
960
961 switch(prop) {
963 f->setText(strValue);
964 return 0;
965
967 f->setTipText(htmlValue);
968 return 0;
969
970 default:
971 break;
972 }
973 break;
974 }
975
977 THEMECOMBOBOX *f;
978
980 assert(f);
981
982 switch(prop) {
984 // undefined
985 break;
986
988 f->setTipText(htmlValue);
989 return 0;
990
992 int i;
993
994 f->appendItem(strValue);
995 i=f->getNumItems();
996 if (i>10)
997 i=10;
998 f->setNumVisible(i);
999 return 0;
1000 }
1001
1003 f->clearItems();
1004 return 0;
1005
1006 default:
1007 break;
1008 }
1009 break;
1010 }
1011
1013 FXGroupBox *f;
1014
1016 assert(f);
1017
1018 switch(prop) {
1020 f->setText(strValue);
1021 return 0;
1022 default:
1023 break;
1024 }
1025 break;
1026 }
1027
1029 FXRadioButton *f;
1030
1032 assert(f);
1033
1034 switch(prop) {
1036 f->setText(strValue);
1037 return 0;
1038
1040 f->setTipText(htmlValue);
1041 return 0;
1042
1043 default:
1044 break;
1045 }
1046 break;
1047 }
1048
1050 FXCheckButton *f;
1051
1053 assert(f);
1054
1055 switch(prop) {
1057 f->setText(strValue);
1058 return 0;
1059
1061 f->setTipText(htmlValue);
1062 return 0;
1063
1064 default:
1065 break;
1066 }
1067 break;
1068 }
1069
1071 FXWindow *f1;
1072 THEMETABITEM *f2;
1073
1075 assert(f1);
1076 f2=(THEMETABITEM*) (f1->getPrev());
1077 assert(f2);
1078
1079 switch(prop) {
1081 f2->setText(strValue);
1082 return 0;
1083
1085 f2->setTipText(htmlValue);
1086 return 0;
1087
1088 default:
1089 break;
1090 }
1091 break;
1092 }
1093
1095 FXDialogBox *f;
1096
1098 assert(f);
1099
1100 switch(prop) {
1102 f->setTitle(strValue);
1103 return 0;
1104 default:
1105 break;
1106 }
1107 break;
1108 }
1109
1111 FXFoldingList *f;
1112 FXString str;
1113 FXString t;
1114 FXint n=0;
1115
1117 assert(f);
1118
1119 switch(prop) {
1121 f->getHeader()->clearItems();
1122 str=strValue;
1123 while(!(t=str.section('\t',n)).empty()) {
1124 f->appendHeader(t, NULL, 20);
1125 n++;
1126 }
1127 return 0;
1128
1130 f->appendItem(NULL, strValue);
1131 return 0;
1132
1134 f->clearItems();
1135 return 0;
1136
1137 default:
1138 break;
1139 }
1140 break;
1141 }
1142
1144 FXSpinner *f;
1145
1147 assert(f);
1148
1149 switch(prop) {
1151 f->setTipText(htmlValue);
1152 return 0;
1153
1154 default:
1155 break;
1156 }
1157 break;
1158 }
1159
1171 ;
1172 }
1173
1174 /* this block is just to make sure we get warnings when new
1175 * properties are available but not handled here
1176 */
1177 switch(prop) {
1199 break;
1200 }
1201
1202 DBG_WARN(0, "Function is not appropriate for this type of widget (%s)",
1204 return GWEN_ERROR_INVALID;
1205}
1206
1207
1208
1211 int index,
1212 const char *defaultValue) {
1213 FXString str;
1214
1215 switch(GWEN_Widget_GetType(w)) {
1217 return defaultValue;
1219 return defaultValue;
1220
1221 case GWEN_Widget_TypeLabel: {
1222 FOX16_HtmlLabel *f;
1223
1225 assert(f);
1226
1227 switch(prop) {
1229 str=f->getText();
1230 if (str.empty())
1231 return defaultValue;
1232 else {
1235 }
1236
1237 default:
1238 break;
1239 }
1240 break;
1241 }
1242
1244 THEMEBUTTON *f;
1245
1247 assert(f);
1248
1249 switch(prop) {
1251 str=f->getText();
1252 if (str.empty())
1253 return defaultValue;
1254 else {
1257 }
1258
1259 default:
1260 break;
1261 }
1262 break;
1263 }
1264
1266 FXTextField *f;
1267
1269 assert(f);
1270
1271 switch(prop) {
1273 str=f->getText();
1274 if (str.empty())
1275 return defaultValue;
1276 else {
1279 }
1280
1281 default:
1282 break;
1283 }
1284 break;
1285 }
1286
1288 FXText *f;
1289
1291 assert(f);
1292
1293 switch(prop) {
1295 str=f->getText();
1296 if (str.empty())
1297 return defaultValue;
1298 else {
1301 }
1302
1303 default:
1304 break;
1305 }
1306 break;
1307 }
1308
1310 FOX16_HtmlText *f;
1311
1313 assert(f);
1314
1315 switch(prop) {
1317 str=f->getText();
1318 if (str.empty())
1319 return defaultValue;
1320 else {
1323 }
1324
1325 default:
1326 break;
1327 }
1328 break;
1329 }
1330
1332 THEMECOMBOBOX *f;
1333
1335 assert(f);
1336
1337 switch(prop) {
1339 if (index<f->getNumItems()) {
1340 str=f->getItem(index);
1341 if (str.empty())
1342 return defaultValue;
1343 else {
1346 }
1347 }
1348 else {
1349 DBG_ERROR(GWEN_LOGDOMAIN, "Index %d out of range", index);
1350 return defaultValue;
1351 }
1352
1353 default:
1354 break;
1355 }
1356 break;
1357 }
1358
1360 FXGroupBox *f;
1361
1363 assert(f);
1364
1365 switch(prop) {
1367 str=f->getText();
1368 if (str.empty())
1369 return defaultValue;
1370 else {
1373 }
1374
1375 default:
1376 break;
1377 }
1378 break;
1379 }
1380
1382 FXRadioButton *f;
1383
1385 assert(f);
1386
1387 switch(prop) {
1389 str=f->getText();
1390 if (str.empty())
1391 return defaultValue;
1392 else {
1395 }
1396
1397 default:
1398 break;
1399 }
1400 break;
1401 }
1402
1404 FXCheckButton *f;
1405
1407 assert(f);
1408
1409 switch(prop) {
1411 str=f->getText();
1412 if (str.empty())
1413 return defaultValue;
1414 else {
1417 }
1418
1419 default:
1420 break;
1421 }
1422 break;
1423 }
1424
1426 FXWindow *f1;
1427 THEMETABITEM *f2;
1428
1430 assert(f1);
1431 f2=(THEMETABITEM*) (f1->getPrev());
1432 assert(f2);
1433
1434 switch(prop) {
1436 str=f2->getText();
1437 if (str.empty())
1438 return defaultValue;
1439 else {
1442 }
1443
1444 default:
1445 break;
1446 }
1447
1448 break;
1449 }
1450
1452 FXDialogBox *f;
1453
1455 assert(f);
1456
1457 switch(prop) {
1459 str=f->getTitle();
1460 if (str.empty())
1461 return defaultValue;
1462 else {
1465 }
1466
1467 default:
1468 break;
1469 }
1470 break;
1471 }
1472
1474 FXFoldingList *f;
1475 FXHeader *fh;
1476 FXFoldingItem *fi;
1477
1479 assert(f);
1480
1481 switch(prop) {
1483 fh=f->getHeader();
1484 if (fh) {
1485 int i;
1486
1487 for (i=0; i<fh->getNumItems(); i++) {
1488 if (!str.empty())
1489 str+="\t";
1490 str+=fh->getItemText(i);
1491 }
1492 }
1493
1494 if (str.empty())
1495 return defaultValue;
1496 else {
1499 }
1500
1502 fi=f->getFirstItem();
1503 if (fi) {
1504 int i=index;
1505
1506 while(fi && i>0) {
1507 fi=fi->getNext();
1508 i--;
1509 }
1510 if (fi) {
1511 str=fi->getText();
1512 if (str.empty())
1513 return defaultValue;
1516 }
1517 else {
1518 DBG_ERROR(GWEN_LOGDOMAIN, "Index %d out of range", index);
1519 return defaultValue;
1520 }
1521 }
1522 else {
1523 DBG_ERROR(GWEN_LOGDOMAIN, "Empty list");
1524 return defaultValue;
1525 }
1526
1527 default:
1528 break;
1529 }
1530 break;
1531 }
1532
1533
1546 break;
1547 }
1548
1549 /* this block is just to make sure we get warnings when new
1550 * properties are available but not handled here
1551 */
1552 switch(prop) {
1574 break;
1575 }
1576
1577
1578 DBG_WARN(0, "Function is not appropriate for this type of widget (%s)",
1580 return defaultValue;
1581}
1582
1583
1584
1585
1586
1587long FOX16_GuiDialog::onSelCommand(FXObject *sender, FXSelector sel, void *ptr) {
1588 GWEN_WIDGET *w;
1589 const char *wname;
1591 FXDialogBox *dialogBox;
1592
1594 if (w==NULL) {
1595 if (!m_radioGroups.empty()) {
1596 std::list<RadioButtonGroup*>::iterator it;
1598
1599 for (it=m_radioGroups.begin(); it!=m_radioGroups.end(); it++) {
1600 if ((*it)->getDataTarget()==sender) {
1601 grp=*it;
1602 break;
1603 }
1604 }
1605
1606 if (grp==NULL) {
1607 DBG_WARN(GWEN_LOGDOMAIN, "Widget or RadioButtonGroup not found");
1608 return 0;
1609 }
1610 else {
1611 DBG_INFO(0, "Found button group %d: %d", grp->getGroupId(), grp->getRadioValue());
1612 // no signal for now
1613 return 1;
1614 }
1615 }
1616 }
1617 wname=GWEN_Widget_GetName(w);
1618
1619 dialogBox=_mainWidget;
1620
1621 DBG_DEBUG(GWEN_LOGDOMAIN, "Command for [%s] (type: %s)",
1622 wname?wname:"(unnamed)",
1624
1625 switch(GWEN_Widget_GetType(w)) {
1627 return GWEN_ERROR_GENERIC;
1628
1630 return GWEN_ERROR_GENERIC;
1631
1642 break;
1647 break;
1648
1649 case GWEN_Widget_TypeRadioButton: /* use SEL_UPDATED for FXRadioButton */
1665 /* nothing to do for these types */
1666 ;
1667 }
1668
1670 dialogBox->getApp()->stopModal(dialogBox, 1);
1671 }
1672 else if (rv==GWEN_DialogEvent_ResultReject) {
1673 dialogBox->getApp()->stopModal(dialogBox, 0);
1674 }
1675
1676 return 1;
1677}
1678
1679
1680
1681long FOX16_GuiDialog::onSelChanged(FXObject *sender, FXSelector sel, void *ptr) {
1682 GWEN_WIDGET *w;
1684 FXDialogBox *dialogBox;
1685
1687 if (w==NULL) {
1688 DBG_INFO(0, "Widget not found");
1689 return 0;
1690 }
1691
1692 dialogBox=_mainWidget;
1693
1694 switch(GWEN_Widget_GetType(w)) {
1696 return GWEN_ERROR_GENERIC;
1698 return GWEN_ERROR_GENERIC;
1704 break;
1705
1728 ;
1729 }
1730
1733 dialogBox->getApp()->stopModal(dialogBox, 1);
1734 }
1735 else if (rv==GWEN_DialogEvent_ResultReject) {
1737 dialogBox->getApp()->stopModal(dialogBox, 0);
1738 }
1739
1740 return 1;
1741}
1742
1743
1744
1745long FOX16_GuiDialog::onSelKeyPress(FXObject *sender, FXSelector sel, void *ptr) {
1746 GWEN_WIDGET *w;
1747 FXEvent* event=(FXEvent*)ptr;
1748 int rv;
1749
1751 if (w==NULL) {
1752 DBG_INFO(0, "Widget not found");
1753 return 0;
1754 }
1755
1756 switch(GWEN_Widget_GetType(w)) {
1759 return 0;
1760
1762 /* catch ENTER key */
1763 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1764 return 1;
1765 }
1766 return 0;
1767
1793 return 1;
1794 }
1795
1796 return 0;
1797}
1798
1799
1800
1801long FOX16_GuiDialog::onSelKeyRelease(FXObject *sender, FXSelector sel, void *ptr) {
1802 GWEN_WIDGET *w;
1803 FXEvent* event=(FXEvent*)ptr;
1804 int rv;
1805
1807 if (w==NULL) {
1808 DBG_INFO(0, "Widget not found");
1809 return 0;
1810 }
1811
1812 switch(GWEN_Widget_GetType(w)) {
1814 /* catch ENTER key */
1815 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1816 return 1;
1817 }
1818 return 0;
1819
1847 return 1;
1848 }
1849
1850 return 0;
1851}
1852
1853
1854
1855bool FOX16_GuiDialog::setup(FXWindow *parentWindow) {
1856 FXWindow *xw;
1857 GWEN_WIDGET_TREE *wtree;
1858 GWEN_WIDGET *w;
1859 int rv;
1860
1862 if (wtree==NULL) {
1863 DBG_ERROR(GWEN_LOGDOMAIN, "No widget tree in dialog");
1864 return false;
1865 }
1866 w=GWEN_Widget_Tree_GetFirst(wtree);
1867 if (w==NULL) {
1868 DBG_ERROR(GWEN_LOGDOMAIN, "No widgets in dialog");
1869 return false;
1870 }
1871
1872 xw=setupTree(parentWindow, w);
1873 if (xw==NULL) {
1874 DBG_INFO(0, "here");
1875 return false;
1876 }
1877
1878 _mainWidget=dynamic_cast<FXDialogBox*>(xw);
1879 assert(_mainWidget);
1880
1881 /* create X11 server side resources */
1882 xw->create();
1883
1884 m_sizeChanged=FALSE;
1886 if (rv<0) {
1887 DBG_INFO(0, "Error initializing dialog: %d", rv);
1888 return false;
1889 }
1890 if (!m_sizeChanged) {
1891 DBG_ERROR(0, "Resizing dialog myself");
1892 xw->resize(xw->getDefaultWidth(), xw->getDefaultHeight());
1893 }
1894 xw->layout();
1895
1896 return true;
1897}
1898
1899
1900
1901
1902FXWindow *FOX16_GuiDialog::setupTree(FXWindow *parentWindow, GWEN_WIDGET *w) {
1903 const char *s;
1904 const char *name;
1905 FXuint opts=0;
1906 uint32_t flags;
1907 FXString text;
1908 FXString htmlText;
1909 FXComposite *parentComposite=NULL;
1910 FXWindow *wChild=NULL;
1911 FXWindow *wContent=NULL;
1912 GWEN_WIDGET *parentWidget;
1913 int cols;
1914 int rows;
1915
1916 /* sample data */
1917 flags=GWEN_Widget_GetFlags(w);
1918 s=GWEN_Widget_GetText(w, 0);
1919 if (s) {
1920 text=FXString(s);
1921 htmlText=FOX16_Gui::getHtmlText(s);
1922 }
1923 name=GWEN_Widget_GetName(w);
1924 cols=GWEN_Widget_GetColumns(w);
1925 rows=GWEN_Widget_GetRows(w);
1926
1927 parentWidget=GWEN_Widget_Tree_GetParent(w);
1928
1929 /* check for parent type */
1930 if (parentWindow)
1931 parentComposite=dynamic_cast<FXComposite*>(parentWindow);
1932 if (parentComposite==NULL) {
1933 switch(GWEN_Widget_GetType(w)) {
1935 /* these types don't need the parent to be a FXComposite */
1936 break;
1937 default:
1938 DBG_ERROR(GWEN_LOGDOMAIN, "Parent of widget [%s] (type %d) is not a composite",
1939 name?name:"(unnamed)", GWEN_Widget_GetType(w));
1940 return NULL;
1941 }
1942 }
1943
1944 /* setup info for new widget */
1945 if (flags & GWEN_WIDGET_FLAGS_FILLX)
1946 opts|=LAYOUT_FILL_X | LAYOUT_FILL_COLUMN;
1947 if (flags & GWEN_WIDGET_FLAGS_FILLY)
1948 opts|=LAYOUT_FILL_Y;
1950 opts|=DECOR_SHRINKABLE;
1952 opts|=DECOR_STRETCHABLE;
1954 opts|=DECOR_MINIMIZE;
1956 opts|=DECOR_MAXIMIZE;
1958 opts|=DECOR_CLOSE;
1959 if (flags & GWEN_WIDGET_FLAGS_DECOR_MENU)
1960 opts|=DECOR_MENU;
1962 opts|=PACK_UNIFORM_WIDTH;
1964 opts|=PACK_UNIFORM_HEIGHT;
1966 opts|=JUSTIFY_LEFT;
1968 opts|=JUSTIFY_RIGHT;
1970 opts|=JUSTIFY_TOP;
1972 opts|=JUSTIFY_BOTTOM;
1974 opts|=JUSTIFY_CENTER_X;
1976 opts|=JUSTIFY_CENTER_Y;
1978 opts|=FRAME_SUNKEN;
1980 opts|=FRAME_RAISED;
1982 opts|=FRAME_THICK;
1984 opts|=FRAME_GROOVE;
1985
1986 /* create THIS widget */
1987 switch(GWEN_Widget_GetType(w)) {
1988
1989 case GWEN_Widget_TypeLabel: {
1990 FOX16_HtmlLabel *label;
1991 int wi;
1992 const char *s;
1994
1997 label=new FOX16_HtmlLabel(parentComposite,
1998 htmlText,
1999 opts);
2001 if (s && *s) {
2002 FXIcon *ic;
2003
2004 ic=getIcon(s);
2005 if (ic)
2006 label->setIcon(ic);
2007 }
2008
2010 if (wi>0)
2011 label->setMaxDefaultWidth(wi);
2012
2013 /* copy media paths to label */
2015 while(se) {
2016 const char *s;
2017
2019 assert(s);
2020 label->addMediaPath(s);
2022 }
2023
2024 wChild=label;
2025 break;
2026 }
2027
2029 const char *s;
2030 FXIcon *ic=NULL;
2031
2033 opts|=BUTTON_DEFAULT | BUTTON_INITIAL | BUTTON_NORMAL;
2034 else
2035 opts|=BUTTON_NORMAL;
2037 if (s && *s)
2038 ic=getIcon(s);
2039
2040 wChild=new THEMEBUTTON(parentComposite,
2041 text,
2042 ic, /* icon */
2043 this,
2045 opts);
2046 break;
2047 }
2048
2050 if (flags & GWEN_WIDGET_FLAGS_PASSWORD)
2051 opts|=TEXTFIELD_PASSWD;
2052 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2053 opts|=TEXTFIELD_READONLY;
2054 wChild=new FXTextField(parentComposite,
2055 cols?cols:16,
2056 this,
2058 opts | TEXTFIELD_NORMAL | TEXTFIELD_ENTER_ONLY);
2059 break;
2060
2062 FXText *f;
2063
2064 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2065 opts|=TEXT_READONLY;
2066 f=new FXText(parentComposite,
2067 this,
2069 opts | HSCROLLING_OFF);
2070 if (cols)
2071 f->setVisibleColumns(cols);
2072 if (rows)
2073 f->setVisibleRows(rows);
2074 wChild=f;
2075 break;
2076 }
2077
2079 FOX16_HtmlText *f;
2080
2081 f=new FOX16_HtmlText(parentComposite, "",
2082 opts | HSCROLLING_OFF);
2083 wChild=f;
2084 break;
2085 }
2086
2088 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2089 opts|=COMBOBOX_STATIC;
2090 wChild=new THEMECOMBOBOX(parentComposite,
2091 cols?cols:16,
2092 this,
2094 opts);
2095 break;
2096
2098 FXRadioButton *rb;
2099 int groupId;
2101 std::list<RadioButtonGroup*>::iterator it;
2102
2103 groupId=GWEN_Widget_GetGroupId(w);
2104
2105
2106 for (it=m_radioGroups.begin(); it!=m_radioGroups.end(); it++) {
2107 if ((*it)->getGroupId()==groupId) {
2108 grp=*it;
2109 }
2110 }
2111 if (grp==NULL) {
2112 grp=new RadioButtonGroup(groupId, this, ID_WIDGET_FIRST+_widgetCount);
2113 m_radioGroups.push_back(grp);
2114 }
2115
2116 rb=new FXRadioButton(parentComposite,
2117 text,
2118 grp->getDataTarget(),
2119 FXDataTarget::ID_OPTION+grp->getButtonCount(),
2120 opts | RADIOBUTTON_NORMAL);
2121 grp->addButton(rb);
2122 wChild=rb;
2123 break;
2124 }
2125
2127 wChild=new FXProgressBar(parentComposite,
2128 this,
2130 opts | PROGRESSBAR_NORMAL | PROGRESSBAR_PERCENTAGE);
2131 break;
2132
2134 wChild=new FXGroupBox(parentComposite,
2135 text,
2136 opts | GROUPBOX_NORMAL | FRAME_LINE);
2137 break;
2138
2140 wChild=new FXSpring(parentComposite, opts | LAYOUT_FILL_X);
2141 break;
2142
2144 wChild=new FXSpring(parentComposite, opts | LAYOUT_FILL_Y);
2145 break;
2146
2148 wChild=new FXHorizontalFrame(parentComposite, opts,
2149 0, 0, 0, 0, 0, 0, 0, 0);
2150 break;
2151
2153 wChild=new FXVerticalFrame(parentComposite, opts,
2154 0, 0, 0, 0, 0, 0, 0, 0);
2155 break;
2156
2158 if (cols & rows) {
2159 DBG_ERROR(GWEN_LOGDOMAIN, "State columns *or* rows, not both in widget [%s]",
2160 name?name:"(unnamed)");
2161 return NULL;
2162 }
2163 if (cols)
2164 wChild=new FXMatrix(parentComposite, cols,
2165 opts | MATRIX_BY_COLUMNS,
2166 0, 0, 0, 0, 0, 0, 0, 0);
2167 else
2168 wChild=new FXMatrix(parentComposite, rows,
2169 opts | MATRIX_BY_ROWS,
2170 0, 0, 0, 0, 0, 0, 0, 0);
2171 break;
2172
2174 wChild=new FOX16_GuiSortingList(parentComposite,
2175 this,
2177 opts | FRAME_SUNKEN|FRAME_THICK | LISTBOX_NORMAL);
2178 break;
2179
2181 if (parentWindow)
2182 wChild=new FXDialogBox(parentWindow,
2183 name?FXString(name):FXString(""),
2184 opts | DECOR_TITLE | DECOR_BORDER);
2185 else
2186 wChild=new FXDialogBox(FXApp::instance(),
2187 name?FXString(name):FXString(""),
2188 opts | DECOR_TITLE | DECOR_BORDER);
2189 break;
2190
2192 wChild=new FXTabBook(parentComposite,
2193 this,
2195 opts | TABBOOK_NORMAL);
2196 break;
2197
2199 if (parentWidget==NULL) {
2200 DBG_ERROR(GWEN_LOGDOMAIN, "Widget [%s] has no parent", name?name:"(unnamed)");
2201 return NULL;
2202 }
2203 else {
2204 FXTabBook *tbook=dynamic_cast<FXTabBook*>(parentWindow);
2205 if (tbook==NULL) {
2206 DBG_ERROR(GWEN_LOGDOMAIN, "Parent of widget [%s] needs to be of type TabBook", name?name:"(unnamed)");
2207 return NULL;
2208 }
2209
2210 new THEMETABITEM(tbook, text, NULL, opts | TAB_TOP_NORMAL);
2211 wChild=new FXVerticalFrame(tbook, opts);
2212 }
2213 break;
2214
2216 wChild=new FXCheckButton(parentComposite,
2217 text,
2218 this,
2220 opts | CHECKBUTTON_NORMAL);
2221 break;
2222
2224 FXScrollWindow *f;
2225
2226 f=new FXScrollWindow(parentComposite, opts);
2227 wChild=f;
2228 wContent=f->contentWindow();
2229 break;
2230 }
2231
2233 wChild=new FXSwitcher(parentComposite, opts);
2234 break;
2235
2237 wChild=new FXHorizontalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2238 break;
2239
2241 wChild=new FXVerticalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2242 break;
2243
2245 wChild=new FXSpinner(parentComposite,
2246 cols?cols:16,
2247 this,
2249 opts | SPIN_NORMAL);
2250 break;
2251
2253 DBG_ERROR(GWEN_LOGDOMAIN, "Widget [%s] is of type \'unknown\'", name?name:"(unnamed)");
2254 return NULL;
2256 DBG_ERROR(GWEN_LOGDOMAIN, "Widget [%s] is of type \'none\'", name?name:"(unnamed)");
2257 return NULL;
2258 }
2259
2260 assert(wChild);
2261 _widgetCount++;
2262
2263 if (wContent==NULL)
2264 wContent=wChild;
2265
2268
2269 /* handle children */
2270 w=GWEN_Widget_Tree_GetFirstChild(w);
2271 while(w) {
2272 if (NULL==setupTree(wContent, w))
2273 return NULL;
2274 w=GWEN_Widget_Tree_GetNext(w);
2275 }
2276
2277 return wChild;
2278}
2279
2280
2281
2283 FXDialogBox *dialogBox;
2284
2285 dialogBox=_mainWidget;
2286 return dialogBox->getApp()->runModalFor(dialogBox);
2287}
2288
2289
2290
2292 FXDialogBox *dialogBox;
2293
2294 dialogBox=_mainWidget;
2295
2296 /* show dialog */
2297 dialogBox->layout();
2298 dialogBox->show(PLACEMENT_OWNER);
2299
2300 return 0;
2301}
2302
2303
2304
2306 FXDialogBox *dialogBox;
2307
2308 dialogBox=_mainWidget;
2309
2310 /* let dialog write its settings */
2312
2313 /* hide dialog */
2314 dialogBox->hide();
2315 delete _mainWidget;
2317
2318 return 0;
2319}
2320
2321
2322
#define NULL
Definition binreloc.c:300
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
Definition buffer.c:42
void GWEN_Buffer_free(GWEN_BUFFER *bf)
Definition buffer.c:89
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition buffer.c:235
CppDialog(GWEN_DIALOG *dlg)
GWEN_DIALOG * _dialog
Definition cppdialog.hpp:50
static CPPGUI_API CppDialog * getDialog(GWEN_DIALOG *dlg)
virtual int setIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int value, int doSignal)
std::list< RadioButtonGroup * > m_radioGroups
long onSelKeyRelease(FXObject *sender, FXSelector sel, void *ptr)
FXIconSource * m_iconSource
FXWindow * setupTree(FXWindow *parentWindow, GWEN_WIDGET *w)
FXDialogBox * _mainWidget
static FOX16_GuiDialog * getDialog(GWEN_DIALOG *dlg)
long onSelCommand(FXObject *sender, FXSelector sel, void *ptr)
virtual const char * getCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *defaultValue)
std::list< FXIcon * > m_iconList
long onSelKeyPress(FXObject *sender, FXSelector sel, void *ptr)
virtual int setCharProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, const char *value, int doSignal)
long onSelChanged(FXObject *sender, FXSelector sel, void *ptr)
FXIcon * getIcon(const char *fileName)
virtual int getIntProperty(GWEN_WIDGET *w, GWEN_DIALOG_PROPERTY prop, int index, int defaultValue)
bool setup(FXWindow *parentWindow)
FOX16_GuiDialog(FOX16_Gui *gui, GWEN_DIALOG *dlg)
FXbool getHeaderArrowDir(int c) const
virtual void sortByColumn(int c, bool up)
void setHeaderArrowDir(int c, FXbool b)
FXFoldingItem * getItem(int idx)
static FOX16GUI_API FXString getHtmlText(const char *text)
static FOX16GUI_API FXString getRawText(const char *text)
FXString getText() const
Get the text for this label.
void addMediaPath(const char *s)
void setIcon(FXIcon *ic)
void setMaxDefaultWidth(int i)
void setText(const FXString &text)
Set the text for this label.
FXString getText() const
Get the text for this label.
void setText(const FXString &text)
Set the text for this label.
void makePositionVisible(FXint pos)
#define DBG_INFO(dbg_logger, format,...)
Definition debug.h:181
#define DBG_ERROR(dbg_logger, format,...)
Definition debug.h:97
#define DBG_WARN(dbg_logger, format,...)
Definition debug.h:125
#define DBG_DEBUG(dbg_logger, format,...)
Definition debug.h:214
int GWEN_Dialog_EmitSignalToAll2(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender, int intArg, const char *stringArg)
Definition dialog.c:377
GWEN_WIDGET_TREE * GWEN_Dialog_GetWidgets(const GWEN_DIALOG *dlg)
Definition dialog.c:629
GWEN_WIDGET * GWEN_Dialog_FindWidgetByImplData(const GWEN_DIALOG *dlg, int index, const void *ptr)
Definition dialog.c:605
GWEN_STRINGLIST * GWEN_Dialog_GetMediaPaths(const GWEN_DIALOG *dlg)
Definition dialog.c:295
int GWEN_Dialog_EmitSignalToAll(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
Definition dialog.c:330
int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
Definition dialog.c:321
#define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE
Definition dialog.h:70
#define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT
Definition dialog.h:80
#define GWEN_WIDGET_FLAGS_FRAME_RAISED
Definition dialog.h:91
#define GWEN_WIDGET_FLAGS_FILLY
Definition dialog.h:62
#define GWEN_WIDGET_FLAGS_PASSWORD
Definition dialog.h:64
#define GWEN_WIDGET_FLAGS_DECOR_CLOSE
Definition dialog.h:71
#define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE
Definition dialog.h:67
@ GWEN_DialogSortDirection_None
Definition dialog.h:297
@ GWEN_DialogSortDirection_Up
Definition dialog.h:298
@ GWEN_DialogSortDirection_Down
Definition dialog.h:299
#define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE
Definition dialog.h:68
#define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT
Definition dialog.h:77
#define GWEN_WIDGET_FLAGS_FILLX
Definition dialog.h:61
struct GWEN_DIALOG GWEN_DIALOG
Definition dialog.h:54
#define GWEN_WIDGET_FLAGS_JUSTIFY_TOP
Definition dialog.h:81
#define GWEN_WIDGET_FLAGS_READONLY
Definition dialog.h:63
GWEN_DIALOG_PROPERTY
Definition dialog.h:260
@ GWEN_DialogProperty_WindowId
Definition dialog.h:283
@ GWEN_DialogProperty_SelectionState
Definition dialog.h:275
@ GWEN_DialogProperty_AddValue
Definition dialog.h:268
@ GWEN_DialogProperty_MinValue
Definition dialog.h:265
@ GWEN_DialogProperty_ToolTip
Definition dialog.h:281
@ GWEN_DialogProperty_Visibility
Definition dialog.h:280
@ GWEN_DialogProperty_ColumnWidth
Definition dialog.h:271
@ GWEN_DialogProperty_MaxValue
Definition dialog.h:266
@ GWEN_DialogProperty_None
Definition dialog.h:261
@ GWEN_DialogProperty_ValueCount
Definition dialog.h:270
@ GWEN_DialogProperty_Title
Definition dialog.h:263
@ GWEN_DialogProperty_Sort
Definition dialog.h:279
@ GWEN_DialogProperty_ClearValues
Definition dialog.h:269
@ GWEN_DialogProperty_SelectionMode
Definition dialog.h:274
@ GWEN_DialogProperty_Height
Definition dialog.h:273
@ GWEN_DialogProperty_SortDirection
Definition dialog.h:278
@ GWEN_DialogProperty_Enabled
Definition dialog.h:267
@ GWEN_DialogProperty_Value
Definition dialog.h:264
@ GWEN_DialogProperty_Unknown
Definition dialog.h:285
@ GWEN_DialogProperty_Focus
Definition dialog.h:276
@ GWEN_DialogProperty_Width
Definition dialog.h:272
@ GWEN_DialogEvent_TypeKeyPressed
Definition dialog.h:106
@ GWEN_DialogEvent_TypeValueChanged
Definition dialog.h:101
@ GWEN_DialogEvent_TypeInit
Definition dialog.h:99
@ GWEN_DialogEvent_TypeFini
Definition dialog.h:100
@ GWEN_DialogEvent_TypeKeyReleased
Definition dialog.h:107
@ GWEN_DialogEvent_TypeActivated
Definition dialog.h:102
#define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT
Definition dialog.h:79
@ GWEN_DialogEvent_ResultAccept
Definition dialog.h:122
@ GWEN_DialogEvent_ResultNotHandled
Definition dialog.h:121
@ GWEN_DialogEvent_ResultReject
Definition dialog.h:123
#define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE
Definition dialog.h:69
#define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM
Definition dialog.h:82
#define GWEN_WIDGET_FLAGS_EQUAL_WIDTH
Definition dialog.h:76
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX
Definition dialog.h:83
#define GWEN_WIDGET_FLAGS_FRAME_SUNKEN
Definition dialog.h:90
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY
Definition dialog.h:84
#define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET
Definition dialog.h:65
@ GWEN_Dialog_SelectionMode_None
Definition dialog.h:290
@ GWEN_Dialog_SelectionMode_Multi
Definition dialog.h:292
@ GWEN_Dialog_SelectionMode_Single
Definition dialog.h:291
#define GWEN_WIDGET_FLAGS_NO_WORDWRAP
Definition dialog.h:86
#define GWEN_WIDGET_FLAGS_FRAME_GROOVE
Definition dialog.h:93
#define GWEN_WIDGET_FLAGS_FRAME_THICK
Definition dialog.h:92
#define GWEN_WIDGET_FLAGS_DECOR_MENU
Definition dialog.h:72
GWENHYWFAR_API int GWEN_Directory_FindFileInPaths(const GWEN_STRINGLIST *paths, const char *filePath, GWEN_BUFFER *fbuf)
#define GWEN_ERROR_INVALID
Definition error.h:67
#define GWEN_ERROR_GENERIC
Definition error.h:62
#define FOX16_DIALOG_STRING_TITLE
#define FOX16_DIALOG_STRING_VALUE
FXDEFMAP(FOX16_GuiDialog) FOX16_GuiDialogMap[]
#define FOX16_DIALOG_WIDGET_CONTENT
#define FOX16_DIALOG_WIDGET_REAL
FXIMPLEMENT(FOX16_GuiSortingList, FXFoldingList, FOX16_GuiSortingListMap, ARRAYNUMBER(FOX16_GuiSortingListMap)) FOX16_GuiSortingList
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
#define GWEN_LOGDOMAIN
Definition logger.h:35
const char * GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se)
Definition stringlist.c:406
GWEN_STRINGLISTENTRY * GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se)
Definition stringlist.c:398
GWEN_STRINGLISTENTRY * GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl)
Definition stringlist.c:390
struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY
Definition stringlist.h:53
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition stringlist.h:56
#define THEMEBUTTON
Definition theme.h:23
#define THEMETABITEM
Definition theme.h:31
#define THEMECOMBOBOX
Definition theme.h:25
int GWEN_Widget_GetColumns(const GWEN_WIDGET *w)
Definition widget.c:203
const char * GWEN_Widget_GetName(const GWEN_WIDGET *w)
Definition widget.c:320
int GWEN_Widget_GetWidth(const GWEN_WIDGET *w)
Definition widget.c:257
void GWEN_Widget_SetImplData(GWEN_WIDGET *w, int index, void *ptr)
Store a pointer with the widget.
Definition widget.c:136
void * GWEN_Widget_GetImplData(const GWEN_WIDGET *w, int index)
Definition widget.c:122
void GWEN_Widget_SetText(GWEN_WIDGET *w, int idx, const char *s)
Definition widget.c:304
const char * GWEN_Widget_GetText(const GWEN_WIDGET *w, int idx)
Definition widget.c:293
const char * GWEN_Widget_GetIconFileName(const GWEN_WIDGET *w)
Definition widget.c:342
uint32_t GWEN_Widget_GetFlags(const GWEN_WIDGET *w)
Definition widget.c:149
const char * GWEN_Widget_Type_toString(GWEN_WIDGET_TYPE t)
Definition widget.c:452
GWEN_DIALOG * GWEN_Widget_GetDialog(const GWEN_WIDGET *w)
Definition widget.c:92
int GWEN_Widget_GetGroupId(const GWEN_WIDGET *w)
Definition widget.c:239
GWEN_WIDGET_TYPE GWEN_Widget_GetType(const GWEN_WIDGET *w)
Definition widget.c:185
int GWEN_Widget_GetRows(const GWEN_WIDGET *w)
Definition widget.c:221
struct GWEN_WIDGET GWEN_WIDGET
Definition widget_be.h:34
@ GWEN_Widget_TypeTabBook
Definition widget_be.h:67
@ GWEN_Widget_TypeNone
Definition widget_be.h:51
@ GWEN_Widget_TypeComboBox
Definition widget_be.h:56
@ GWEN_Widget_TypeTabPage
Definition widget_be.h:68
@ GWEN_Widget_TypeRadioButton
Definition widget_be.h:57
@ GWEN_Widget_TypeHLayout
Definition widget_be.h:62
@ GWEN_Widget_TypeLineEdit
Definition widget_be.h:54
@ GWEN_Widget_TypeWidgetStack
Definition widget_be.h:70
@ GWEN_Widget_TypeScrollArea
Definition widget_be.h:71
@ GWEN_Widget_TypeLabel
Definition widget_be.h:52
@ GWEN_Widget_TypeGroupBox
Definition widget_be.h:59
@ GWEN_Widget_TypeDialog
Definition widget_be.h:66
@ GWEN_Widget_TypePushButton
Definition widget_be.h:53
@ GWEN_Widget_TypeCheckBox
Definition widget_be.h:69
@ GWEN_Widget_TypeTextBrowser
Definition widget_be.h:74
@ GWEN_Widget_TypeHSpacer
Definition widget_be.h:60
@ GWEN_Widget_TypeHLine
Definition widget_be.h:72
@ GWEN_Widget_TypeTextEdit
Definition widget_be.h:55
@ GWEN_Widget_TypeGridLayout
Definition widget_be.h:64
@ GWEN_Widget_TypeVLayout
Definition widget_be.h:63
@ GWEN_Widget_TypeProgressBar
Definition widget_be.h:58
@ GWEN_Widget_TypeSpinBox
Definition widget_be.h:75
@ GWEN_Widget_TypeVSpacer
Definition widget_be.h:61
@ GWEN_Widget_TypeUnknown
Definition widget_be.h:50
@ GWEN_Widget_TypeVLine
Definition widget_be.h:73
@ GWEN_Widget_TypeListBox
Definition widget_be.h:65