Overture
Version 25
Main Page
Namespaces
Classes
Files
File List
File Members
Overture.v25.d
include
DialogData.h
Go to the documentation of this file.
1
#ifndef DIALOG_DATA_H
2
#define DIALOG_DATA_H
3
4
#ifndef NO_APP
5
#include "
OvertureTypes.h
"
6
#endif
7
#include "
GUITypes.h
"
8
9
10
enum
button_type
{
GI_PUSHBUTTON
,
GI_TOGGLEBUTTON
};
11
12
enum
MessageTypeEnum
13
{
14
errorDialog
=0,
15
warningDialog
,
16
informationDialog
,
17
messageDialog
18
};
19
20
struct
PushButton
21
{
22
// buttonCommand holds the name of the command and
23
// buttonLabel holds the label that will appear on the button.
24
PushButton
(){
pb
=
NULL
;
sensitive
=
true
;}
// *wdh*
25
void
setSensitive
(
bool
trueOrFalse);
// *wdh*
26
27
aString
buttonCommand
;
28
aString
buttonLabel
;
29
bool
sensitive
;
// *wdh*
30
void
*
pb
;
// widget
31
};
32
33
struct
ToggleButton
34
{
35
ToggleButton
(){
tb
=
NULL
;
sensitive
=
true
;
state
=0;}
// *wdh*
36
int
setState
(
bool
trueOrFalse );
// *wdh*
37
void
setSensitive
(
bool
trueOrFalse);
// *wdh*
38
39
// buttonCommand holds the name of the command and
40
// buttonLabel holds the label that will appear on the button.
41
aString
buttonCommand
;
42
aString
buttonLabel
;
43
int
state
;
44
bool
sensitive
;
// *wdh*
45
void
*
tb
;
// widget
46
};
47
48
struct
TextLabel
49
{
50
// textCommand holds the name of the command and
51
// textLabel holds the label that will appear in front of the editable text.
52
// string holds the editable string.
53
// textWidget holds a pointer to the editable text widget, which makes it possible to change the text
54
// without typing in the dialog window. This might be useful for correcting typos, for example.
55
TextLabel
(){
textWidget
=
NULL
;
sensitive
=
true
;
labelWidget
=
NULL
;}
// *wdh*
56
void
setSensitive
(
bool
trueOrFalse);
// *wdh*
57
58
aString
textCommand
;
59
aString
textLabel
;
60
aString
string
;
61
bool
sensitive
;
// *wdh*
62
void
*
textWidget
;
// Widget
63
void
*
labelWidget
;
// Widget
64
};
65
66
struct
OptionMenu
67
{
68
OptionMenu
(){
menupane
=
NULL
;
sensitive
=
true
;
menuframe
=
NULL
;}
// *wdh*
69
int
setCurrentChoice
(
int
command);
// *wdh*
70
int
setCurrentChoice
(
const
aString
& label);
// *wdh*
71
void
setSensitive
(
bool
trueOrFalse);
// *wdh*
72
void
setSensitive
(
int
btn,
bool
trueOrFalse);
// set the sensitivity of one push button
73
74
aString
optionLabel
;
75
int
n_options
;
76
PushButton
*
optionList
;
77
aString
currentChoice
;
78
bool
sensitive
;
// *wdh*
79
void
*
menupane
;
// widget
80
void
*
menuframe
;
// widget
81
};
82
83
class
RadioBox
84
{
85
public
:
86
RadioBox
(){
sensitive
=
true
;
radioBox
=
NULL
;
columns
=1;}
87
bool
setCurrentChoice
(
int
command);
88
void
setSensitive
(
bool
trueOrFalse);
// set the sensitivity of the entire radio box widget
89
void
setSensitive
(
int
btn,
bool
trueOrFalse);
// set the sensitivity of one toggle button
90
91
aString
radioLabel
;
92
int
n_options
;
93
ToggleButton
*
optionList
;
94
aString
currentChoice
;
95
int
currentIndex
;
96
bool
sensitive
;
97
int
columns
;
98
void
*
radioBox
;
// widget
99
};
100
101
class
PullDownMenu
102
{
103
public
:
104
PullDownMenu
();
// default constructor
105
~PullDownMenu
();
106
// set all fields except the menupane in a PullDownMenu
107
bool
setPullDownMenu
(
const
aString
&pdMainLabel,
const
aString
commands[],
const
aString
labels[],
button_type
bt,
108
int
*initState
/* = NULL */
);
109
// set the state of a toggle button
110
int
setToggleState
(
int
n,
bool
trueOrFalse );
// *wdh*
111
void
setSensitive
(
bool
trueOrFalse);
// *wdh*
112
113
aString
menuTitle
;
114
int
n_button
;
115
button_type
type
;
116
PushButton
*
pbList
;
117
ToggleButton
*
tbList
;
118
bool
sensitive
;
// *wdh*
119
void
*
menupane
;
// widget
120
};
121
122
class
InfoLabel
123
{
124
public
:
125
InfoLabel
(){
labelWidget
=
NULL
;}
// default constructor
126
// textLabel holds the label that will appear in the window
127
// labelWidget holds a pointer to the label widget, which makes it possible to change the text
128
aString
textLabel
;
129
void
*
labelWidget
;
// Widget
130
};
131
132
// can't have more than 10 option menus, 6 pull-down menus, 15 radio boxes, 10 info labels
133
const
int
MAX_OP_MENU
=10,
MAX_PD_MENU
=6,
MAX_RADIO_BOXES
=15,
MAX_INFO_LABELS
=10;
134
135
class
DialogData
136
{
137
public
:
138
enum
WidgetTypeEnum
// *wdh*
139
{
140
optionMenuWidget
,
141
pushButtonWidget
,
142
pullDownWidget
,
143
toggleButtonWidget
,
144
textBoxWidget
,
145
radioBoxWidget
146
};
147
148
enum
cursorTypeEnum
149
{
150
pointerCursor
=0,
151
watchCursor
,
152
numberOfCursors
153
};
154
155
DialogData
();
// default constructor. Not normally called by the user
156
~DialogData
();
// destructor
157
158
void
159
openDialog
(
int
managed = 1);
160
161
int
162
dialogCommands
(
aString
**commands);
163
164
// parse an answer for a possible change to a toggle value
165
bool
166
getToggleValue
(
const
aString
& answer,
const
aString
& label,
bool
& target );
167
// This version is for an int target :
168
bool
169
getToggleValue
(
const
aString
& answer,
const
aString
& label,
int
& target );
170
171
// parse an answer for a possible change to a text box
172
bool
173
getTextValue
(
const
aString
& answer,
const
aString
& label,
const
aString
& format,
GUITypes::real
& target );
174
bool
175
getTextValue
(
const
aString
& answer,
const
aString
& label,
const
aString
& format,
int
& target );
176
bool
177
getTextValue
(
const
aString
& answer,
const
aString
& label,
const
aString
& format,
aString
& target );
178
179
int
180
showSibling
();
// display a sibling on the screen
181
182
int
183
hideSibling
();
// remove a sibling from the screen
184
185
void
186
setSensitive
(
int
trueFalse);
187
188
void
189
setSensitive
(
bool
trueOrFalse,
WidgetTypeEnum
widgetType,
int
number );
// *wdh*
190
void
191
setSensitive
(
bool
trueOrFalse,
WidgetTypeEnum
widgetType,
const
aString
& label);
// *wdh*
192
193
int
194
addOptionMenu
(
const
aString
&opMainLabel,
const
aString
opCommands[],
const
aString
opLabels[],
int
initCommand);
195
196
bool
197
addRadioBox
(
const
aString
&rbMainLabel,
const
aString
rbCommands[],
const
aString
rbLabels[],
int
initCommand,
198
int
columns = 1);
199
200
RadioBox
&
201
getRadioBox
(
int
n);
202
203
RadioBox
&
204
getRadioBox
(
const
aString
& radioLabel);
205
206
bool
207
changeOptionMenu
(
int
nOption,
const
aString
opCommands[],
const
aString
opLabels[],
int
initCommand);
208
209
bool
210
changeOptionMenu
(
const
aString
& opMainLabel,
const
aString
opCommands[],
const
aString
opLabels[],
int
initCommand);
211
212
int
213
deleteOptionMenus
();
214
215
int
216
addPulldownMenu
(
const
aString
&pdMainLabel,
const
aString
commands[],
const
aString
labels[],
button_type
bt,
217
int
*initState =
NULL
);
218
219
int
220
setToggleButtons
(
const
aString
tbCommands[],
const
aString
tbLabels[],
const
int
initState[],
221
int
numberOfColumns = 2);
222
223
int
224
deleteToggleButtons
();
225
226
int
227
setPushButtons
(
const
aString
pbCommands[],
const
aString
pbLabels[],
int
numberOfRows = 2);
228
229
int
230
setTextBoxes
(
const
aString
textCommands[],
const
aString
textLabels[],
const
aString
initString[]);
231
232
int
233
setTextLabel
(
int
n,
const
aString
&buff);
234
235
int
236
setTextLabel
(
const
aString
& textLabel,
const
aString
&buff);
// set the text box with label "textLabel"
237
238
int
239
setToggleState
(
int
n,
int
trueFalse);
240
241
int
242
setToggleState
(
const
aString
& toggleButtonLabel,
int
trueFalse);
// set toggle state with given label
243
244
int
245
setExitCommand
(
const
aString
&exitC,
const
aString
&exitL);
246
247
void
248
setWindowTitle
(
const
aString
&title);
249
250
void
251
setOptionMenuColumns
(
int
columns);
252
253
void
254
setLastPullDownIsHelp
(
int
trueFalse);
255
256
PullDownMenu
&
257
getPulldownMenu
(
int
n);
258
259
PullDownMenu
&
260
getPulldownMenu
(
const
aString
& label);
261
262
OptionMenu
&
263
getOptionMenu
(
int
n);
// *wdh*
264
265
OptionMenu
&
266
getOptionMenu
(
const
aString
& opMainLabel);
// find the option menu with this label
267
268
void
269
closeDialog
();
270
271
void
*
272
getWidget
();
273
274
aString
&
275
getExitCommand
();
276
277
void
278
setBuiltInDialog
();
279
280
int
281
getBuiltInDialog
();
282
283
void
284
setCursor
(
cursorTypeEnum
c);
285
286
int
287
addInfoLabel
(
const
aString
&textLabel);
288
289
int
290
deleteInfoLabels
();
291
292
bool
293
setInfoLabel
(
int
n,
const
aString
&buff);
294
295
protected
:
296
void
*
dialogWindow
;
// Widget
297
298
aString
windowTitle
;
299
aString
exitCommand
;
300
aString
exitLabel
;
301
bool
exitCommandSet
;
302
303
int
builtInDialog
;
// = 1 if this dialog is parsed inside processSpecialMenuItems, otherwise = 0.
304
// If builtInDialog == 1, the associated callback functions will return a negative number instead
305
// of a positive number, which is used for user defined commands.
306
307
int
pButtonRows
;
// pack the pButtons into this many rows
308
int
n_pButtons
;
309
PushButton
*
pButtons
;
// array of buttonDefs
310
311
int
toggleButtonColumns
;
312
int
n_toggle
;
313
ToggleButton
*
tButtons
;
// array of buttonDefs
314
315
int
n_text
;
316
TextLabel
*
textBoxes
;
317
318
int
n_radioBoxes
;
319
RadioBox
radioBoxData
[
MAX_RADIO_BOXES
];
320
321
int
optionMenuColumns
;
322
int
n_optionMenu
;
323
OptionMenu
opMenuData
[
MAX_OP_MENU
];
324
325
int
n_pullDownMenu
;
326
PullDownMenu
pdMenuData
[
MAX_PD_MENU
];
327
328
int
n_infoLabels
;
329
InfoLabel
infoLabelData
[
MAX_INFO_LABELS
];
330
331
DialogData
(
DialogData
&source);
// copy constructor disabled since it never gets defined
332
void
operator =
(
DialogData
&source);
// assignment operator disabled since it never gets defined
333
334
int
pdLastIsHelp
;
335
};
336
337
338
class
PickInfo
339
{
340
public
:
341
342
PickInfo
();
// default constructor
343
344
int
pickType
;
345
int
pickWindow
;
346
GUITypes::real
pickBox
[4];
// xmin, xmax, ymin, ymax
347
};
348
349
#endif
Generated on Fri Jan 4 2013 10:17:50 for Overture by
1.8.3