1 
2 /* These widgets have initially been created by Martin Oberzalek who gave them into
3  * the public domain via an email to the mailing list foxgui-users on 17th of June, 2010
4  * ("here the source. Free to use for alll.").
5  * I (Martin Preuss) adapted them to be usable with FOX 1.6 and also added some widgets of
6  * my own (for now: ThemeHeaderItem).
7  */
8 
9 #ifndef THEME_H
10 #define THEME_H
11 
12 #include <fx.h>
13 
14 /** This header is only needed for the definition of "FOX16GUI_API" which is
15  * used in the declaration of all exported classes and methods.
16  * If you want to use these themed widgets in your own projects you should remove
17  * this include here and all occurrences of "FOX16GUI_API".
18  */
19 #include <gwen-gui-fox16/fox16_gui.hpp>
20 
21 
22 
23 #define THEMEBUTTON          ThemeButton
24 #define THEMETEXTFIELD       ThemeTextField
25 #define THEMECOMBOBOX        ThemeComboBox
26 #define THEMELABEL           ThemeLabel
27 #define THEMEVERTICALFRAME   ThemeVerticalFrame
28 #define THEMEHORIZONTALFRAME ThemeHorizontalFrame
29 #define THEMEMENUBUTTON      ThemeMenuButton
30 #define THEMEHEADERITEM      ThemeHeaderItem
31 #define THEMETABITEM         ThemeTabItem
32 
33 
34 
35 class FOX16GUI_API ThemeButton : public FXButton {
36   FXDECLARE(ThemeButton);
37 
38 protected:
ThemeButton()39   ThemeButton() {}
40 
41 public:
42   ThemeButton(FXComposite *p, const FXString &text, FXIcon *ic=NULL,
43               FXObject *tgt=NULL, FXSelector sel=0, FXuint opts=BUTTON_NORMAL,
44               FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint pl=DEFAULT_PAD,
45               FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
46 
47   long onPaint(FXObject *, FXSelector, void *ptr);
48 };
49 
50 
51 
52 class FOX16GUI_API ThemeTextField : public FXTextField {
53   FXDECLARE(ThemeTextField);
54 
55 protected:
ThemeTextField()56   ThemeTextField() {}
57 
58 public:
59   ThemeTextField(FXComposite *p, FXint ncols, FXObject *tgt=NULL, FXSelector sel=0,
60                  FXuint opts=TEXTFIELD_NORMAL, FXint x=0, FXint y=0, FXint w=0,
61                  FXint h=0, FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
62 
63   long onPaint(FXObject *, FXSelector, void *ptr);
64 
65 protected:
66   void drawFrame(FXDCWindow &dc, FXint x, FXint y, FXint w, FXint h);
67 };
68 
69 
70 
71 
72 FOX16GUI_API void init_theme(FXApp *app);
73 
74 
75 
76 
77 class FOX16GUI_API ThemeComboBox : public FXComboBox {
78   FXDECLARE(ThemeComboBox);
79 
80 protected:
ThemeComboBox()81   ThemeComboBox() {}
82 
83 public:
84   ThemeComboBox(FXComposite *p, FXint cols, FXObject *tgt=NULL, FXSelector sel=0,
85                 FXuint opts=COMBOBOX_NORMAL, FXint x=0, FXint y=0, FXint w=0, FXint h=0,
86                 FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
87 
88   long onPaint(FXObject *, FXSelector, void *ptr);
89 };
90 
91 
92 
93 
94 class FOX16GUI_API ThemeLabel : public FXLabel {
95   FXDECLARE(ThemeLabel);
96 
97 protected:
ThemeLabel()98   ThemeLabel() {}
99 
100 public:
101   ThemeLabel(FXComposite *p, const FXString &text, FXIcon *ic=0, FXuint opts=LABEL_NORMAL,
102              FXint x=0, FXint y=0, FXint w=0, FXint h=0,
103              FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD, FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
104 
105   long onPaint(FXObject *, FXSelector, void *ptr);
106 };
107 
108 
109 
110 
111 class FOX16GUI_API ThemeTabItem : public FXTabItem {
112   FXDECLARE(ThemeTabItem);
113 
114 protected:
ThemeTabItem()115   ThemeTabItem() {}
116 
117 public:
118   ThemeTabItem(FXTabBar *p, const FXString &text, FXIcon *ic=0,
119                FXuint opts=TAB_TOP_NORMAL,
120                FXint x=0, FXint y=0, FXint w=0, FXint h=0,
121                FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD,
122                FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
123 };
124 
125 
126 
127 
128 class FOX16GUI_API ThemeVerticalFrame : public FXVerticalFrame {
129 protected:
ThemeVerticalFrame()130   ThemeVerticalFrame() {}
131 
132 public:
133   ThemeVerticalFrame(FXComposite *p, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0,
134                      FXint pl=DEFAULT_SPACING, FXint pr=DEFAULT_SPACING, FXint pt=DEFAULT_SPACING,
135                      FXint pb=DEFAULT_SPACING, FXint hs=DEFAULT_SPACING, FXint vs=DEFAULT_SPACING);
136 };
137 
138 
139 
140 
141 class FOX16GUI_API ThemeHorizontalFrame : public FXHorizontalFrame {
142 protected:
ThemeHorizontalFrame()143   ThemeHorizontalFrame() {}
144 
145 public:
146   ThemeHorizontalFrame(FXComposite *p, FXuint opts=0, FXint x=0, FXint y=0, FXint w=0, FXint h=0, FXint
147                        pl=DEFAULT_SPACING, FXint pr=DEFAULT_SPACING, FXint pt=DEFAULT_SPACING,
148                        FXint pb=DEFAULT_SPACING, FXint hs=DEFAULT_SPACING, FXint vs=DEFAULT_SPACING);
149 };
150 
151 
152 
153 
154 class FOX16GUI_API ThemeMenuButton : public FXMenuButton {
155   FXDECLARE(ThemeMenuButton);
156 
157 protected:
ThemeMenuButton()158   ThemeMenuButton() {}
159 
160 public:
161   ThemeMenuButton(FXComposite *p, const FXString &text, FXIcon *ic=NULL,
162                   FXPopup *pup=NULL,
163                   FXuint opts=JUSTIFY_NORMAL|ICON_BEFORE_TEXT|MENUBUTTON_DOWN,
164                   FXint x=0, FXint y=0, FXint w=0, FXint h=0,
165                   FXint pl=DEFAULT_PAD, FXint pr=DEFAULT_PAD,
166                   FXint pt=DEFAULT_PAD, FXint pb=DEFAULT_PAD);
167 
168 
169   long onPaint(FXObject *, FXSelector, void *ptr);
170 
171   FXint getDefaultWidth();
172 };
173 
174 
175 
176 class FOX16GUI_API ThemeHeaderItem : public FXHeaderItem {
177 protected:
ThemeHeaderItem()178   ThemeHeaderItem() {}
179 
180 public:
181   ThemeHeaderItem(const FXString &text, FXIcon *ic=NULL, FXint s=0, void *ptr=NULL);
182 
183   void draw(const FXHeader *header, FXDC &dc, FXint x, FXint y, FXint w, FXint h);
184 
185 };
186 
187 
188 
189 #endif
190 
191