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;
159 dialogBox->show(PLACEMENT_OWNER);
161 dialogBox->resize(dialogBox->getWidth(), dialogBox->getHeight());
162 rv=dialogBox->execute();
197 if (value<f->getNumItems()) {
198 f->setCurrentItem(value, doSignal?TRUE:FALSE);
224 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
241 f->setProgress(value);
310 f->setCurrentItem(fi, doSignal?TRUE:FALSE);
312 f->makeItemVisible(fi);
321 f->setHeaderSize(index, value);
329 f->setListStyle(FOLDINGLIST_BROWSESELECT);
332 f->setListStyle(FOLDINGLIST_EXTENDEDSELECT);
347 ti->setSelected((value==0)?FALSE:TRUE);
358 for (i=0; i<f->getNumHeaders(); i++) {
392 for (i=0; i<f->getNumHeaders(); i++) {
422 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
439 f->setCurrent(value, doSignal?TRUE:FALSE);
456 f->setCurrent(value, doSignal?TRUE:FALSE);
475 f->setSplit(0, value);
513 f->resize(value, f->getHeight());
518 f->resize(f->getWidth(), value);
563 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
587 return f->getCurrentItem();
590 return f->getNumItems();
606 return (f->getCheck()==TRUE)?1:0;
622 return f->getProgress();
628 return f->getTotal();
645 return f->getValue();
678 fi=f->getCurrentItem();
685 while( (ti=ti->getPrev()) )
692 return f->getNumItems();
695 return f->getHeaderSize(index);
698 switch(f->getListStyle()) {
699 case FOLDINGLIST_BROWSESELECT:
701 case FOLDINGLIST_EXTENDEDSELECT:
713 ti=f->getFirstItem();
720 return (ti->isSelected()==TRUE)?1:0;
727 for (i=0; i<f->getNumHeaders(); i++) {
759 return (f->getCheck()==TRUE)?1:0;
776 return f->getCurrent();
793 return f->getCurrent();
811 return f->getSplit(0);
849 return f->getWidth();
852 return f->getHeight();
855 return (f->isEnabled()==TRUE)?1:0;
858 return (f->hasFocus())?1:0;
884 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
900 if (value && *value) {
967 f->setTipText(htmlValue);
984 f->setText(value, doSignal?TRUE:FALSE);
988 f->setTipText(htmlValue);
1005 f->setText(strValue);
1009 f->setTipText(htmlValue);
1030 f->setTipText(htmlValue);
1036 f->appendItem(strValue);
1040 f->setNumVisible(i);
1062 f->setText(strValue);
1078 f->setText(strValue);
1082 f->setTipText(htmlValue);
1099 f->setText(strValue);
1103 f->setTipText(htmlValue);
1123 f2->setText(strValue);
1127 f2->setTipText(htmlValue);
1144 f->setTitle(strValue);
1163 f->getHeader()->clearItems();
1165 while(!(t=str.section(
'\t',n)).empty()) {
1166 f->appendHeader(t,
NULL, 20);
1172 f->appendItem(
NULL, strValue);
1193 f->setTipText(htmlValue);
1246 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1256 const char *defaultValue) {
1261 return defaultValue;
1263 return defaultValue;
1275 return defaultValue;
1297 return defaultValue;
1319 return defaultValue;
1341 return defaultValue;
1363 return defaultValue;
1383 if (index<f->getNumItems()) {
1384 str=f->getItem(index);
1386 return defaultValue;
1394 return defaultValue;
1413 return defaultValue;
1435 return defaultValue;
1457 return defaultValue;
1482 return defaultValue;
1505 return defaultValue;
1531 for (i=0; i<fh->getNumItems(); i++) {
1534 str+=fh->getItemText(i);
1539 return defaultValue;
1546 fi=f->getFirstItem();
1557 return defaultValue;
1563 return defaultValue;
1568 return defaultValue;
1624 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1626 return defaultValue;
1637 FXDialogBox *dialogBox;
1642 std::list<RadioButtonGroup*>::iterator it;
1646 if ((*it)->getDataTarget()==sender) {
1668 wname?wname:
"(unnamed)",
1718 dialogBox->getApp()->stopModal(dialogBox, 1);
1721 dialogBox->getApp()->stopModal(dialogBox, 0);
1732 FXDialogBox *dialogBox;
1783 dialogBox->getApp()->stopModal(dialogBox, 1);
1787 dialogBox->getApp()->stopModal(dialogBox, 0);
1797 FXEvent*
event=(FXEvent*)ptr;
1813 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1855 FXEvent*
event=(FXEvent*)ptr;
1867 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1911 GWEN_WIDGET_TREE *wtree;
1920 w=GWEN_Widget_Tree_GetFirst(wtree);
1941 DBG_INFO(0,
"Error initializing dialog: %d", rv);
1946 xw->resize(xw->getDefaultWidth(), xw->getDefaultHeight());
1963 FXComposite *parentComposite=
NULL;
1964 FXWindow *wChild=
NULL;
1965 FXWindow *wContent=
NULL;
1981 parentWidget=GWEN_Widget_Tree_GetParent(w);
1985 parentComposite=
dynamic_cast<FXComposite*
>(parentWindow);
1986 if (parentComposite==
NULL) {
2000 opts|=LAYOUT_FILL_X | LAYOUT_FILL_COLUMN;
2002 opts|=LAYOUT_FILL_Y;
2004 opts|=DECOR_SHRINKABLE;
2006 opts|=DECOR_STRETCHABLE;
2008 opts|=DECOR_MINIMIZE;
2010 opts|=DECOR_MAXIMIZE;
2016 opts|=PACK_UNIFORM_WIDTH;
2018 opts|=PACK_UNIFORM_HEIGHT;
2022 opts|=JUSTIFY_RIGHT;
2026 opts|=JUSTIFY_BOTTOM;
2028 opts|=JUSTIFY_CENTER_X;
2030 opts|=JUSTIFY_CENTER_Y;
2087 opts|=BUTTON_DEFAULT | BUTTON_INITIAL | BUTTON_NORMAL;
2089 opts|=BUTTON_NORMAL;
2105 opts|=TEXTFIELD_PASSWD;
2107 opts|=TEXTFIELD_READONLY;
2108 wChild=
new FXTextField(parentComposite,
2112 opts | TEXTFIELD_NORMAL | TEXTFIELD_ENTER_ONLY);
2119 opts|=TEXT_READONLY;
2120 f=
new FXText(parentComposite,
2123 opts | HSCROLLING_OFF);
2125 f->setVisibleColumns(cols);
2127 f->setVisibleRows(rows);
2136 opts | HSCROLLING_OFF);
2143 opts|=COMBOBOX_STATIC;
2155 std::list<RadioButtonGroup*>::iterator it;
2161 if ((*it)->getGroupId()==groupId) {
2170 rb=
new FXRadioButton(parentComposite,
2174 opts | RADIOBUTTON_NORMAL);
2181 wChild=
new FXProgressBar(parentComposite,
2184 opts | PROGRESSBAR_NORMAL | PROGRESSBAR_PERCENTAGE);
2188 wChild=
new FXGroupBox(parentComposite,
2190 opts | GROUPBOX_NORMAL | FRAME_LINE);
2194 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_X);
2198 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_Y);
2202 wChild=
new FXHorizontalFrame(parentComposite, opts,
2203 0, 0, 0, 0, 0, 0, 0, 0);
2207 wChild=
new FXVerticalFrame(parentComposite, opts,
2208 0, 0, 0, 0, 0, 0, 0, 0);
2214 name?name:
"(unnamed)");
2218 wChild=
new FXMatrix(parentComposite, cols,
2219 opts | MATRIX_BY_COLUMNS,
2220 0, 0, 0, 0, 0, 0, 0, 0);
2222 wChild=
new FXMatrix(parentComposite, rows,
2223 opts | MATRIX_BY_ROWS,
2224 0, 0, 0, 0, 0, 0, 0, 0);
2231 opts | FRAME_SUNKEN|FRAME_THICK | LISTBOX_NORMAL);
2236 wChild=
new FXDialogBox(parentWindow,
2237 name?FXString(name):FXString(
""),
2238 opts | DECOR_TITLE | DECOR_BORDER);
2240 wChild=
new FXDialogBox(FXApp::instance(),
2241 name?FXString(name):FXString(
""),
2242 opts | DECOR_TITLE | DECOR_BORDER);
2246 wChild=
new FXTabBook(parentComposite,
2249 opts | TABBOOK_NORMAL);
2253 if (parentWidget==
NULL) {
2258 FXTabBook *tbook=
dynamic_cast<FXTabBook*
>(parentWindow);
2265 wChild=
new FXVerticalFrame(tbook, opts);
2270 wChild=
new FXCheckButton(parentComposite,
2274 opts | CHECKBUTTON_NORMAL);
2280 f=
new FXScrollWindow(parentComposite, opts);
2282 wContent=f->contentWindow();
2287 wChild=
new FXSwitcher(parentComposite, opts);
2291 wChild=
new FXHorizontalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2295 wChild=
new FXVerticalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2299 wChild=
new FXSpinner(parentComposite,
2303 opts | SPIN_NORMAL);
2307 wChild=
new FXSplitter(parentComposite, opts | SPLITTER_HORIZONTAL, 0, 0, 0, 0);
2311 wChild=
new FXSplitter(parentComposite, opts | SPLITTER_VERTICAL, 0, 0, 0, 0);
2332 w=GWEN_Widget_Tree_GetFirstChild(w);
2336 w=GWEN_Widget_Tree_GetNext(w);
2345 FXDialogBox *dialogBox;
2348 return dialogBox->getApp()->runModalFor(dialogBox);
2354 FXDialogBox *dialogBox;
2359 dialogBox->layout();
2360 dialogBox->show(PLACEMENT_OWNER);
2361 dialogBox->recalc();
2362 dialogBox->resize(dialogBox->getWidth(), dialogBox->getHeight());
2370 FXDialogBox *dialogBox;
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
CppDialog(GWEN_DIALOG *dlg)
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)
virtual ~FOX16_GuiDialog()
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 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,...)
#define DBG_ERROR(dbg_logger, format,...)
#define DBG_WARN(dbg_logger, format,...)
#define DBG_DEBUG(dbg_logger, format,...)
int GWEN_Dialog_EmitSignalToAll2(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender, int intArg, const char *stringArg)
GWEN_WIDGET_TREE * GWEN_Dialog_GetWidgets(const GWEN_DIALOG *dlg)
GWEN_WIDGET * GWEN_Dialog_FindWidgetByImplData(const GWEN_DIALOG *dlg, int index, const void *ptr)
GWEN_STRINGLIST * GWEN_Dialog_GetMediaPaths(const GWEN_DIALOG *dlg)
int GWEN_Dialog_EmitSignalToAll(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
int GWEN_Dialog_EmitSignal(GWEN_DIALOG *dlg, GWEN_DIALOG_EVENTTYPE t, const char *sender)
#define GWEN_WIDGET_FLAGS_DECOR_MAXIMIZE
#define GWEN_WIDGET_FLAGS_JUSTIFY_RIGHT
#define GWEN_WIDGET_FLAGS_FRAME_RAISED
#define GWEN_WIDGET_FLAGS_FILLY
#define GWEN_WIDGET_FLAGS_PASSWORD
#define GWEN_WIDGET_FLAGS_DECOR_CLOSE
#define GWEN_WIDGET_FLAGS_DECOR_SHRINKABLE
@ GWEN_DialogSortDirection_None
@ GWEN_DialogSortDirection_Up
@ GWEN_DialogSortDirection_Down
#define GWEN_WIDGET_FLAGS_DECOR_STRETCHABLE
#define GWEN_WIDGET_FLAGS_EQUAL_HEIGHT
#define GWEN_WIDGET_FLAGS_FILLX
struct GWEN_DIALOG GWEN_DIALOG
#define GWEN_WIDGET_FLAGS_JUSTIFY_TOP
#define GWEN_WIDGET_FLAGS_READONLY
@ GWEN_DialogProperty_WindowId
@ GWEN_DialogProperty_SelectionState
@ GWEN_DialogProperty_AddValue
@ GWEN_DialogProperty_MinValue
@ GWEN_DialogProperty_ToolTip
@ GWEN_DialogProperty_Visibility
@ GWEN_DialogProperty_ColumnWidth
@ GWEN_DialogProperty_MaxValue
@ GWEN_DialogProperty_None
@ GWEN_DialogProperty_ValueCount
@ GWEN_DialogProperty_Title
@ GWEN_DialogProperty_Sort
@ GWEN_DialogProperty_ClearValues
@ GWEN_DialogProperty_SelectionMode
@ GWEN_DialogProperty_Height
@ GWEN_DialogProperty_SortDirection
@ GWEN_DialogProperty_Enabled
@ GWEN_DialogProperty_Value
@ GWEN_DialogProperty_Unknown
@ GWEN_DialogProperty_Focus
@ GWEN_DialogProperty_Width
@ GWEN_DialogEvent_TypeKeyPressed
@ GWEN_DialogEvent_TypeValueChanged
@ GWEN_DialogEvent_TypeInit
@ GWEN_DialogEvent_TypeFini
@ GWEN_DialogEvent_TypeKeyReleased
@ GWEN_DialogEvent_TypeActivated
#define GWEN_WIDGET_FLAGS_JUSTIFY_LEFT
@ GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultNotHandled
@ GWEN_DialogEvent_ResultReject
#define GWEN_WIDGET_FLAGS_DECOR_MINIMIZE
#define GWEN_WIDGET_FLAGS_JUSTIFY_BOTTOM
#define GWEN_WIDGET_FLAGS_EQUAL_WIDTH
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERX
#define GWEN_WIDGET_FLAGS_FRAME_SUNKEN
#define GWEN_WIDGET_FLAGS_JUSTIFY_CENTERY
#define GWEN_WIDGET_FLAGS_DEFAULT_WIDGET
@ GWEN_Dialog_SelectionMode_None
@ GWEN_Dialog_SelectionMode_Multi
@ GWEN_Dialog_SelectionMode_Single
#define GWEN_WIDGET_FLAGS_NO_WORDWRAP
#define GWEN_WIDGET_FLAGS_FRAME_GROOVE
#define GWEN_WIDGET_FLAGS_FRAME_THICK
#define GWEN_WIDGET_FLAGS_DECOR_MENU
GWENHYWFAR_API int GWEN_Directory_FindFileInPaths(const GWEN_STRINGLIST *paths, const char *filePath, GWEN_BUFFER *fbuf)
#define GWEN_ERROR_INVALID
#define GWEN_ERROR_GENERIC
#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.
const char * GWEN_StringListEntry_Data(const GWEN_STRINGLISTENTRY *se)
GWEN_STRINGLISTENTRY * GWEN_StringListEntry_Next(const GWEN_STRINGLISTENTRY *se)
GWEN_STRINGLISTENTRY * GWEN_StringList_FirstEntry(const GWEN_STRINGLIST *sl)
struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST