Go to the documentation of this file.
12 #include <sys/types.h>
19 #include <gdk/gdkkeysyms.h>
28 GtkWidget *create_window_cuikmove(gpointer status)
46 double stepSize,pageSize;
47 unsigned int w,l,h,sh;
50 window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
52 for(i=0;i<c-> ndof;i++)
63 screen=gtk_window_get_screen(GTK_WINDOW(window));
64 sh=gdk_screen_get_height(screen);
65 if ((35+4)*(1+c-> ndof)>sh)
66 h=( unsigned int)(floor(( double)sh/( double)(1+c-> ndof)))-4;
69 gtk_widget_set_size_request(window,250+w*10,(h+4)*(1+c-> ndof));
70 gtk_container_border_width (GTK_CONTAINER(window),3);
71 gtk_window_set_title(GTK_WINDOW(window),_( "CuikMove"));
72 gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
74 GLADE_HOOKUP_OBJECT_NO_REF(window,window, "window");
76 g_signal_connect((gpointer)window, "destroy",
81 gtk_widget_show(table);
82 gtk_container_add(GTK_CONTAINER(window),table);
84 gtk_table_set_row_spacings(GTK_TABLE(table),2);
85 gtk_table_set_col_spacings(GTK_TABLE(table),2);
87 stepSize=1.0/pow(10,( double)c-> accuracy);
91 for(i=0;i<c-> ndof;i++)
96 label=gtk_label_new( string);
97 NEW(bstring,strlen( string)+20, char);
98 sprintf(bstring, "<b>%s</b>", string);
99 gtk_label_set_markup(GTK_LABEL(label),bstring);
100 gtk_table_attach_defaults(GTK_TABLE(table),label,0,1,i,i+1);
101 gtk_widget_show(label);
107 pageSize=0.01*(c-> max[i]-c-> min[i]);
108 hscale=gtk_hscale_new(GTK_ADJUSTMENT(gtk_adjustment_new(c-> dof[i],c-> min[i],
110 pageSize,10*stepSize)));
112 gtk_widget_show(hscale);
114 gtk_table_attach_defaults(GTK_TABLE(table),hscale,1,2,i,i+1);
116 gtk_widget_set_size_request(hscale,250,h);
117 gtk_scale_set_draw_value(GTK_SCALE(hscale), TRUE);
118 gtk_scale_set_digits(GTK_SCALE(hscale),c-> accuracy);
120 sprintf(name, "S%u",i);
121 gtk_widget_set_name(hscale,name);
123 g_signal_connect((gpointer)hscale, "value_changed",
127 GLADE_HOOKUP_OBJECT(window,hscale,name);
132 Save=gtk_button_new();
133 gtk_widget_show(Save);
135 gtk_table_attach_defaults(GTK_TABLE(table),Save,0,1,c-> ndof,c-> ndof+1);
137 alignment=gtk_alignment_new(0.5,0.5,0,0);
138 gtk_widget_show(alignment);
139 gtk_container_add(GTK_CONTAINER(Save),alignment);
141 hbox=gtk_hbox_new( FALSE,2);
142 gtk_widget_show(hbox);
143 gtk_container_add(GTK_CONTAINER(alignment),hbox);
145 image=gtk_image_new_from_stock( "gtk-save",GTK_ICON_SIZE_BUTTON);
146 gtk_widget_show(image);
147 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
149 label=gtk_label_new_with_mnemonic(_( "Save"));
150 gtk_widget_show(label);
151 gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE,0);
153 g_signal_connect((gpointer)Save, "clicked",
157 GLADE_HOOKUP_OBJECT(window,Save, "Save");
158 GLADE_HOOKUP_OBJECT(window,alignment, "alignment_save");
159 GLADE_HOOKUP_OBJECT(window,hbox, "hbox_save");
160 GLADE_HOOKUP_OBJECT(window,image, "image_save");
161 GLADE_HOOKUP_OBJECT(window,label, "label_save");
164 Quit=gtk_button_new();
165 gtk_widget_show(Quit);
167 gtk_table_attach_defaults(GTK_TABLE(table),Quit,1,2,c-> ndof,c-> ndof+1);
169 gtk_widget_set_size_request(Quit,70,31);
171 alignment=gtk_alignment_new(0.5,0.5,0,0);
172 gtk_widget_show(alignment);
173 gtk_container_add(GTK_CONTAINER(Quit),alignment);
175 hbox=gtk_hbox_new( FALSE,2);
176 gtk_widget_show(hbox);
177 gtk_container_add(GTK_CONTAINER(alignment),hbox);
179 image=gtk_image_new_from_stock( "gtk-quit",GTK_ICON_SIZE_BUTTON);
180 gtk_widget_show(image);
181 gtk_box_pack_start(GTK_BOX(hbox),image, FALSE, FALSE,0);
183 label=gtk_label_new_with_mnemonic(_( "Quit"));
184 gtk_widget_show(label);
185 gtk_box_pack_start(GTK_BOX(hbox),label, FALSE, FALSE,0);
187 g_signal_connect((gpointer)Quit, "clicked",
191 GLADE_HOOKUP_OBJECT(window,Quit, "Quit");
192 GLADE_HOOKUP_OBJECT(window,alignment, "alignment_quit");
193 GLADE_HOOKUP_OBJECT(window,hbox, "hbox_quit");
194 GLADE_HOOKUP_OBJECT(window,image, "image_quit");
195 GLADE_HOOKUP_OBJECT(window,label, "label_quit");
#define NEW(_var, _n, _type) Allocates memory space.
void on_cuikmove_quit(GtkButton *button, gpointer user_data) Callback function for the quit button.
Definition of the cuikmove control structure.
void GetWorldDOFLabel(unsigned int ndof, char **string, Tworld *w) Returns a label identifying each degree of freedom.
void on_cuikmove_slider_changed(GtkRange *range, gpointer user_data) Callback function for the slider bar.
Definition of the cuikmove control structure.
Headers of the GTK interface functions for cuikmove.
void GetWorldJointLabel(unsigned int ndof, char **string, Tworld *w) Returns a label identifying each joint.
void on_cuikmove_save(GtkButton *button, gpointer user_data) Callback function for the save button.
Headers of the GTK callback functions for cuikmove.
Headers of the GTK support functions for cuikplay.
|
Follow us!