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
61 ,m_sizeChanged(FALSE) {
73 ,m_sizeChanged(FALSE) {
82 std::list<FXIcon*>::iterator it;
92 std::list<RadioButtonGroup*>::iterator it;
152 FXDialogBox *dialogBox;
158 dialogBox->show(PLACEMENT_OWNER);
159 rv=dialogBox->execute();
194 if (value<f->getNumItems()) {
195 f->setCurrentItem(value, doSignal?TRUE:FALSE);
221 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
238 f->setProgress(value);
307 f->setCurrentItem(fi, doSignal?TRUE:FALSE);
309 f->makeItemVisible(fi);
318 f->setHeaderSize(index, value);
326 f->setListStyle(FOLDINGLIST_BROWSESELECT);
329 f->setListStyle(FOLDINGLIST_EXTENDEDSELECT);
344 ti->setSelected((value==0)?FALSE:TRUE);
355 for (i=0; i<f->getNumHeaders(); i++) {
389 for (i=0; i<f->getNumHeaders(); i++) {
419 f->setCheck((value==0)?FALSE:TRUE, doSignal?TRUE:FALSE);
436 f->setCurrent(value, doSignal?TRUE:FALSE);
453 f->setCurrent(value, doSignal?TRUE:FALSE);
490 f->resize(value, f->getHeight());
495 f->resize(f->getWidth(), value);
540 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
564 return f->getCurrentItem();
567 return f->getNumItems();
583 return (f->getCheck()==TRUE)?1:0;
599 return f->getProgress();
605 return f->getTotal();
622 return f->getValue();
655 fi=f->getCurrentItem();
662 while( (ti=ti->getPrev()) )
669 return f->getNumItems();
672 return f->getHeaderSize(index);
675 switch(f->getListStyle()) {
676 case FOLDINGLIST_BROWSESELECT:
678 case FOLDINGLIST_EXTENDEDSELECT:
690 ti=f->getFirstItem();
697 return (ti->isSelected()==TRUE)?1:0;
704 for (i=0; i<f->getNumHeaders(); i++) {
736 return (f->getCheck()==TRUE)?1:0;
753 return f->getCurrent();
770 return f->getCurrent();
807 return f->getWidth();
810 return f->getHeight();
813 return (f->isEnabled()==TRUE)?1:0;
816 return (f->hasFocus())?1:0;
842 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
858 if (value && *value) {
925 f->setTipText(htmlValue);
942 f->setText(value, doSignal?TRUE:FALSE);
946 f->setTipText(htmlValue);
963 f->setText(strValue);
967 f->setTipText(htmlValue);
988 f->setTipText(htmlValue);
994 f->appendItem(strValue);
1020 f->setText(strValue);
1036 f->setText(strValue);
1040 f->setTipText(htmlValue);
1057 f->setText(strValue);
1061 f->setTipText(htmlValue);
1081 f2->setText(strValue);
1085 f2->setTipText(htmlValue);
1102 f->setTitle(strValue);
1121 f->getHeader()->clearItems();
1123 while(!(t=str.section(
'\t',n)).empty()) {
1124 f->appendHeader(t,
NULL, 20);
1130 f->appendItem(
NULL, strValue);
1151 f->setTipText(htmlValue);
1202 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1212 const char *defaultValue) {
1217 return defaultValue;
1219 return defaultValue;
1231 return defaultValue;
1253 return defaultValue;
1275 return defaultValue;
1297 return defaultValue;
1319 return defaultValue;
1339 if (index<f->getNumItems()) {
1340 str=f->getItem(index);
1342 return defaultValue;
1350 return defaultValue;
1369 return defaultValue;
1391 return defaultValue;
1413 return defaultValue;
1438 return defaultValue;
1461 return defaultValue;
1487 for (i=0; i<fh->getNumItems(); i++) {
1490 str+=fh->getItemText(i);
1495 return defaultValue;
1502 fi=f->getFirstItem();
1513 return defaultValue;
1519 return defaultValue;
1524 return defaultValue;
1578 DBG_WARN(0,
"Function is not appropriate for this type of widget (%s)",
1580 return defaultValue;
1591 FXDialogBox *dialogBox;
1596 std::list<RadioButtonGroup*>::iterator it;
1600 if ((*it)->getDataTarget()==sender) {
1622 wname?wname:
"(unnamed)",
1670 dialogBox->getApp()->stopModal(dialogBox, 1);
1673 dialogBox->getApp()->stopModal(dialogBox, 0);
1684 FXDialogBox *dialogBox;
1733 dialogBox->getApp()->stopModal(dialogBox, 1);
1737 dialogBox->getApp()->stopModal(dialogBox, 0);
1747 FXEvent*
event=(FXEvent*)ptr;
1763 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1803 FXEvent*
event=(FXEvent*)ptr;
1815 if (event->code==KEY_Return || event->code==KEY_KP_Enter) {
1857 GWEN_WIDGET_TREE *wtree;
1866 w=GWEN_Widget_Tree_GetFirst(wtree);
1887 DBG_INFO(0,
"Error initializing dialog: %d", rv);
1892 xw->resize(xw->getDefaultWidth(), xw->getDefaultHeight());
1909 FXComposite *parentComposite=
NULL;
1910 FXWindow *wChild=
NULL;
1911 FXWindow *wContent=
NULL;
1927 parentWidget=GWEN_Widget_Tree_GetParent(w);
1931 parentComposite=
dynamic_cast<FXComposite*
>(parentWindow);
1932 if (parentComposite==
NULL) {
1946 opts|=LAYOUT_FILL_X | LAYOUT_FILL_COLUMN;
1948 opts|=LAYOUT_FILL_Y;
1950 opts|=DECOR_SHRINKABLE;
1952 opts|=DECOR_STRETCHABLE;
1954 opts|=DECOR_MINIMIZE;
1956 opts|=DECOR_MAXIMIZE;
1962 opts|=PACK_UNIFORM_WIDTH;
1964 opts|=PACK_UNIFORM_HEIGHT;
1968 opts|=JUSTIFY_RIGHT;
1972 opts|=JUSTIFY_BOTTOM;
1974 opts|=JUSTIFY_CENTER_X;
1976 opts|=JUSTIFY_CENTER_Y;
2033 opts|=BUTTON_DEFAULT | BUTTON_INITIAL | BUTTON_NORMAL;
2035 opts|=BUTTON_NORMAL;
2051 opts|=TEXTFIELD_PASSWD;
2053 opts|=TEXTFIELD_READONLY;
2054 wChild=
new FXTextField(parentComposite,
2058 opts | TEXTFIELD_NORMAL | TEXTFIELD_ENTER_ONLY);
2065 opts|=TEXT_READONLY;
2066 f=
new FXText(parentComposite,
2069 opts | HSCROLLING_OFF);
2071 f->setVisibleColumns(cols);
2073 f->setVisibleRows(rows);
2082 opts | HSCROLLING_OFF);
2089 opts|=COMBOBOX_STATIC;
2101 std::list<RadioButtonGroup*>::iterator it;
2107 if ((*it)->getGroupId()==groupId) {
2116 rb=
new FXRadioButton(parentComposite,
2120 opts | RADIOBUTTON_NORMAL);
2127 wChild=
new FXProgressBar(parentComposite,
2130 opts | PROGRESSBAR_NORMAL | PROGRESSBAR_PERCENTAGE);
2134 wChild=
new FXGroupBox(parentComposite,
2136 opts | GROUPBOX_NORMAL | FRAME_LINE);
2140 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_X);
2144 wChild=
new FXSpring(parentComposite, opts | LAYOUT_FILL_Y);
2148 wChild=
new FXHorizontalFrame(parentComposite, opts,
2149 0, 0, 0, 0, 0, 0, 0, 0);
2153 wChild=
new FXVerticalFrame(parentComposite, opts,
2154 0, 0, 0, 0, 0, 0, 0, 0);
2160 name?name:
"(unnamed)");
2164 wChild=
new FXMatrix(parentComposite, cols,
2165 opts | MATRIX_BY_COLUMNS,
2166 0, 0, 0, 0, 0, 0, 0, 0);
2168 wChild=
new FXMatrix(parentComposite, rows,
2169 opts | MATRIX_BY_ROWS,
2170 0, 0, 0, 0, 0, 0, 0, 0);
2177 opts | FRAME_SUNKEN|FRAME_THICK | LISTBOX_NORMAL);
2182 wChild=
new FXDialogBox(parentWindow,
2183 name?FXString(name):FXString(
""),
2184 opts | DECOR_TITLE | DECOR_BORDER);
2186 wChild=
new FXDialogBox(FXApp::instance(),
2187 name?FXString(name):FXString(
""),
2188 opts | DECOR_TITLE | DECOR_BORDER);
2192 wChild=
new FXTabBook(parentComposite,
2195 opts | TABBOOK_NORMAL);
2199 if (parentWidget==
NULL) {
2204 FXTabBook *tbook=
dynamic_cast<FXTabBook*
>(parentWindow);
2211 wChild=
new FXVerticalFrame(tbook, opts);
2216 wChild=
new FXCheckButton(parentComposite,
2220 opts | CHECKBUTTON_NORMAL);
2226 f=
new FXScrollWindow(parentComposite, opts);
2228 wContent=f->contentWindow();
2233 wChild=
new FXSwitcher(parentComposite, opts);
2237 wChild=
new FXHorizontalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2241 wChild=
new FXVerticalSeparator(parentComposite, opts | SEPARATOR_GROOVE);
2245 wChild=
new FXSpinner(parentComposite,
2249 opts | SPIN_NORMAL);
2270 w=GWEN_Widget_Tree_GetFirstChild(w);
2274 w=GWEN_Widget_Tree_GetNext(w);
2283 FXDialogBox *dialogBox;
2286 return dialogBox->getApp()->runModalFor(dialogBox);
2292 FXDialogBox *dialogBox;
2297 dialogBox->layout();
2298 dialogBox->show(PLACEMENT_OWNER);
2306 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)
A C++ binding for the C module GWEN_DIALOG.
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)
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_DEBUG(dbg_logger, format, args...)
#define DBG_WARN(dbg_logger, format, args...)
#define DBG_INFO(dbg_logger, format, args...)
#define DBG_ERROR(dbg_logger, format, args...)
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
@ GWEN_DialogEvent_ResultAccept
@ GWEN_DialogEvent_ResultNotHandled
@ GWEN_DialogEvent_ResultReject
#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
#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