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 WidgetSetHeight(Widget w
, unsigned int height
);
52 void WidgetSetSize(Widget w
, unsigned int width
, unsigned int height
);
53 void WidgetGetSize(Widget w
, unsigned int *width
, unsigned int *height
);
54 void WidgetSetMinWidth(Widget w
, unsigned int width
, unsigned int height
);
56 typedef void (*Key_CBProc
)(void *anydata
);
65 void AddWidgetKeyPressCB(Widget w
, int key
, Key_CBProc cbproc
, void *anydata
);
66 void AddWidgetKeyPressCB2(Widget w
, int modifiers
, int key
, Key_CBProc cbproc
, void *anydata
);
68 typedef struct _Widget_CBData Widget_CBData
;
69 typedef void (*Widget_CBProc
)(Widget_CBData
*wcbdata
);
70 struct _Widget_CBData
{
76 void AddWidgetCB(Widget w
, const char *callback
, Widget_CBProc cbproc
, void *anydata
);
79 Widget
CreateDialog(Widget parent
, const char *s
);
80 void DialogRaise(Widget form
);
81 void DialogClose(Widget form
);
82 void DialogSetResizable(Widget form
, int onoff
);
84 /* File selection dialog */
90 FSBStructure
*CreateFileSelectionBox(Widget parent
, char *s
);
92 typedef int (*FSB_CBProc
)(
94 char *, /* filename */
95 void * /* data the application registered */
97 void AddFileSelectionBoxCB(FSBStructure
*fsbp
, FSB_CBProc cbproc
, void *anydata
);
98 void SetFileSelectionBoxPattern(FSBStructure
*fsb
, char *pattern
);
101 Widget
CreateVContainer(Widget parent
);
102 Widget
CreateHContainer(Widget parent
);
105 Widget
CreateForm(Widget parent
);
106 void FormAddHChild(Widget form
, Widget child
);
107 void FormAddVChild(Widget form
, Widget child
);
108 void FormFixateVChild(Widget w
);
111 Widget
CreateLabel(Widget parent
, char *s
);
112 void LabelSetString(Widget w
, char *s
);
113 void LabelSetPixmap(Widget w
, int width
, int height
, const unsigned char *bits
);
116 Widget
CreateLineTextEdit(Widget parent
, int len
);
117 Widget
CreateMultiLineTextEdit(Widget parent
, int nrows
);
126 void TextSetLength(TextStructure
*cst
, int len
);
127 char *TextGetString(TextStructure
*cst
);
128 void TextSetString(TextStructure
*cst
, char *s
);
130 typedef int (*TextValidate_CBProc
)(
135 void AddTextValidateCB(TextStructure
*cst
, TextValidate_CBProc cbproc
, void *anydata
);
136 int TextGetCursorPos(TextStructure
*cst
);
137 void TextSetCursorPos(TextStructure
*cst
, int pos
);
138 int TextGetLastPosition(TextStructure
*cst
);
139 void TextInsert(TextStructure
*cst
, int pos
, char *s
);
140 void TextSetEditable(TextStructure
*cst
, int onoff
);
143 Widget
CreateTab(Widget parent
);
144 Widget
CreateTabPage(Widget parent
, char *s
);
145 void SelectTabPage(Widget tab
, Widget w
);
148 typedef void (*Button_CBProc
)(
150 void * /* data the application registered */
152 Widget
CreateButton(Widget parent
, char *label
);
153 Widget
CreateBitmapButton(Widget parent
,
154 int width
, int height
, const unsigned char *bits
);
157 typedef void (*TB_CBProc
)(
159 int onoff
, /* True/False */
160 void * /* data the application registered */
162 Widget
CreateToggleButton(Widget parent
, char *s
);
163 int GetToggleButtonState(Widget w
);
164 void SetToggleButtonState(Widget w
, int value
);
167 Widget
CreateGrid(Widget parent
, int ncols
, int nrows
);
168 void PlaceGridChild(Widget grid
, Widget w
, int col
, int row
);
171 typedef struct _OptionStructure OptionStructure
;
176 OptionStructure
*CreateOptionChoice(Widget parent
, char *labelstr
, int ncols
,
177 int nchoices
, OptionItem
*items
);
178 OptionStructure
*CreateOptionChoiceVA(Widget parent
, char *labelstr
, ...);
179 int GetOptionChoice(OptionStructure
*opt
);
180 void UpdateOptionChoice(OptionStructure
*optp
, int nchoices
, OptionItem
*items
);
182 typedef void (*OC_CBProc
)(
183 OptionStructure
*opt
,
184 int value
, /* value */
185 void * /* data the application registered */
194 OptionStructure
*opt
;
199 struct _OptionStructure
{
201 int ncols
; /* preferred number of columns */
204 OptionWidgetItem
*options
;
209 void AddOptionChoiceCB(OptionStructure
*opt
, OC_CBProc cbproc
, void *anydata
);
212 Widget
CreatePopupMenu(Widget parent
);
213 Widget
CreateMenuBar(Widget parent
);
214 Widget
CreateMenu(Widget parent
, char *label
, char mnemonic
, int help
);
215 Widget
CreateMenuButton(Widget parent
, char *label
, char mnemonic
,
216 Button_CBProc cb
, void *data
);
217 Widget
CreateMenuButtonA(Widget parent
, char *label
, char mnemonic
,
218 char *accelerator
, char* acceleratorText
, Button_CBProc cb
, void *data
);
219 Widget
CreateMenuHelpButton(Widget parent
, char *label
, char mnemonic
,
220 Widget form
, char *ha
);
221 Widget
CreateMenuToggle(Widget parent
, char *label
, char mnemonic
,
222 TB_CBProc cb
, void *data
);
224 #endif /* __WIDGETS_H_ */