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
82 std::list<FXIcon*>::iterator it;
92 std::list<RadioButtonGroup*>::iterator it;
152 FXDialogBox *dialogBox;
158 dialogBox->show(PLACEMENT_OWNER);
159 rv=dialogBox->execute();
195 if (value<f->getNumItems()) {
196 f->setCurrentItem(value, doSignal?TRUE:FALSE);
223 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
241 f->setProgress(value);
310 fi=f->getFirstItem();
311 while(fi && i<value) {
316 f->setCurrentItem(fi, doSignal?TRUE:FALSE);
324 f->setHeaderSize(index, value);
332 f->setListStyle(FOLDINGLIST_BROWSESELECT);
335 f->setListStyle(FOLDINGLIST_EXTENDEDSELECT);
351 ti->setSelected((value==0)?FALSE:TRUE);
363 for (i=0; i<f->getNumHeaders(); i++) {
398 for (i=0; i<f->getNumHeaders(); i++) {
429 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
447 f->setCurrent(value, doSignal?TRUE:FALSE);
465 f->setCurrent(value, doSignal?TRUE:FALSE);
502 f->resize(value, f->getHeight());
506 f->resize(f->getWidth(), value);
549 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
574 return f->getCurrentItem();
577 return f->getNumItems();
594 return (f->getCheck()==TRUE)?1:0;
611 return f->getProgress();
617 return f->getTotal();
635 return f->getValue();
669 fi=f->getCurrentItem();
676 while( (ti=ti->getPrev()) )
683 return f->getNumItems();
686 return f->getHeaderSize(index);
690 switch(f->getListStyle()) {
691 case FOLDINGLIST_BROWSESELECT:
693 case FOLDINGLIST_EXTENDEDSELECT:
706 ti=f->getFirstItem();
713 return (ti->isSelected()==TRUE)?1:0;
721 for (i=0; i<f->getNumHeaders(); i++) {
754 return (f->getCheck()==TRUE)?1:0;
772 return f->getCurrent();
790 return f->getCurrent();
827 return f->getWidth();
830 return f->getHeight();
833 return (f->isEnabled()==TRUE)?1:0;
836 return (f->hasFocus())?1:0;
859 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
875 if (value && *value) {
945 f->setTipText(htmlValue);
963 f->setText(value, doSignal?TRUE:FALSE);
967 f->setTipText(htmlValue);
985 f->setText(strValue);
989 f->setTipText(htmlValue);
1011 f->setTipText(htmlValue);
1018 f->appendItem(strValue);
1022 f->setNumVisible(i);
1045 f->setText(strValue);
1062 f->setText(strValue);
1066 f->setTipText(htmlValue);
1084 f->setText(strValue);
1088 f->setTipText(htmlValue);
1109 f2->setText(strValue);
1113 f2->setTipText(htmlValue);
1131 f->setTitle(strValue);
1151 f->getHeader()->clearItems();
1153 while(!(t=str.section(
'\t',n)).empty()){
1154 f->appendHeader(t,
NULL, 20);
1160 f->appendItem(
NULL, strValue);
1182 f->setTipText(htmlValue);
1232 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1242 const char *defaultValue) {
1247 return defaultValue;
1249 return defaultValue;
1262 return defaultValue;
1285 return defaultValue;
1308 return defaultValue;
1331 return defaultValue;
1354 return defaultValue;
1375 if (index<f->getNumItems()) {
1376 str=f->getItem(index);
1378 return defaultValue;
1386 return defaultValue;
1406 return defaultValue;
1429 return defaultValue;
1452 return defaultValue;
1478 return defaultValue;
1502 return defaultValue;
1529 for (i=0; i<fh->getNumItems(); i++) {
1532 str+=fh->getItemText(i);
1537 return defaultValue;
1544 fi=f->getFirstItem();
1555 return defaultValue;
1561 return defaultValue;
1566 return defaultValue;
1619 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1621 return defaultValue;
1632 FXDialogBox *dialogBox;
1637 std::list<RadioButtonGroup*>::iterator it;
1641 if ((*it)->getDataTarget()==sender) {
1663 wname?wname:
"(unnamed)",
1711 dialogBox->getApp()->stopModal(dialogBox, 1);
1714 dialogBox->getApp()->stopModal(dialogBox, 0);
1725 FXDialogBox *dialogBox;
1774 dialogBox->getApp()->stopModal(dialogBox, 1);
1778 dialogBox->getApp()->stopModal(dialogBox, 0);
1802 if (((FXEvent*)ptr)->code==KEY_Return || ((FXEvent*)ptr)->code==KEY_KP_Enter) {
1850 if (((FXEvent*)ptr)->code==KEY_Return || ((FXEvent*)ptr)->code==KEY_KP_Enter) {
1890 GWEN_WIDGET_TREE *wtree;
1899 w=GWEN_Widget_Tree_GetFirst(wtree);
1919 DBG_INFO(0,
"Error initializing dialog: %d", rv);
1938 FXComposite *parentComposite=
NULL;
1939 FXWindow *wChild=
NULL;
1940 FXWindow *wContent=
NULL;
1956 parentWidget=GWEN_Widget_Tree_GetParent(w);
1960 parentComposite=
dynamic_cast<FXComposite*
>(parentWindow);
1961 if (parentComposite==
NULL) {
1975 opts|=LAYOUT_FILL_X | LAYOUT_FILL_COLUMN;
1977 opts|=LAYOUT_FILL_Y;
1979 opts|=DECOR_SHRINKABLE;
1981 opts|=DECOR_STRETCHABLE;
1983 opts|=DECOR_MINIMIZE;
1985 opts|=DECOR_MAXIMIZE;
1991 opts|=PACK_UNIFORM_WIDTH;
1993 opts|=PACK_UNIFORM_HEIGHT;
1997 opts|=JUSTIFY_RIGHT;
2001 opts|=JUSTIFY_BOTTOM;
2003 opts|=JUSTIFY_CENTER_X;
2005 opts|=JUSTIFY_CENTER_Y;
2054 opts|=BUTTON_DEFAULT | BUTTON_INITIAL | BUTTON_NORMAL;
2056 opts|=BUTTON_NORMAL;
2072 opts|=TEXTFIELD_PASSWD;
2074 opts|=TEXTFIELD_READONLY;
2075 wChild=
new FXTextField(parentComposite,
2079 opts | TEXTFIELD_NORMAL | TEXTFIELD_ENTER_ONLY);
2086 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2087 opts|=TEXT_READONLY;
2088 f=
new FXText(parentComposite,
2091 opts | HSCROLLING_OFF);
2093 f->setVisibleColumns(cols);
2095 f->setVisibleRows(rows);
2105 opts | HSCROLLING_OFF);
2111 if (flags & GWEN_WIDGET_FLAGS_READONLY)
2112 opts|=COMBOBOX_STATIC;
2124 std::list<RadioButtonGroup*>::iterator it;
2130 if ((*it)->getGroupId()==groupId) {
2139 rb=
new FXRadioButton(parentComposite,
2143 opts | RADIOBUTTON_NORMAL);
2150 wChild=
new FXProgressBar(parentComposite,
2153 opts | PROGRESSBAR_NORMAL | PROGRESSBAR_PERCENTAGE);
2157 wChild=
new FXGroupBox(parentComposite,
2159 opts | GROUPBOX_NORMAL | FRAME_LINE);
2163 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_X);
2167 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_Y);
2171 wChild=
new FXHorizontalFrame(parentComposite, opts,
2172 0, 0, 0, 0, 0, 0, 0, 0);
2176 wChild=
new FXVerticalFrame(parentComposite, opts,
2177 0, 0, 0, 0, 0, 0, 0, 0);
2183 name?name:
"(unnamed)");
2187 wChild=
new FXMatrix(parentComposite, cols,
2188 opts | MATRIX_BY_COLUMNS,
2189 0, 0, 0, 0, 0, 0, 0, 0);
2191 wChild=
new FXMatrix(parentComposite, rows,
2192 opts | MATRIX_BY_ROWS,
2193 0, 0, 0, 0, 0, 0, 0, 0);
2200 opts | FRAME_SUNKEN|FRAME_THICK | LISTBOX_NORMAL);
2205 wChild=
new FXDialogBox(parentWindow,
2206 name?FXString(name):FXString(
""),
2207 opts | DECOR_TITLE | DECOR_BORDER);
2209 wChild=
new FXDialogBox(FXApp::instance(),
2210 name?FXString(name):FXString(
""),
2211 opts | DECOR_TITLE | DECOR_BORDER);
2215 wChild=
new FXTabBook(parentComposite,
2218 opts | TABBOOK_NORMAL);
2222 if (parentWidget==
NULL) {
2227 FXTabBook *tbook=
dynamic_cast<FXTabBook*
>(parentWindow);
2234 wChild=
new FXVerticalFrame(tbook, opts);
2239 wChild=
new FXCheckButton(parentComposite,
2243 opts | CHECKBUTTON_NORMAL);
2250 f=
new FXScrollWindow(parentComposite, opts);
2252 wContent=f->contentWindow();
2257 wChild=
new FXSwitcher(parentComposite, opts);
2261 wChild=
new FXHorizontalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2265 wChild=
new FXVerticalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2269 wChild=
new FXSpinner(parentComposite,
2273 opts | SPIN_NORMAL);
2294 w=GWEN_Widget_Tree_GetFirstChild(w);
2298 w=GWEN_Widget_Tree_GetNext(w);
2307 FXDialogBox *dialogBox;
2310 return dialogBox->getApp()->runModalFor(dialogBox);
2316 FXDialogBox *dialogBox;
2321 dialogBox->layout();
2322 dialogBox->show(PLACEMENT_OWNER);
2330 FXDialogBox *dialogBox;