1 /****************************************************************************
3 GLUI User Interface Toolkit (LGPL)
4 ---------------------------
6 glui_add_controls.cpp - Routines for adding controls to a GLUI window
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
12 --------------------------------------------------
14 Copyright (c) 1998 Paul Rademacher
16 WWW: http://sourceforge.net/projects/glui/
17 Forums: http://sourceforge.net/forum/?group_id=92496
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.
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.
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
33 *****************************************************************************/
36 #include "glui_internal.h"
39 /*********************************** GLUI:: add_checkbox() ************/
41 GLUI_Checkbox *GLUI:: add_checkbox( const char *name, int *value_ptr,
42 int id, GLUI_CB callback )
44 return add_checkbox_to_panel( main_panel,
45 name, value_ptr, id, callback );
49 /*********************************** GLUI:: add_checkbox_to_panel() **********/
51 GLUI_Checkbox *GLUI::add_checkbox_to_panel( GLUI_Panel *panel,
52 const char *name, int *value_ptr,
56 return new GLUI_Checkbox( panel, name, value_ptr, id, callback );
59 /********************************************* GLUI::add_panel() *************/
61 GLUI_Panel *GLUI::add_panel( const char *name, int type )
63 return add_panel_to_panel( main_panel, name, type );
67 /**************************************** GLUI::add_panel_to_panel() *********/
69 GLUI_Panel *GLUI::add_panel_to_panel( GLUI_Panel *parent_panel,
70 const char *name, int type )
72 return new GLUI_Panel( parent_panel, name, type );
76 /***************************** GLUI::add_radiogroup() ***************/
78 GLUI_RadioGroup *GLUI::add_radiogroup( int *value_ptr,
79 int user_id, GLUI_CB callback)
81 return add_radiogroup_to_panel( main_panel, value_ptr,
86 /***************************** GLUI::add_radiogroup_to_panel() ***************/
88 GLUI_RadioGroup *GLUI::add_radiogroup_to_panel(
89 GLUI_Panel *panel, int *value_ptr,
90 int user_id, GLUI_CB callback
93 return new GLUI_RadioGroup( panel, value_ptr, user_id, callback );
97 /***************************** GLUI::add_radiobutton_to_group() *************/
99 GLUI_RadioButton *GLUI::add_radiobutton_to_group( GLUI_RadioGroup *group,
102 return new GLUI_RadioButton( group, name );
106 /********************************** GLUI::add_statictext() ************/
108 GLUI_StaticText *GLUI::add_statictext( const char *name )
110 return add_statictext_to_panel( main_panel, name );
114 /******************************* GLUI::add_statictext_to_panel() **********/
116 GLUI_StaticText *GLUI::add_statictext_to_panel( GLUI_Panel *panel,
119 return new GLUI_StaticText( panel, name );
123 /***************************************** GLUI:: add_button() ************/
125 GLUI_Button *GLUI:: add_button( const char *name,
126 int id, GLUI_CB callback )
128 return add_button_to_panel( main_panel,
129 name, id, callback );
132 /*********************************** GLUI:: add_button_to_panel() **********/
134 GLUI_Button *GLUI::add_button_to_panel( GLUI_Panel *panel,
139 return new GLUI_Button( panel, name, id, callback );
142 /********************************** GLUI::add_separator() ************/
144 void GLUI::add_separator( void )
146 add_separator_to_panel( main_panel );
150 /******************************* GLUI::add_separator_to_panel() **********/
152 void GLUI::add_separator_to_panel( GLUI_Panel *panel )
154 new GLUI_Separator( panel );
158 /********************************** GLUI::add_edittext() ************/
160 GLUI_EditText *GLUI::add_edittext( const char *name,
161 int data_type, void *data,
162 int id, GLUI_CB callback)
164 return add_edittext_to_panel( main_panel, name, data_type, data,
169 /******************************* GLUI::add_edittext_to_panel() **********/
171 GLUI_EditText *GLUI::add_edittext_to_panel( GLUI_Panel *panel,
173 int data_type, void *data,
174 int id, GLUI_CB callback)
176 return new GLUI_EditText( panel, name, data_type, data, id, callback );
179 /********************************** GLUI::add_edittext() ************/
181 GLUI_EditText *GLUI::add_edittext( const char *name,
183 int id, GLUI_CB callback)
185 return add_edittext_to_panel( main_panel, name, data, id, callback );
189 /******************************* GLUI::add_edittext_to_panel() **********/
192 GLUI::add_edittext_to_panel( GLUI_Panel *panel, const char *name,
194 int id, GLUI_CB callback)
196 return new GLUI_EditText( panel, name, GLUI_EDITTEXT_STRING, &data, id, callback );
199 /********************************** GLUI::add_spinner() ************/
201 GLUI_Spinner *GLUI::add_spinner( const char *name,
202 int data_type, void *data,
203 int id, GLUI_CB callback)
205 return add_spinner_to_panel( main_panel, name, data_type, data,
210 /******************************* GLUI::add_spinner_to_panel() **********/
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
218 return new GLUI_Spinner( panel, name, data_type, data, id, callback );
222 /********************************** GLUI::add_column() ************/
224 void GLUI::add_column( int draw_bar )
226 add_column_to_panel( main_panel, draw_bar );
230 /******************************* GLUI::add_column_to_panel() **********/
232 void GLUI::add_column_to_panel( GLUI_Panel *panel, int draw_bar )
234 new GLUI_Column( panel, draw_bar );
238 /*********************************** GLUI:: add_listbox() ************/
240 GLUI_Listbox *GLUI:: add_listbox( const char *name, int *value_ptr,
241 int id, GLUI_CB callback )
243 return add_listbox_to_panel( main_panel,
244 name, value_ptr, id, callback );
248 /*********************************** GLUI:: add_listbox_to_panel() **********/
250 GLUI_Listbox *GLUI::add_listbox_to_panel( GLUI_Panel *panel,
251 const char *name, int *value_ptr,
255 return new GLUI_Listbox( panel, name, value_ptr, id, callback );
259 /*********************************** GLUI:: add_rotation() ************/
261 GLUI_Rotation *GLUI:: add_rotation( const char *name, float *value_ptr,
262 int id, GLUI_CB callback )
264 return add_rotation_to_panel( main_panel, name, value_ptr, id, callback );
268 /*********************************** GLUI:: add_rotation_to_panel() **********/
270 GLUI_Rotation *GLUI::add_rotation_to_panel( GLUI_Panel *panel,
271 const char *name, float *value_ptr,
275 return new GLUI_Rotation( panel, name, value_ptr, id, callback );
279 /*********************************** GLUI:: add_translation() ************/
281 GLUI_Translation *GLUI:: add_translation( const char *name, int trans_type,
282 float *value_ptr, int id,
285 return add_translation_to_panel( main_panel,name,trans_type,
286 value_ptr, id, callback );
290 /*********************************** GLUI:: add_translation_to_panel() **********/
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
298 return new GLUI_Translation(panel, name, trans_type, value_ptr, id, callback);
302 /********************************** GLUI::add_rollout() **************/
304 GLUI_Rollout *GLUI::add_rollout( const char *name, int open, int type)
306 return add_rollout_to_panel( main_panel, name, open, type);
310 /****************************** GLUI::add_rollout_to_panel() *********/
312 GLUI_Rollout *GLUI::add_rollout_to_panel(GLUI_Panel *panel, const char *name,
315 return new GLUI_Rollout( panel, name, open, type );