gwenhywfar 5.14.1
fox16_gui_dialog_l.hpp
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#ifndef FOX16_GUI_DIALOG_L_HPP
11#define FOX16_GUI_DIALOG_L_HPP
12
13#include "fox16_gui.hpp"
14#include <gwen-gui-cpp/cppdialog.hpp>
15
16#include <fx.h>
17
18#include <gwenhywfar/dialog_be.h>
19#include <gwenhywfar/widget_be.h>
20
21#include <list>
22#include <string>
23
24
25
26class FOX16_GuiDialog: public FXObject, public CppDialog {
27 FXDECLARE(FOX16_GuiDialog)
28
29protected:
31 protected:
32 FXDataTarget m_radioTarget;
36 std::list<FXRadioButton*> m_buttonList;
37
38 public:
39 RadioButtonGroup(int groupId, FXObject* tgt=NULL, FXSelector sel=0)
40 :m_radioTarget(m_radioValue, tgt, sel), m_groupId(groupId), m_radioValue(0), m_buttonCount(0) {};
42 std::list<FXRadioButton*>::iterator it;
43
44 for (it=m_buttonList.begin(); it!=m_buttonList.end(); it++)
45 /* reset target pointer in buttons because we are about to destroy the FXDataTarget */
46 (*it)->setTarget(NULL);
47 };
48
49 int getGroupId() { return m_groupId;};
50
51 FXDataTarget *getDataTarget() { return &m_radioTarget;};
52
53 int getButtonCount() { return m_buttonList.size();};
54
55 FXint getRadioValue() const { return m_radioValue;};
56
57 void addButton(FXRadioButton *rb) {
58 m_buttonList.push_back(rb);
59 };
60 };
61
62
63public:
64 enum {
68 };
69
71 virtual ~FOX16_GuiDialog();
72
74
75 long onSelCommand(FXObject *sender, FXSelector sel, void *ptr);
76 long onSelChanged(FXObject *sender, FXSelector sel, void *ptr);
77 long onSelKeyPress(FXObject *sender, FXSelector sel, void *ptr);
78 long onSelKeyRelease(FXObject *sender, FXSelector sel, void *ptr);
79
80 FXIcon *getIcon(const char *fileName);
81
82 bool setup(FXWindow *parentWindow);
83
84 int execute();
85 int cont();
86
87 int openDialog();
88 int closeDialog();
89
90
91 FXDialogBox *getMainWindow() { return _mainWidget;};
92
93protected:
96 FXDialogBox *_mainWidget;
97 FXIconSource *m_iconSource;
98 std::list<FXIcon*> m_iconList;
99 std::list<RadioButtonGroup*> m_radioGroups;
101
103
104 FXWindow *setupTree(FXWindow *parentWindow, GWEN_WIDGET *w);
105
106 void guiUpdate();
107
108 virtual int setIntProperty(GWEN_WIDGET *w,
110 int index,
111 int value,
112 int doSignal);
113
114 virtual int getIntProperty(GWEN_WIDGET *w,
116 int index,
117 int defaultValue);
118
119 virtual int setCharProperty(GWEN_WIDGET *w,
121 int index,
122 const char *value,
123 int doSignal);
124
125 virtual const char *getCharProperty(GWEN_WIDGET *w,
127 int index,
128 const char *defaultValue);
129
130};
131
132
133
134
135#endif /* FOX16_DIALOG_L_HPP */
136
137
#define NULL
Definition binreloc.c:300
CppDialog(GWEN_DIALOG *dlg)
std::list< FXRadioButton * > m_buttonList
RadioButtonGroup(int groupId, FXObject *tgt=NULL, FXSelector sel=0)
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
FXDialogBox * getMainWindow()
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)
struct GWEN_DIALOG GWEN_DIALOG
Definition dialog.h:54
GWEN_DIALOG_PROPERTY
Definition dialog.h:260
struct GWEN_WIDGET GWEN_WIDGET
Definition widget_be.h:34