2 * Grace - GRaphing, Advanced Computation and Exploration of data
4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/
6 * Copyright (c) 2012 Grace Development Team
8 * Maintained by Evgeny Stambulchik
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 #include <X11/Intrinsic.h>
38 #endif /* MOTIF_GUI */
41 #include "qtgui/qtinc.h"
45 void WidgetManage(Widget w
);
46 void WidgetUnmanage(Widget w
);
47 int WidgetIsManaged(Widget w
);
48 void *WidgetGetUserData(Widget w
);
49 void WidgetSetUserData(Widget w
, void *udata
);
50 void WidgetSetSensitive(Widget w
, int onoff
);
51 void WidgetSetFocus(Widget w
);
52 void WidgetSetWidth(Widget w
, unsigned int width
);
53 void WidgetSetHeight(Widget w
, unsigned int height
);
54 void WidgetSetSize(Widget w
, unsigned int width
, unsigned int height
);
55 void WidgetGetSize(Widget w
, unsigned int *width
, unsigned int *height
);
57 typedef void (*Key_CBProc
)(void *anydata
);
66 void AddWidgetKeyPressCB(Widget w
, int key
, Key_CBProc cbproc
, void *anydata
);
67 void AddWidgetKeyPressCB2(Widget w
, int modifiers
, int key
, Key_CBProc cbproc
, void *anydata
);
69 typedef struct _Widget_CBData Widget_CBData
;
70 typedef void (*Widget_CBProc
)(Widget_CBData
*wcbdata
);
71 struct _Widget_CBData
{
77 void AddWidgetCB(Widget w
, const char *callback
, Widget_CBProc cbproc
, void *anydata
);
80 Widget
CreateDialogWindow(Widget parent
, const char *s
);
83 Widget
CreateDialog(Widget parent
, const char *s
);
84 void DialogRaise(Widget form
);
85 void DialogClose(Widget form
);
86 void DialogSetResizable(Widget form
, int onoff
);
88 /* File selection box */
89 Widget
CreateFileSelectionBox(Widget parent
);
91 /* File selection filter */
92 void CreateFileSelectionFilter(Widget parent
, Widget fsb
);
94 /* File selection dialog */
99 FSBStructure
*CreateFSBDialog(Widget parent
, char *s
);
101 typedef int (*FSB_CBProc
)(
103 char *, /* filename */
104 void * /* data the application registered */
106 void AddFSBDialogCB(FSBStructure
*fsbp
, FSB_CBProc cbproc
, void *anydata
);
107 void FSBDialogSetPattern(FSBStructure
*fsb
, char *pattern
);
108 void FSBDialogSetDirectory(FSBStructure
*fsb
, char *directory
);
111 Widget
CreateVContainer(Widget parent
);
112 Widget
CreateHContainer(Widget parent
);
115 Widget
CreateForm(Widget parent
);
116 void FormAddHChild(Widget form
, Widget child
);
117 void FormAddVChild(Widget form
, Widget child
);
118 void FormFixateHChild(Widget w
);
119 void FormFixateVChild(Widget w
);
122 Widget
CreateGrid(Widget parent
, int ncols
, int nrows
);
123 void PlaceGridChild(Widget grid
, Widget w
, int col
, int row
);
126 Widget
CreateFrame(Widget parent
, char *s
);
128 /* Scrolled window */
129 Widget
CreateScrolledWindow(Widget parent
);
132 Widget
CreatePanedWindow(Widget parent
);
133 void PanedWindowSetMinWidth(Widget w
, unsigned int width
);
136 Widget
CreateTab(Widget parent
);
137 Widget
CreateTabPage(Widget parent
, char *s
);
138 void SelectTabPage(Widget tab
, Widget w
);
141 Widget
CreateSeparator(Widget parent
);
144 Widget
CreateLabel(Widget parent
, char *s
);
145 void LabelSetString(Widget w
, char *s
);
146 void LabelSetPixmap(Widget w
, int width
, int height
, const unsigned char *bits
);
149 Widget
CreateLineTextEdit(Widget parent
, int len
);
150 Widget
CreateMultiLineTextEdit(Widget parent
, int nrows
);
159 void TextSetLength(TextStructure
*cst
, int len
);
160 char *TextGetString(TextStructure
*cst
);
161 void TextSetString(TextStructure
*cst
, char *s
);
163 typedef int (*TextValidate_CBProc
)(
168 void AddTextValidateCB(TextStructure
*cst
, TextValidate_CBProc cbproc
, void *anydata
);
169 int TextGetCursorPos(TextStructure
*cst
);
170 void TextSetCursorPos(TextStructure
*cst
, int pos
);
171 int TextGetLastPosition(TextStructure
*cst
);
172 void TextInsert(TextStructure
*cst
, int pos
, char *s
);
173 void TextSetEditable(TextStructure
*cst
, int onoff
);
176 typedef void (*Button_CBProc
)(
178 void * /* data the application registered */
180 Widget
CreateButton(Widget parent
, char *label
);
181 Widget
CreateBitmapButton(Widget parent
,
182 int width
, int height
, const unsigned char *bits
);
186 Widget
CreateArrowButton(Widget parent
, int arrow_type
);
189 typedef void (*TB_CBProc
)(
191 int onoff
, /* True/False */
192 void * /* data the application registered */
194 Widget
CreateToggleButton(Widget parent
, char *s
);
195 int GetToggleButtonState(Widget w
);
196 void SetToggleButtonState(Widget w
, int value
);
199 Widget
CreateScale(Widget parent
, char *s
, int min
, int max
, int delta
);
200 void SetScaleValue(Widget w
, int value
);
201 int GetScaleValue(Widget w
);
214 SpinStructure
*CreateSpinChoice(Widget parent
, char *s
, int len
,
215 int type
, double min
, double max
, double incr
);
216 double GetSpinChoice(SpinStructure
*spinp
);
217 void SetSpinChoice(SpinStructure
*spinp
, double value
);
219 typedef void (*Spin_CBProc
)(
220 SpinStructure
*spinp
,
221 double, /* value of spinner */
222 void * /* data the application registered */
224 void AddSpinChoiceCB(SpinStructure
*spinp
, Spin_CBProc cbproc
, void *data
);
227 typedef struct _OptionStructure OptionStructure
;
232 OptionStructure
*CreateOptionChoice(Widget parent
, char *labelstr
, int ncols
,
233 int nchoices
, OptionItem
*items
);
234 OptionStructure
*CreateOptionChoiceVA(Widget parent
, char *labelstr
, ...);
235 int GetOptionChoice(OptionStructure
*opt
);
236 void UpdateOptionChoice(OptionStructure
*optp
, int nchoices
, OptionItem
*items
);
238 typedef void (*OC_CBProc
)(
239 OptionStructure
*opt
,
240 int value
, /* value */
241 void * /* data the application registered */
250 OptionStructure
*opt
;
255 struct _OptionStructure
{
257 int ncols
; /* preferred number of columns */
260 OptionWidgetItem
*options
;
265 void AddOptionChoiceCB(OptionStructure
*opt
, OC_CBProc cbproc
, void *anydata
);
268 Widget
CreatePopupMenu(Widget parent
);
269 void PopupMenuShow(Widget w
, void *data
);
270 Widget
CreateMenuBar(Widget parent
);
271 Widget
CreateMenu(Widget parent
, char *label
, char mnemonic
, int help
);
272 Widget
CreateMenuButton(Widget parent
, char *label
, char mnemonic
,
273 Button_CBProc cb
, void *data
);
274 Widget
CreateMenuButtonA(Widget parent
, char *label
, char mnemonic
,
275 char *accelerator
, char* acceleratorText
, Button_CBProc cb
, void *data
);
276 Widget
CreateMenuHelpButton(Widget parent
, char *label
, char mnemonic
,
277 Widget form
, char *ha
);
278 Widget
CreateMenuToggle(Widget parent
, char *label
, char mnemonic
,
279 TB_CBProc cb
, void *data
);
280 Widget
CreateMenuSeparator(Widget parent
);
282 #endif /* __WIDGETS_H_ */