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 typedef void (*Timer_CBProc
)(void *anydata
);
47 unsigned long timer_id
;
48 unsigned long interval
;
52 Timer_CBdata
*CreateTimer(unsigned long interval
, Timer_CBProc cbproc
, void *anydata
);
53 void TimerStart(Timer_CBdata
*cbdata
);
56 void WidgetManage(Widget w
);
57 void WidgetUnmanage(Widget w
);
58 int WidgetIsManaged(Widget w
);
59 void *WidgetGetUserData(Widget w
);
60 void WidgetSetUserData(Widget w
, void *udata
);
61 void WidgetSetSensitive(Widget w
, int onoff
);
62 void WidgetSetFocus(Widget w
);
63 void WidgetSetWidth(Widget w
, unsigned int width
);
64 void WidgetSetHeight(Widget w
, unsigned int height
);
65 void WidgetSetSize(Widget w
, unsigned int width
, unsigned int height
);
66 void WidgetGetSize(Widget w
, unsigned int *width
, unsigned int *height
);
68 typedef void (*Key_CBProc
)(void *anydata
);
77 void AddWidgetKeyPressCB(Widget w
, int key
, Key_CBProc cbproc
, void *anydata
);
78 void AddWidgetKeyPressCB2(Widget w
, int modifiers
, int key
, Key_CBProc cbproc
, void *anydata
);
80 void AddWidgetButtonPressCB(Widget w
, int button
, Key_CBProc cbproc
, void *anydata
);
87 typedef struct _Widget_CBData Widget_CBData
;
88 typedef void (*Widget_CBProc
)(Widget_CBData
*wcbdata
);
89 struct _Widget_CBData
{
95 void AddWidgetCB(Widget w
, const char *callback
, Widget_CBProc cbproc
, void *anydata
);
98 Widget
CreateDialogWindow(Widget parent
, const char *s
);
101 Widget
CreateDialog(Widget parent
, const char *s
);
102 void DialogRaise(Widget form
);
103 void DialogClose(Widget form
);
104 void DialogSetResizable(Widget form
, int onoff
);
106 /* File selection box */
107 Widget
CreateFileSelectionBox(Widget parent
);
109 /* File selection filter */
110 void CreateFileSelectionFilter(Widget parent
, Widget fsb
);
112 /* File selection dialog */
117 FSBStructure
*CreateFSBDialog(Widget parent
, char *s
);
119 typedef int (*FSB_CBProc
)(
121 char *, /* filename */
122 void * /* data the application registered */
124 void AddFSBDialogCB(FSBStructure
*fsbp
, FSB_CBProc cbproc
, void *anydata
);
125 void FSBDialogSetPattern(FSBStructure
*fsb
, char *pattern
);
126 void FSBDialogSetDirectory(FSBStructure
*fsb
, char *directory
);
129 Widget
CreateVContainer(Widget parent
);
130 Widget
CreateHContainer(Widget parent
);
133 Widget
CreateForm(Widget parent
);
134 void FormAddHChild(Widget form
, Widget child
);
135 void FormAddVChild(Widget form
, Widget child
);
136 void FormFixateHChild(Widget w
);
137 void FormFixateVChild(Widget w
);
140 Widget
CreateGrid(Widget parent
, int ncols
, int nrows
);
141 void PlaceGridChild(Widget grid
, Widget w
, int col
, int row
);
144 Widget
CreateFrame(Widget parent
, char *s
);
146 /* Scrolled window */
147 Widget
CreateScrolledWindow(Widget parent
);
150 Widget
CreatePanedWindow(Widget parent
);
151 void PanedWindowSetMinWidth(Widget w
, unsigned int width
);
154 Widget
CreateTab(Widget parent
);
155 Widget
CreateTabPage(Widget parent
, char *s
);
156 void SelectTabPage(Widget tab
, Widget w
);
159 Widget
CreateSeparator(Widget parent
);
162 Widget
CreateLabel(Widget parent
, char *s
);
163 void LabelSetString(Widget w
, char *s
);
164 void LabelSetPixmap(Widget w
, int width
, int height
, const unsigned char *bits
);
167 Widget
CreateLineTextEdit(Widget parent
, int len
);
168 Widget
CreateMultiLineTextEdit(Widget parent
, int nrows
);
169 char *TextEditGetString(Widget w
);
170 void TextEditSetString(Widget w
, char *s
);
180 void TextInsertString(TextStructure
*cst
, int pos
, char *s
);
181 int TextGetCursorPos(TextStructure
*cst
);
182 void TextSetCursorPos(TextStructure
*cst
, int pos
);
183 int TextGetLastPosition(TextStructure
*cst
);
184 void TextSetLength(TextStructure
*cst
, int len
);
185 void TextSetEditable(TextStructure
*cst
, int onoff
);
188 typedef void (*Button_CBProc
)(
190 void * /* data the application registered */
192 Widget
CreateButton(Widget parent
, char *label
);
193 Widget
CreateBitmapButton(Widget parent
,
194 int width
, int height
, const unsigned char *bits
);
198 Widget
CreateArrowButton(Widget parent
, int arrow_type
);
201 typedef void (*TB_CBProc
)(
203 int onoff
, /* True/False */
204 void * /* data the application registered */
206 Widget
CreateToggleButton(Widget parent
, char *s
);
207 int ToggleButtonGetState(Widget w
);
208 void ToggleButtonSetState(Widget w
, int value
);
211 Widget
CreateScale(Widget parent
, char *s
, int min
, int max
, int delta
);
212 void ScaleSetValue(Widget w
, int value
);
213 int ScaleGetValue(Widget w
);
216 typedef struct _OptionStructure OptionStructure
;
221 OptionStructure
*CreateOptionChoice(Widget parent
, char *labelstr
, int ncols
,
222 int nchoices
, OptionItem
*items
);
223 OptionStructure
*CreateOptionChoiceVA(Widget parent
, char *labelstr
, ...);
224 int GetOptionChoice(OptionStructure
*opt
);
225 void UpdateOptionChoice(OptionStructure
*optp
, int nchoices
, OptionItem
*items
);
227 typedef void (*OC_CBProc
)(
228 OptionStructure
*opt
,
229 int value
, /* value */
230 void * /* data the application registered */
239 OptionStructure
*opt
;
244 struct _OptionStructure
{
246 int ncols
; /* preferred number of columns */
249 OptionWidgetItem
*options
;
254 void AddOptionChoiceCB(OptionStructure
*opt
, OC_CBProc cbproc
, void *anydata
);
257 Widget
CreatePopupMenu(Widget parent
);
258 void PopupMenuShow(Widget w
, void *data
);
259 Widget
CreateMenuBar(Widget parent
);
260 Widget
CreateMenu(Widget parent
, char *label
, char mnemonic
, int help
);
261 Widget
CreateMenuButton(Widget parent
, char *label
, char mnemonic
,
262 Button_CBProc cb
, void *data
);
263 Widget
CreateMenuButtonA(Widget parent
, char *label
, char mnemonic
,
264 char *accelerator
, char* acceleratorText
, Button_CBProc cb
, void *data
);
265 Widget
CreateMenuHelpButton(Widget parent
, char *label
, char mnemonic
,
266 Widget form
, char *ha
);
267 Widget
CreateMenuToggle(Widget parent
, char *label
, char mnemonic
,
268 TB_CBProc cb
, void *data
);
269 Widget
CreateMenuSeparator(Widget parent
);
271 #endif /* __WIDGETS_H_ */