Imported Upstream version 2.81
[platform/upstream/libbullet.git] / Extras / glui / glui_add_controls.cpp
1 /****************************************************************************
2
3   GLUI User Interface Toolkit (LGPL)
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 library is free software; you can redistribute it and/or
20   modify it under the terms of the GNU Lesser General Public
21   License as published by the Free Software Foundation; either
22   version 2.1 of the License, or (at your option) any later version.
23
24   This library is distributed in the hope that it will be useful,
25   but WITHOUT ANY WARRANTY; without even the implied warranty of
26   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27   Lesser General Public License for more details.
28
29   You should have received a copy of the GNU Lesser General Public
30   License along with this library; if not, write to the Free Software
31   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
32
33 *****************************************************************************/
34
35 #include "GL/glui.h"
36 #include "glui_internal.h"
37
38
39 /*********************************** GLUI:: add_checkbox() ************/
40
41 GLUI_Checkbox   *GLUI:: add_checkbox( const char *name, int *value_ptr,
42                                       int id, GLUI_CB callback )
43 {
44   return add_checkbox_to_panel( main_panel,
45                                 name, value_ptr, id, callback );
46 }
47
48
49 /*********************************** GLUI:: add_checkbox_to_panel() **********/
50
51 GLUI_Checkbox   *GLUI::add_checkbox_to_panel( GLUI_Panel *panel,
52                                               const char *name, int *value_ptr,
53                                               int id, 
54                                               GLUI_CB callback )
55 {
56   return new GLUI_Checkbox( panel, name, value_ptr, id, callback );
57 }
58
59 /********************************************* GLUI::add_panel() *************/
60
61 GLUI_Panel     *GLUI::add_panel( const char *name, int type )
62 {
63   return add_panel_to_panel( main_panel, name, type );
64 }
65
66
67 /**************************************** GLUI::add_panel_to_panel() *********/
68
69 GLUI_Panel *GLUI::add_panel_to_panel( GLUI_Panel *parent_panel,
70                                           const char *name, int type )
71 {
72   return new GLUI_Panel( parent_panel, name, type );
73 }
74
75
76 /***************************** GLUI::add_radiogroup() ***************/
77
78 GLUI_RadioGroup *GLUI::add_radiogroup( int *value_ptr,
79                                        int user_id, GLUI_CB callback)
80 {
81   return add_radiogroup_to_panel( main_panel, value_ptr,
82                                   user_id, callback );
83 }
84
85
86 /***************************** GLUI::add_radiogroup_to_panel() ***************/
87
88 GLUI_RadioGroup *GLUI::add_radiogroup_to_panel(  
89   GLUI_Panel *panel, int *value_ptr,
90   int user_id, GLUI_CB callback
91   )
92 {
93   return new GLUI_RadioGroup( panel, value_ptr, user_id, callback );
94 }
95
96
97 /***************************** GLUI::add_radiobutton_to_group() *************/
98
99 GLUI_RadioButton *GLUI::add_radiobutton_to_group(  GLUI_RadioGroup *group,
100                                                    const char *name )
101 {
102   return new GLUI_RadioButton( group, name );
103 }
104
105
106 /********************************** GLUI::add_statictext() ************/
107
108 GLUI_StaticText  *GLUI::add_statictext( const char *name )
109 {
110   return add_statictext_to_panel( main_panel, name );
111 }
112
113
114 /******************************* GLUI::add_statictext_to_panel() **********/
115
116 GLUI_StaticText *GLUI::add_statictext_to_panel( GLUI_Panel *panel, 
117                                                 const char *name )
118 {
119   return new GLUI_StaticText( panel, name );
120 }
121
122
123 /***************************************** GLUI:: add_button() ************/
124
125 GLUI_Button   *GLUI:: add_button( const char *name, 
126                                   int id, GLUI_CB callback )
127 {
128   return add_button_to_panel( main_panel,
129                               name, id, callback );
130 }
131
132 /*********************************** GLUI:: add_button_to_panel() **********/
133
134 GLUI_Button   *GLUI::add_button_to_panel( GLUI_Panel *panel,
135                                           const char *name, 
136                                           int id, 
137                                           GLUI_CB callback )
138 {
139   return new GLUI_Button( panel, name, id, callback );
140 }
141
142 /********************************** GLUI::add_separator() ************/
143
144 void  GLUI::add_separator( void )
145 {
146   add_separator_to_panel( main_panel );
147 }
148
149
150 /******************************* GLUI::add_separator_to_panel() **********/
151
152 void      GLUI::add_separator_to_panel( GLUI_Panel *panel )
153 {
154   new GLUI_Separator( panel );
155 }
156
157
158 /********************************** GLUI::add_edittext() ************/
159
160 GLUI_EditText  *GLUI::add_edittext( const char *name, 
161                                     int data_type, void *data,
162                                     int id, GLUI_CB callback)
163 {
164   return add_edittext_to_panel( main_panel, name, data_type, data,
165                                 id, callback );
166 }
167
168
169 /******************************* GLUI::add_edittext_to_panel() **********/
170
171 GLUI_EditText  *GLUI::add_edittext_to_panel( GLUI_Panel *panel, 
172                                              const char *name, 
173                                              int data_type, void *data,
174                                              int id, GLUI_CB callback)
175 {
176   return new GLUI_EditText( panel, name, data_type, data, id, callback );
177 }
178
179 /********************************** GLUI::add_edittext() ************/
180
181 GLUI_EditText  *GLUI::add_edittext( const char *name, 
182                                     GLUI_String & data,
183                                     int id, GLUI_CB callback)
184 {
185   return add_edittext_to_panel( main_panel, name, data, id, callback );
186 }
187
188
189 /******************************* GLUI::add_edittext_to_panel() **********/
190
191 GLUI_EditText*
192 GLUI::add_edittext_to_panel( GLUI_Panel *panel, const char *name, 
193                              GLUI_String& data,
194                              int id, GLUI_CB callback)
195 {
196   return new GLUI_EditText( panel, name, GLUI_EDITTEXT_STRING, &data, id, callback );
197 }
198
199 /********************************** GLUI::add_spinner() ************/
200
201 GLUI_Spinner  *GLUI::add_spinner( const char *name, 
202                                   int data_type, void *data,
203                                   int id, GLUI_CB callback)
204 {
205   return add_spinner_to_panel( main_panel, name, data_type, data,
206                                id, callback );
207 }
208
209
210 /******************************* GLUI::add_spinner_to_panel() **********/
211
212 GLUI_Spinner  *GLUI::add_spinner_to_panel( 
213   GLUI_Panel *panel, const char *name, 
214   int data_type, void *data,
215   int id, GLUI_CB callback
216 )
217 {
218   return new GLUI_Spinner( panel, name, data_type, data, id, callback );
219 }
220
221
222 /********************************** GLUI::add_column() ************/
223
224 void   GLUI::add_column( int draw_bar )
225 {
226   add_column_to_panel( main_panel, draw_bar );
227 }
228
229
230 /******************************* GLUI::add_column_to_panel() **********/
231
232 void   GLUI::add_column_to_panel( GLUI_Panel *panel, int draw_bar )
233 {
234   new GLUI_Column( panel, draw_bar );
235 }
236
237
238 /*********************************** GLUI:: add_listbox() ************/
239
240 GLUI_Listbox   *GLUI:: add_listbox( const char *name, int *value_ptr,
241                                     int id, GLUI_CB callback )
242 {
243   return add_listbox_to_panel( main_panel,
244                                name, value_ptr, id, callback );
245 }
246
247
248 /*********************************** GLUI:: add_listbox_to_panel() **********/
249
250 GLUI_Listbox   *GLUI::add_listbox_to_panel( GLUI_Panel *panel,
251                                             const char *name, int *value_ptr,
252                                             int id, 
253                                             GLUI_CB callback )
254 {
255   return new GLUI_Listbox( panel, name, value_ptr, id, callback );
256 }
257
258
259 /*********************************** GLUI:: add_rotation() ************/
260
261 GLUI_Rotation   *GLUI:: add_rotation( const char *name, float *value_ptr,
262                                       int id, GLUI_CB callback )
263 {
264   return add_rotation_to_panel( main_panel, name, value_ptr, id, callback );
265 }
266
267
268 /*********************************** GLUI:: add_rotation_to_panel() **********/
269
270 GLUI_Rotation *GLUI::add_rotation_to_panel( GLUI_Panel *panel,
271                                             const char *name, float *value_ptr,
272                                             int id, 
273                                             GLUI_CB callback )
274 {
275   return new GLUI_Rotation( panel, name, value_ptr, id, callback );
276 }
277
278
279 /*********************************** GLUI:: add_translation() ************/
280
281 GLUI_Translation *GLUI:: add_translation( const char *name, int trans_type,
282                                           float *value_ptr, int id, 
283                                           GLUI_CB callback )
284 {
285   return add_translation_to_panel( main_panel,name,trans_type, 
286                                    value_ptr, id, callback );
287 }
288
289
290 /*********************************** GLUI:: add_translation_to_panel() **********/
291
292 GLUI_Translation *GLUI::add_translation_to_panel( 
293   GLUI_Panel *panel, const char *name, 
294   int trans_type, float *value_ptr,
295   int id, GLUI_CB callback 
296   )
297 {
298   return new GLUI_Translation(panel, name, trans_type, value_ptr, id, callback);
299 }
300
301
302 /********************************** GLUI::add_rollout() **************/
303
304 GLUI_Rollout   *GLUI::add_rollout( const char *name, int open, int type)
305 {
306   return add_rollout_to_panel( main_panel, name, open, type);
307 }
308
309
310 /****************************** GLUI::add_rollout_to_panel() *********/
311
312 GLUI_Rollout *GLUI::add_rollout_to_panel(GLUI_Panel *panel, const char *name,
313                                          int open, int type)
314 {
315   return new GLUI_Rollout( panel, name, open, type );
316 }
317
318
319