Go to the documentation of this file.
12 #include <sys/types.h>
19 #include <gdk/gdkkeysyms.h>
29 GtkWidget *create_window_cuikexplore(gpointer status)
54 window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
57 gtk_widget_set_size_request(window,500,(h+4)*(1+c-> k));
58 gtk_container_border_width (GTK_CONTAINER(window),3);
59 gtk_window_set_title(GTK_WINDOW(window),_( "Cuikexplore"));
60 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
62 GLADE_HOOKUP_OBJECT_NO_REF(window,window, "window");
64 g_signal_connect((gpointer)window, "destroy",
68 table=gtk_table_new(c-> k+1,5, FALSE);
69 gtk_widget_show(table);
70 gtk_container_add(GTK_CONTAINER(window),table);
72 gtk_table_set_row_spacings(GTK_TABLE(table),2);
73 gtk_table_set_col_spacings(GTK_TABLE(table),2);
79 down=gtk_button_new();
80 gtk_widget_show(down);
82 gtk_table_attach_defaults(GTK_TABLE(table),down,0,1,i,i+1);
84 gtk_widget_set_size_request(down,50,31);
86 gtk_widget_set_tooltip_text(down, "Fast backward (while pressed)");
88 sprintf(name, "D%u",i);
89 gtk_widget_set_name(down,name);
91 alignment=gtk_alignment_new(0.5,0.5,0,0);
92 gtk_widget_show(alignment);
93 gtk_container_add(GTK_CONTAINER(down),alignment);
95 hbox=gtk_hbox_new( FALSE,2);
96 gtk_widget_show(hbox);
97 gtk_container_add(GTK_CONTAINER(alignment),hbox);
100 image=gtk_image_new_from_stock( "gtk-media-rewind",GTK_ICON_SIZE_BUTTON);
101 gtk_widget_show(image);
102 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
104 g_signal_connect((gpointer)down, "pressed",
107 g_signal_connect((gpointer)down, "released",
112 GLADE_HOOKUP_OBJECT(window,down,name);
113 sprintf(name, "AD%u",i);GLADE_HOOKUP_OBJECT(window,alignment,name);
114 sprintf(name, "BD%u",i);GLADE_HOOKUP_OBJECT(window,hbox,name);
115 sprintf(name, "ID%u",i);GLADE_HOOKUP_OBJECT(window,image,name);
118 minus=gtk_button_new();
119 gtk_widget_show(minus);
121 gtk_table_attach_defaults(GTK_TABLE(table),minus,1,2,i,i+1);
123 gtk_widget_set_size_request(minus,50,31);
125 gtk_widget_set_tooltip_text(minus, "One step backward");
127 sprintf(name, "M%u",i);
128 gtk_widget_set_name(minus,name);
130 alignment=gtk_alignment_new(0.5,0.5,0,0);
131 gtk_widget_show(alignment);
132 gtk_container_add(GTK_CONTAINER(minus),alignment);
134 hbox=gtk_hbox_new( FALSE,2);
135 gtk_widget_show(hbox);
136 gtk_container_add(GTK_CONTAINER(alignment),hbox);
139 image=gtk_image_new_from_stock( "gtk-media-previous",GTK_ICON_SIZE_BUTTON);
140 gtk_widget_show(image);
141 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
143 g_signal_connect((gpointer)minus, "clicked",
147 GLADE_HOOKUP_OBJECT(window,minus,name);
148 sprintf(name, "AM%u",i);GLADE_HOOKUP_OBJECT(window,alignment,name);
149 sprintf(name, "BM%u",i);GLADE_HOOKUP_OBJECT(window,hbox,name);
150 sprintf(name, "IM%u",i);GLADE_HOOKUP_OBJECT(window,image,name);
155 menu=gtk_combo_box_new_text();
157 gtk_table_attach_defaults(GTK_TABLE(table),menu,2,3,i,i+1);
159 gtk_widget_set_size_request(menu,150,31);
161 gtk_widget_set_tooltip_text(menu, "Select a (not yet selected) parameter");
163 sprintf(name, "O%u",i);
164 gtk_widget_set_name(menu,name);
172 Error( "A dof without a name?");
175 gtk_combo_box_append_text(GTK_COMBO_BOX(menu), string);
179 fprintf(stderr, "Setting menu %u to entry %u [%u][%u]**************\n",i,c-> d2e[c-> ndx[i]],c-> ndx[i],i);
180 gtk_combo_box_set_active(GTK_COMBO_BOX(menu),c-> d2e[c-> ndx[i]]);
182 gtk_widget_show(menu);
184 g_signal_connect((gpointer)menu, "changed",
188 GLADE_HOOKUP_OBJECT(window,menu,name);
191 plus=gtk_button_new();
192 gtk_widget_show(plus);
194 gtk_table_attach_defaults(GTK_TABLE(table),plus,3,4,i,i+1);
196 gtk_widget_set_size_request(plus,50,31);
198 gtk_widget_set_tooltip_text(plus, "One step forward");
200 sprintf(name, "P%u",i);
201 gtk_widget_set_name(plus,name);
203 alignment=gtk_alignment_new(0.5,0.5,0,0);
204 gtk_widget_show(alignment);
205 gtk_container_add(GTK_CONTAINER(plus),alignment);
207 hbox=gtk_hbox_new( FALSE,2);
208 gtk_widget_show(hbox);
209 gtk_container_add(GTK_CONTAINER(alignment),hbox);
212 image=gtk_image_new_from_stock( "gtk-media-next",GTK_ICON_SIZE_BUTTON);
213 gtk_widget_show(image);
214 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
216 g_signal_connect((gpointer)plus, "clicked",
220 GLADE_HOOKUP_OBJECT(window,plus,name);
221 sprintf(name, "AP%u",i);GLADE_HOOKUP_OBJECT(window,alignment,name);
222 sprintf(name, "BP%u",i);GLADE_HOOKUP_OBJECT(window,hbox,name);
223 sprintf(name, "IP%u",i);GLADE_HOOKUP_OBJECT(window,image,name);
229 gtk_table_attach_defaults(GTK_TABLE(table),up,4,5,i,i+1);
231 gtk_widget_set_size_request(up,50,31);
233 gtk_widget_set_tooltip_text(up, "Fast forward (while pressed)");
235 sprintf(name, "U%u",i);
236 gtk_widget_set_name(up,name);
238 alignment=gtk_alignment_new(0.5,0.5,0,0);
239 gtk_widget_show(alignment);
240 gtk_container_add(GTK_CONTAINER(up),alignment);
242 hbox=gtk_hbox_new( FALSE,2);
243 gtk_widget_show(hbox);
244 gtk_container_add(GTK_CONTAINER(alignment),hbox);
247 image=gtk_image_new_from_stock( "gtk-media-forward",GTK_ICON_SIZE_BUTTON);
248 gtk_widget_show(image);
249 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
251 g_signal_connect((gpointer)up, "pressed",
254 g_signal_connect((gpointer)up, "released",
258 GLADE_HOOKUP_OBJECT(window,up,name);
259 sprintf(name, "AU%u",i);GLADE_HOOKUP_OBJECT(window,alignment,name);
260 sprintf(name, "BU%u",i);GLADE_HOOKUP_OBJECT(window,hbox,name);
261 sprintf(name, "IU%u",i);GLADE_HOOKUP_OBJECT(window,image,name);
266 Save=gtk_button_new();
267 gtk_widget_show(Save);
269 gtk_table_attach_defaults(GTK_TABLE(table),Save,0,1,c-> k,c-> k+1);
271 gtk_widget_set_size_request(Save,50,31);
273 gtk_widget_set_tooltip_text(Save, "Save the current configuration");
275 alignment=gtk_alignment_new(0.5,0.5,0,0);
276 gtk_widget_show(alignment);
277 gtk_container_add(GTK_CONTAINER(Save),alignment);
279 hbox=gtk_hbox_new( FALSE,2);
280 gtk_widget_show(hbox);
281 gtk_container_add(GTK_CONTAINER(alignment),hbox);
283 image=gtk_image_new_from_stock( "gtk-save",GTK_ICON_SIZE_BUTTON);
284 gtk_widget_show(image);
285 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
287 label=gtk_label_new_with_mnemonic(_( "Save"));
288 gtk_widget_show(label);
289 gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE,0);
291 g_signal_connect((gpointer)Save, "clicked",
295 GLADE_HOOKUP_OBJECT(window,Save, "Save");
296 GLADE_HOOKUP_OBJECT(window,alignment, "alignment_save");
297 GLADE_HOOKUP_OBJECT(window,hbox, "hbox_save");
298 GLADE_HOOKUP_OBJECT(window,image, "image_save");
299 GLADE_HOOKUP_OBJECT(window,label, "label_save");
302 label=gtk_label_new( "Step size:");
303 gtk_label_set_text(GTK_LABEL(label), "Step size:");
304 gtk_table_attach_defaults(GTK_TABLE(table),label,1,2,c-> k,c-> k+1);
305 gtk_widget_show(label);
307 entry=gtk_entry_new();
309 gtk_table_attach_defaults(GTK_TABLE(table),entry,2,3,c-> k,c-> k+1);
311 gtk_widget_set_size_request(entry,50,31);
313 gtk_widget_set_tooltip_text(entry, "Set the motion step");
315 sprintf(name, "%g",c-> step);
316 gtk_entry_set_text(GTK_ENTRY(entry),name);
317 gtk_widget_show(entry);
319 g_signal_connect((gpointer)entry, "activate",
323 GLADE_HOOKUP_OBJECT(window,entry, "Entry");
324 GLADE_HOOKUP_OBJECT(window,label, "label_entry");
327 reset=gtk_button_new();
328 gtk_widget_show(reset);
330 gtk_table_attach_defaults(GTK_TABLE(table),reset,3,4,c-> k,c-> k+1);
332 gtk_widget_set_size_request(reset,50,31);
334 gtk_widget_set_tooltip_text(reset, "Reset to the initial position");
336 alignment=gtk_alignment_new(0.5,0.5,0,0);
337 gtk_widget_show(alignment);
338 gtk_container_add(GTK_CONTAINER(reset),alignment);
340 hbox=gtk_hbox_new( FALSE,2);
341 gtk_widget_show(hbox);
342 gtk_container_add(GTK_CONTAINER(alignment),hbox);
344 image=gtk_image_new_from_stock( "gtk-refresh",GTK_ICON_SIZE_BUTTON);
345 gtk_widget_show(image);
346 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
348 label=gtk_label_new_with_mnemonic(_( "reset"));
349 gtk_widget_show(label);
350 gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE,0);
352 g_signal_connect((gpointer)reset, "clicked",
356 GLADE_HOOKUP_OBJECT(window,reset, "reset");
357 GLADE_HOOKUP_OBJECT(window,alignment, "alignment_reset");
358 GLADE_HOOKUP_OBJECT(window,hbox, "hbox_reset");
359 GLADE_HOOKUP_OBJECT(window,image, "image_reset");
360 GLADE_HOOKUP_OBJECT(window,label, "label_reset");
363 Quit=gtk_button_new();
364 gtk_widget_show(Quit);
366 gtk_table_attach_defaults(GTK_TABLE(table),Quit,4,5,c-> k,c-> k+1);
368 gtk_widget_set_size_request(Quit,50,31);
370 gtk_widget_set_tooltip_text(Quit, "Exit cuikexplore");
372 alignment=gtk_alignment_new(0.5,0.5,0,0);
373 gtk_widget_show(alignment);
374 gtk_container_add(GTK_CONTAINER(Quit),alignment);
376 hbox=gtk_hbox_new( FALSE,2);
377 gtk_widget_show(hbox);
378 gtk_container_add(GTK_CONTAINER(alignment),hbox);
380 image=gtk_image_new_from_stock( "gtk-quit",GTK_ICON_SIZE_BUTTON);
381 gtk_widget_show(image);
382 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
384 label=gtk_label_new_with_mnemonic(_( "Quit"));
385 gtk_widget_show(label);
386 gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE,0);
388 g_signal_connect((gpointer)Quit, "clicked",
392 GLADE_HOOKUP_OBJECT(window,Quit, "Quit");
393 GLADE_HOOKUP_OBJECT(window,alignment, "alignment_quit");
394 GLADE_HOOKUP_OBJECT(window,hbox, "hbox_quit");
395 GLADE_HOOKUP_OBJECT(window,image, "image_quit");
396 GLADE_HOOKUP_OBJECT(window,label, "label_quit");
void on_cuikexplore_down_pressed(GtkButton *button, gpointer user_data) Callback function for the minus buttons.
#define GET_WORLD(wcs) Returns the world from an TAtlasBase.
Headers of the GTK callback functions for cuikexplore.
void GetWorldDOFLabel(unsigned int ndof, char **string, Tworld *w) Returns a label identifying each degree of freedom.
void Error(const char *s) General error function.
void on_cuikexplore_minus_clicked(GtkButton *button, gpointer user_data) Callback function for the plus buttons.
void on_cuikexplore_down_released(GtkButton *button, gpointer user_data) Callback function for the plus buttons.
Definition of the cuikexplore control structure.
void on_cuikexplore_reset(GtkButton *button, gpointer user_data) Callback function for the reset button.
void on_cuikexplore_menu_changed(GtkComboBox *menu, gpointer user_data) Callback function for the menus.
void on_cuikexplore_plus_clicked(GtkButton *button, gpointer user_data) Callback function for the plus buttons.
Definition of a local chart on a manifold.
void on_cuikexplore_save(GtkButton *button, gpointer user_data) Callback function for the save button.
void on_cuikexplore_quit(GtkButton *button, gpointer user_data) Callback function for the quit button.
#define NO_UINT Used to denote an identifier that has not been initialized.
void on_cuikexplore_step_changed(GtkEntry *entry, gpointer user_data) Callback function for the step entry.
Definition of the cuikexplore control structure.
void on_cuikexplore_up_released(GtkButton *button, gpointer user_data) Callback function for the plus buttons.
void on_cuikexplore_up_pressed(GtkButton *button, gpointer user_data) Callback function for the plus buttons.
Headers of the GTK interface functions for cuikexplore.
Headers of the GTK support functions for cuikplay.
|
Follow us!