1 /****************************************************************************
2
3 GLUI User Interface Toolkit
4 ---------------------------
5
6 glui_add_controls.cpp - Routines for adding controls to a GLUI window
7
8 Note: these routines are all deprecated. Keeping them all here
9 prevents the linker from dragging in all the .o files, even for controls
10 that aren't used.
11
12 --------------------------------------------------
13
14 Copyright (c) 1998 Paul Rademacher
15
16 WWW: http://sourceforge.net/projects/glui/
17 Forums: http://sourceforge.net/forum/?group_id=92496
18
19 This software is provided 'as-is', without any express or implied
20 warranty. In no event will the authors be held liable for any damages
21 arising from the use of this software.
22
23 Permission is granted to anyone to use this software for any purpose,
24 including commercial applications, and to alter it and redistribute it
25 freely, subject to the following restrictions:
26
27 1. The origin of this software must not be misrepresented; you must not
28 claim that you wrote the original software. If you use this software
29 in a product, an acknowledgment in the product documentation would be
30 appreciated but is not required.
31 2. Altered source versions must be plainly marked as such, and must not be
32 misrepresented as being the original software.
33 3. This notice may not be removed or altered from any source distribution.
34
35 *****************************************************************************/
36
37 #include "GL/glui.h"
38 #include "glui_internal.h"
39
40
41 /*********************************** GLUI:: add_checkbox() ************/
42
add_checkbox(const char * name,int * value_ptr,int id,GLUI_CB callback)43 GLUI_Checkbox *GLUI:: add_checkbox( const char *name, int *value_ptr,
44 int id, GLUI_CB callback )
45 {
46 return add_checkbox_to_panel( main_panel,
47 name, value_ptr, id, callback );
48 }
49
50
51 /*********************************** GLUI:: add_checkbox_to_panel() **********/
52
add_checkbox_to_panel(GLUI_Panel * panel,const char * name,int * value_ptr,int id,GLUI_CB callback)53 GLUI_Checkbox *GLUI::add_checkbox_to_panel( GLUI_Panel *panel,
54 const char *name, int *value_ptr,
55 int id,
56 GLUI_CB callback )
57 {
58 return new GLUI_Checkbox( panel, name, value_ptr, id, callback );
59 }
60
61 /********************************************* GLUI::add_panel() *************/
62
add_panel(const char * name,int type)63 GLUI_Panel *GLUI::add_panel( const char *name, int type )
64 {
65 return add_panel_to_panel( main_panel, name, type );
66 }
67
68
69 /**************************************** GLUI::add_panel_to_panel() *********/
70
add_panel_to_panel(GLUI_Panel * parent_panel,const char * name,int type)71 GLUI_Panel *GLUI::add_panel_to_panel( GLUI_Panel *parent_panel,
72 const char *name, int type )
73 {
74 return new GLUI_Panel( parent_panel, name, type );
75 }
76
77
78 /***************************** GLUI::add_radiogroup() ***************/
79
add_radiogroup(int * value_ptr,int user_id,GLUI_CB callback)80 GLUI_RadioGroup *GLUI::add_radiogroup( int *value_ptr,
81 int user_id, GLUI_CB callback)
82 {
83 return add_radiogroup_to_panel( main_panel, value_ptr,
84 user_id, callback );
85 }
86
87
88 /***************************** GLUI::add_radiogroup_to_panel() ***************/
89
add_radiogroup_to_panel(GLUI_Panel * panel,int * value_ptr,int user_id,GLUI_CB callback)90 GLUI_RadioGroup *GLUI::add_radiogroup_to_panel(
91 GLUI_Panel *panel, int *value_ptr,
92 int user_id, GLUI_CB callback
93 )
94 {
95 return new GLUI_RadioGroup( panel, value_ptr, user_id, callback );
96 }
97
98
99 /***************************** GLUI::add_radiobutton_to_group() *************/
100
add_radiobutton_to_group(GLUI_RadioGroup * group,const char * name)101 GLUI_RadioButton *GLUI::add_radiobutton_to_group( GLUI_RadioGroup *group,
102 const char *name )
103 {
104 return new GLUI_RadioButton( group, name );
105 }
106
107
108 /********************************** GLUI::add_statictext() ************/
109
add_statictext(const char * name)110 GLUI_StaticText *GLUI::add_statictext( const char *name )
111 {
112 return add_statictext_to_panel( main_panel, name );
113 }
114
115
116 /******************************* GLUI::add_statictext_to_panel() **********/
117
add_statictext_to_panel(GLUI_Panel * panel,const char * name)118 GLUI_StaticText *GLUI::add_statictext_to_panel( GLUI_Panel *panel,
119 const char *name )
120 {
121 return new GLUI_StaticText( panel, name );
122 }
123
124
125 /***************************************** GLUI:: add_button() ************/
126
add_button(const char * name,int id,GLUI_CB callback)127 GLUI_Button *GLUI:: add_button( const char *name,
128 int id, GLUI_CB callback )
129 {
130 return add_button_to_panel( main_panel,
131 name, id, callback );
132 }
133
134 /*********************************** GLUI:: add_button_to_panel() **********/
135
add_button_to_panel(GLUI_Panel * panel,const char * name,int id,GLUI_CB callback)136 GLUI_Button *GLUI::add_button_to_panel( GLUI_Panel *panel,
137 const char *name,
138 int id,
139 GLUI_CB callback )
140 {
141 return new GLUI_Button( panel, name, id, callback );
142 }
143
144 /********************************** GLUI::add_separator() ************/
145
add_separator(void)146 void GLUI::add_separator( void )
147 {
148 add_separator_to_panel( main_panel );
149 }
150
151
152 /******************************* GLUI::add_separator_to_panel() **********/
153
add_separator_to_panel(GLUI_Panel * panel)154 void GLUI::add_separator_to_panel( GLUI_Panel *panel )
155 {
156 new GLUI_Separator( panel );
157 }
158
159
160 /********************************** GLUI::add_edittext() ************/
161
add_edittext(const char * name,int data_type,void * data,int id,GLUI_CB callback)162 GLUI_EditText *GLUI::add_edittext( const char *name,
163 int data_type, void *data,
164 int id, GLUI_CB callback)
165 {
166 return add_edittext_to_panel( main_panel, name, data_type, data,
167 id, callback );
168 }
169
170
171 /******************************* GLUI::add_edittext_to_panel() **********/
172
add_edittext_to_panel(GLUI_Panel * panel,const char * name,int data_type,void * data,int id,GLUI_CB callback)173 GLUI_EditText *GLUI::add_edittext_to_panel( GLUI_Panel *panel,
174 const char *name,
175 int data_type, void *data,
176 int id, GLUI_CB callback)
177 {
178 return new GLUI_EditText( panel, name, data_type, data, id, callback );
179 }
180
181 /********************************** GLUI::add_edittext() ************/
182
add_edittext(const char * name,GLUI_String & data,int id,GLUI_CB callback)183 GLUI_EditText *GLUI::add_edittext( const char *name,
184 GLUI_String & data,
185 int id, GLUI_CB callback)
186 {
187 return add_edittext_to_panel( main_panel, name, data, id, callback );
188 }
189
190
191 /******************************* GLUI::add_edittext_to_panel() **********/
192
193 GLUI_EditText*
add_edittext_to_panel(GLUI_Panel * panel,const char * name,GLUI_String & data,int id,GLUI_CB callback)194 GLUI::add_edittext_to_panel( GLUI_Panel *panel, const char *name,
195 GLUI_String& data,
196 int id, GLUI_CB callback)
197 {
198 return new GLUI_EditText( panel, name, GLUI_EDITTEXT_STRING, &data, id, callback );
199 }
200
201 /********************************** GLUI::add_spinner() ************/
202
add_spinner(const char * name,int data_type,void * data,int id,GLUI_CB callback)203 GLUI_Spinner *GLUI::add_spinner( const char *name,
204 int data_type, void *data,
205 int id, GLUI_CB callback)
206 {
207 return add_spinner_to_panel( main_panel, name, data_type, data,
208 id, callback );
209 }
210
211
212 /******************************* GLUI::add_spinner_to_panel() **********/
213
add_spinner_to_panel(GLUI_Panel * panel,const char * name,int data_type,void * data,int id,GLUI_CB callback)214 GLUI_Spinner *GLUI::add_spinner_to_panel(
215 GLUI_Panel *panel, const char *name,
216 int data_type, void *data,
217 int id, GLUI_CB callback
218 )
219 {
220 return new GLUI_Spinner( panel, name, data_type, data, id, callback );
221 }
222
223
224 /********************************** GLUI::add_column() ************/
225
add_column(int draw_bar)226 void GLUI::add_column( int draw_bar )
227 {
228 add_column_to_panel( main_panel, draw_bar );
229 }
230
231
232 /******************************* GLUI::add_column_to_panel() **********/
233
add_column_to_panel(GLUI_Panel * panel,int draw_bar)234 void GLUI::add_column_to_panel( GLUI_Panel *panel, int draw_bar )
235 {
236 new GLUI_Column( panel, draw_bar );
237 }
238
239
240 /*********************************** GLUI:: add_listbox() ************/
241
add_listbox(const char * name,int * value_ptr,int id,GLUI_CB callback)242 GLUI_Listbox *GLUI:: add_listbox( const char *name, int *value_ptr,
243 int id, GLUI_CB callback )
244 {
245 return add_listbox_to_panel( main_panel,
246 name, value_ptr, id, callback );
247 }
248
249
250 /*********************************** GLUI:: add_listbox_to_panel() **********/
251
add_listbox_to_panel(GLUI_Panel * panel,const char * name,int * value_ptr,int id,GLUI_CB callback)252 GLUI_Listbox *GLUI::add_listbox_to_panel( GLUI_Panel *panel,
253 const char *name, int *value_ptr,
254 int id,
255 GLUI_CB callback )
256 {
257 return new GLUI_Listbox( panel, name, value_ptr, id, callback );
258 }
259
260
261 /*********************************** GLUI:: add_rotation() ************/
262
add_rotation(const char * name,float * value_ptr,int id,GLUI_CB callback)263 GLUI_Rotation *GLUI:: add_rotation( const char *name, float *value_ptr,
264 int id, GLUI_CB callback )
265 {
266 return add_rotation_to_panel( main_panel, name, value_ptr, id, callback );
267 }
268
269
270 /*********************************** GLUI:: add_rotation_to_panel() **********/
271
add_rotation_to_panel(GLUI_Panel * panel,const char * name,float * value_ptr,int id,GLUI_CB callback)272 GLUI_Rotation *GLUI::add_rotation_to_panel( GLUI_Panel *panel,
273 const char *name, float *value_ptr,
274 int id,
275 GLUI_CB callback )
276 {
277 return new GLUI_Rotation( panel, name, value_ptr, id, callback );
278 }
279
280
281 /*********************************** GLUI:: add_translation() ************/
282
add_translation(const char * name,int trans_type,float * value_ptr,int id,GLUI_CB callback)283 GLUI_Translation *GLUI:: add_translation( const char *name, int trans_type,
284 float *value_ptr, int id,
285 GLUI_CB callback )
286 {
287 return add_translation_to_panel( main_panel,name,trans_type,
288 value_ptr, id, callback );
289 }
290
291
292 /*********************************** GLUI:: add_translation_to_panel() **********/
293
add_translation_to_panel(GLUI_Panel * panel,const char * name,int trans_type,float * value_ptr,int id,GLUI_CB callback)294 GLUI_Translation *GLUI::add_translation_to_panel(
295 GLUI_Panel *panel, const char *name,
296 int trans_type, float *value_ptr,
297 int id, GLUI_CB callback
298 )
299 {
300 return new GLUI_Translation(panel, name, trans_type, value_ptr, id, callback);
301 }
302
303
304 /********************************** GLUI::add_rollout() **************/
305
add_rollout(const char * name,int open,int type)306 GLUI_Rollout *GLUI::add_rollout( const char *name, int open, int type)
307 {
308 return add_rollout_to_panel( main_panel, name, open, type);
309 }
310
311
312 /****************************** GLUI::add_rollout_to_panel() *********/
313
add_rollout_to_panel(GLUI_Panel * panel,const char * name,int open,int type)314 GLUI_Rollout *GLUI::add_rollout_to_panel(GLUI_Panel *panel, const char *name,
315 int open, int type)
316 {
317 return new GLUI_Rollout( panel, name, open, type );
318 }
319
320
321
322