21 #include <gwenhywfar/dialog_be.h>
22 #include <gwenhywfar/directory.h>
23 #include <gwenhywfar/debug.h>
32 #define FOX16_DIALOG_WIDGET_REAL 0
33 #define FOX16_DIALOG_WIDGET_CONTENT 1
35 #define FOX16_DIALOG_STRING_TITLE 0
36 #define FOX16_DIALOG_STRING_VALUE 1
84 std::list<FXIcon*>::iterator it;
94 std::list<RadioButtonGroup*>::iterator it;
154 FXDialogBox *dialogBox;
160 dialogBox->show(PLACEMENT_OWNER);
161 rv=dialogBox->execute();
197 if (value<f->getNumItems()) {
198 f->setCurrentItem(value, doSignal?TRUE:FALSE);
225 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
243 f->setProgress(value);
312 fi=f->getFirstItem();
313 while(fi && i<value) {
318 f->setCurrentItem(fi, doSignal?TRUE:FALSE);
326 f->setHeaderSize(index, value);
334 f->setListStyle(FOLDINGLIST_BROWSESELECT);
337 f->setListStyle(FOLDINGLIST_EXTENDEDSELECT);
353 ti->setSelected((value==0)?FALSE:TRUE);
365 for (i=0; i<f->getNumHeaders(); i++) {
400 for (i=0; i<f->getNumHeaders(); i++) {
431 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
449 f->setCurrent(value, doSignal?TRUE:FALSE);
467 f->setCurrent(value, doSignal?TRUE:FALSE);
504 f->resize(value, f->getHeight());
509 f->resize(f->getWidth(), value);
553 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
578 return f->getCurrentItem();
581 return f->getNumItems();
598 return (f->getCheck()==TRUE)?1:0;
615 return f->getProgress();
621 return f->getTotal();
639 return f->getValue();
673 fi=f->getCurrentItem();
680 while( (ti=ti->getPrev()) )
687 return f->getNumItems();
690 return f->getHeaderSize(index);
694 switch(f->getListStyle()) {
695 case FOLDINGLIST_BROWSESELECT:
697 case FOLDINGLIST_EXTENDEDSELECT:
710 ti=f->getFirstItem();
717 return (ti->isSelected()==TRUE)?1:0;
725 for (i=0; i<f->getNumHeaders(); i++) {
758 return (f->getCheck()==TRUE)?1:0;
776 return f->getCurrent();
794 return f->getCurrent();
831 return f->getWidth();
834 return f->getHeight();
837 return (f->isEnabled()==TRUE)?1:0;
840 return (f->hasFocus())?1:0;
863 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
879 if (value && *value) {
949 f->setTipText(htmlValue);
967 f->setText(value, doSignal?TRUE:FALSE);
971 f->setTipText(htmlValue);
989 f->setText(strValue);
993 f->setTipText(htmlValue);
1015 f->setTipText(htmlValue);
1022 f->appendItem(strValue);
1026 f->setNumVisible(i);
1049 f->setText(strValue);
1066 f->setText(strValue);
1070 f->setTipText(htmlValue);
1088 f->setText(strValue);
1092 f->setTipText(htmlValue);
1113 f2->setText(strValue);
1117 f2->setTipText(htmlValue);
1135 f->setTitle(strValue);
1155 f->getHeader()->clearItems();
1157 while(!(t=str.section(
'\t',n)).empty()){
1158 f->appendHeader(t,
NULL, 20);
1164 f->appendItem(
NULL, strValue);
1186 f->setTipText(htmlValue);
1236 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1246 const char *defaultValue) {
1251 return defaultValue;
1253 return defaultValue;
1266 return defaultValue;
1289 return defaultValue;
1312 return defaultValue;
1335 return defaultValue;
1358 return defaultValue;
1379 if (index<f->getNumItems()) {
1380 str=f->getItem(index);
1382 return defaultValue;
1390 return defaultValue;
1410 return defaultValue;
1433 return defaultValue;
1456 return defaultValue;
1482 return defaultValue;
1506 return defaultValue;
1533 for (i=0; i<fh->getNumItems(); i++) {
1536 str+=fh->getItemText(i);
1541 return defaultValue;
1548 fi=f->getFirstItem();
1559 return defaultValue;
1565 return defaultValue;
1570 return defaultValue;
1623 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1625 return defaultValue;
1636 FXDialogBox *dialogBox;
1641 std::list<RadioButtonGroup*>::iterator it;
1645 if ((*it)->getDataTarget()==sender) {
1667 wname?wname:
"(unnamed)",
1715 dialogBox->getApp()->stopModal(dialogBox, 1);
1718 dialogBox->getApp()->stopModal(dialogBox, 0);
1729 FXDialogBox *dialogBox;
1778 dialogBox->getApp()->stopModal(dialogBox, 1);
1782 dialogBox->getApp()->stopModal(dialogBox, 0);
1806 if (((FXEvent*)ptr)->code==KEY_Return || ((FXEvent*)ptr)->code==KEY_KP_Enter) {
1854 if (((FXEvent*)ptr)->code==KEY_Return || ((FXEvent*)ptr)->code==KEY_KP_Enter) {
1894 GWEN_WIDGET_TREE *wtree;
1903 w=GWEN_Widget_Tree_GetFirst(wtree);
1924 DBG_INFO(0,
"Error initializing dialog: %d", rv);
1929 xw->resize(xw->getDefaultWidth(), xw->getDefaultHeight());
1946 FXComposite *parentComposite=
NULL;
1947 FXWindow *wChild=
NULL;
1948 FXWindow *wContent=
NULL;
1964 parentWidget=GWEN_Widget_Tree_GetParent(w);
1968 parentComposite=
dynamic_cast<FXComposite*
>(parentWindow);
1969 if (parentComposite==
NULL) {
1983 opts|=LAYOUT_FILL_X | LAYOUT_FILL_COLUMN;
1985 opts|=LAYOUT_FILL_Y;
1987 opts|=DECOR_SHRINKABLE;
1989 opts|=DECOR_STRETCHABLE;
1991 opts|=DECOR_MINIMIZE;
1993 opts|=DECOR_MAXIMIZE;
1999 opts|=PACK_UNIFORM_WIDTH;
2001 opts|=PACK_UNIFORM_HEIGHT;
2005 opts|=JUSTIFY_RIGHT;
2009 opts|=JUSTIFY_BOTTOM;
2011 opts|=JUSTIFY_CENTER_X;
2013 opts|=JUSTIFY_CENTER_Y;
2062 opts|=BUTTON_DEFAULT | BUTTON_INITIAL | BUTTON_NORMAL;
2064 opts|=BUTTON_NORMAL;
2080 opts|=TEXTFIELD_PASSWD;
2082 opts|=TEXTFIELD_READONLY;
2083 wChild=
new FXTextField(parentComposite,
2087 opts | TEXTFIELD_NORMAL | TEXTFIELD_ENTER_ONLY);
2094 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2095 opts|=TEXT_READONLY;
2096 f=
new FXText(parentComposite,
2099 opts | HSCROLLING_OFF);
2101 f->setVisibleColumns(cols);
2103 f->setVisibleRows(rows);
2113 opts | HSCROLLING_OFF);
2119 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2120 opts|=COMBOBOX_STATIC;
2132 std::list<RadioButtonGroup*>::iterator it;
2138 if ((*it)->getGroupId()==groupId) {
2147 rb=
new FXRadioButton(parentComposite,
2151 opts | RADIOBUTTON_NORMAL);
2158 wChild=
new FXProgressBar(parentComposite,
2161 opts | PROGRESSBAR_NORMAL | PROGRESSBAR_PERCENTAGE);
2165 wChild=
new FXGroupBox(parentComposite,
2167 opts | GROUPBOX_NORMAL | FRAME_LINE);
2171 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_X);
2175 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_Y);
2179 wChild=
new FXHorizontalFrame(parentComposite, opts,
2180 0, 0, 0, 0, 0, 0, 0, 0);
2184 wChild=
new FXVerticalFrame(parentComposite, opts,
2185 0, 0, 0, 0, 0, 0, 0, 0);
2191 name?name:
"(unnamed)");
2195 wChild=
new FXMatrix(parentComposite, cols,
2196 opts | MATRIX_BY_COLUMNS,
2197 0, 0, 0, 0, 0, 0, 0, 0);
2199 wChild=
new FXMatrix(parentComposite, rows,
2200 opts | MATRIX_BY_ROWS,
2201 0, 0, 0, 0, 0, 0, 0, 0);
2208 opts | FRAME_SUNKEN|FRAME_THICK | LISTBOX_NORMAL);
2213 wChild=
new FXDialogBox(parentWindow,
2214 name?FXString(name):FXString(
""),
2215 opts | DECOR_TITLE | DECOR_BORDER);
2217 wChild=
new FXDialogBox(FXApp::instance(),
2218 name?FXString(name):FXString(
""),
2219 opts | DECOR_TITLE | DECOR_BORDER);
2223 wChild=
new FXTabBook(parentComposite,
2226 opts | TABBOOK_NORMAL);
2230 if (parentWidget==
NULL) {
2235 FXTabBook *tbook=
dynamic_cast<FXTabBook*
>(parentWindow);
2242 wChild=
new FXVerticalFrame(tbook, opts);
2247 wChild=
new FXCheckButton(parentComposite,
2251 opts | CHECKBUTTON_NORMAL);
2258 f=
new FXScrollWindow(parentComposite, opts);
2260 wContent=f->contentWindow();
2265 wChild=
new FXSwitcher(parentComposite, opts);
2269 wChild=
new FXHorizontalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2273 wChild=
new FXVerticalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2277 wChild=
new FXSpinner(parentComposite,
2281 opts | SPIN_NORMAL);
2302 w=GWEN_Widget_Tree_GetFirstChild(w);
2306 w=GWEN_Widget_Tree_GetNext(w);
2315 FXDialogBox *dialogBox;
2318 return dialogBox->getApp()->runModalFor(dialogBox);
2324 FXDialogBox *dialogBox;
2329 dialogBox->layout();
2330 dialogBox->show(PLACEMENT_OWNER);
2338 FXDialogBox *dialogBox;