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
);
55 typedef void (*Key_CBProc
)(void *anydata
);
64 void AddWidgetKeyPressCB(Widget w
, int key
, Key_CBProc cbproc
, void *anydata
);
65 void AddWidgetKeyPressCB2(Widget w
, int modifiers
, int key
, Key_CBProc cbproc
, void *anydata
);
67 typedef struct _Widget_CBData Widget_CBData
;
68 typedef void (*Widget_CBProc
)(Widget_CBData
*wcbdata
);
69 struct _Widget_CBData
{
75 void AddWidgetCB(Widget w
, const char *callback
, Widget_CBProc cbproc
, void *anydata
);
78 Widget
CreateDialog(Widget parent
, const char *s
);
79 void DialogRaise(Widget form
);
80 void DialogClose(Widget form
);
81 void DialogSetResizable(Widget form
, int onoff
);
83 /* File selection dialog */
89 FSBStructure
*CreateFileSelectionBox(Widget parent
, char *s
);
91 typedef int (*FSB_CBProc
)(
93 char *, /* filename */
94 void * /* data the application registered */
96 void AddFileSelectionBoxCB(FSBStructure
*fsbp
, FSB_CBProc cbproc
, void *anydata
);
97 void SetFileSelectionBoxPattern(FSBStructure
*fsb
, char *pattern
);
100 Widget
CreateVContainer(Widget parent
);
101 Widget
CreateHContainer(Widget parent
);
104 Widget
CreateForm(Widget parent
);
105 void FormAddHChild(Widget form
, Widget child
);
106 void FormAddVChild(Widget form
, Widget child
);
107 void FormFixateVChild(Widget w
);
110 Widget
CreateLabel(Widget parent
, char *s
);
111 void LabelSetString(Widget w
, char *s
);
112 void LabelSetPixmap(Widget w
, int width
, int height
, const unsigned char *bits
);
115 Widget
CreateLineTextEdit(Widget parent
, int len
);
116 Widget
CreateMultiLineTextEdit(Widget parent
, int nrows
);
125 void TextSetLength(TextStructure
*cst
, int len
);
126 char *TextGetString(TextStructure
*cst
);
127 void TextSetString(TextStructure
*cst
, char *s
);
129 typedef int (*TextValidate_CBProc
)(
134 void AddTextValidateCB(TextStructure
*cst
, TextValidate_CBProc cbproc
, void *anydata
);
135 int TextGetCursorPos(TextStructure
*cst
);
136 void TextSetCursorPos(TextStructure
*cst
, int pos
);
137 int TextGetLastPosition(TextStructure
*cst
);
138 void TextInsert(TextStructure
*cst
, int pos
, char *s
);
139 void TextSetEditable(TextStructure
*cst
, int onoff
);
142 Widget
CreateTab(Widget parent
);
143 Widget
CreateTabPage(Widget parent
, char *s
);
144 void SelectTabPage(Widget tab
, Widget w
);
147 typedef void (*Button_CBProc
)(
149 void * /* data the application registered */
151 Widget
CreateButton(Widget parent
, char *label
);
152 Widget
CreateBitmapButton(Widget parent
,
153 int width
, int height
, const unsigned char *bits
);
156 typedef void (*TB_CBProc
)(
158 int onoff
, /* True/False */
159 void * /* data the application registered */
161 Widget
CreateToggleButton(Widget parent
, char *s
);
162 int GetToggleButtonState(Widget w
);
163 void SetToggleButtonState(Widget w
, int value
);
166 Widget
CreatePanedWindow(Widget parent
);
167 void PanedWindowSetMinWidth(Widget w
, unsigned int width
);
170 Widget
CreateGrid(Widget parent
, int ncols
, int nrows
);
171 void PlaceGridChild(Widget grid
, Widget w
, int col
, int row
);
174 typedef struct _OptionStructure OptionStructure
;
179 OptionStructure
*CreateOptionChoice(Widget parent
, char *labelstr
, int ncols
,
180 int nchoices
, OptionItem
*items
);
181 OptionStructure
*CreateOptionChoiceVA(Widget parent
, char *labelstr
, ...);
182 int GetOptionChoice(OptionStructure
*opt
);
183 void UpdateOptionChoice(OptionStructure
*optp
, int nchoices
, OptionItem
*items
);
185 typedef void (*OC_CBProc
)(
186 OptionStructure
*opt
,
187 int value
, /* value */
188 void * /* data the application registered */
197 OptionStructure
*opt
;
202 struct _OptionStructure
{
204 int ncols
; /* preferred number of columns */
207 OptionWidgetItem
*options
;
212 void AddOptionChoiceCB(OptionStructure
*opt
, OC_CBProc cbproc
, void *anydata
);
215 Widget
CreatePopupMenu(Widget parent
);
216 Widget
CreateMenuBar(Widget parent
);
217 Widget
CreateMenu(Widget parent
, char *label
, char mnemonic
, int help
);
218 Widget
CreateMenuButton(Widget parent
, char *label
, char mnemonic
,
219 Button_CBProc cb
, void *data
);
220 Widget
CreateMenuButtonA(Widget parent
, char *label
, char mnemonic
,
221 char *accelerator
, char* acceleratorText
, Button_CBProc cb
, void *data
);
222 Widget
CreateMenuHelpButton(Widget parent
, char *label
, char mnemonic
,
223 Widget form
, char *ha
);
224 Widget
CreateMenuToggle(Widget parent
, char *label
, char mnemonic
,
225 TB_CBProc cb
, void *data
);
227 #endif /* __WIDGETS_H_ */