]> err.no Git - mapper/commitdiff
MapWidget: - Add rotate testing to widget test application
authorKaj-Michael Lang <milang@tal.org>
Sat, 17 May 2008 15:57:25 +0000 (18:57 +0300)
committerKaj-Michael Lang <milang@tal.org>
Sat, 17 May 2008 15:57:25 +0000 (18:57 +0300)
src/map-widget-test.c

index 9d02ccbba8a9c97de2a1d2b7b83a13a050a6121c..0f7725f00ce75d264882aa34d3d135f3e88adab3 100644 (file)
@@ -15,6 +15,13 @@ gtk_map_set_zoom(map, (gint)gtk_range_get_value(widget));
 return TRUE;
 }
 
+static gboolean
+map_rotate(GtkWidget *widget, gpointer data)
+{
+gtk_map_rotate(map, gtk_range_get_value(widget));
+return TRUE;
+}
+
 static void
 map_zoom_changed(GtkWidget *widget, gint zoom, gpointer data)
 {
@@ -57,6 +64,7 @@ main (int argc, char **args)
 {
 GtkDialog *dialog;
 GtkWidget *hbox, *zoomer, *btn_left, *btn_right, *btn_up, *btn_down, *vbox;
+GtkWidget *rotate;
 RepoData *rd;
 
 gtk_init (&argc, &args);
@@ -81,6 +89,8 @@ gtk_box_pack_start(GTK_BOX(hbox), map, TRUE, TRUE, 0);
 zoomer=gtk_vscale_new_with_range(0,17,1);
 gtk_box_pack_start(GTK_BOX(hbox), zoomer, FALSE, FALSE, 0);
 
+rotate=gtk_hscale_new_with_range(0,360,1);
+
 btn_left=gtk_button_new_with_label("L");
 btn_right=gtk_button_new_with_label("R");
 btn_up=gtk_button_new_with_label("U");
@@ -93,8 +103,10 @@ gtk_box_pack_start(GTK_BOX(vbox), btn_down, FALSE, FALSE, 0);
 
 gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
 gtk_box_pack_start(GTK_BOX(dialog->vbox), hbox, TRUE, TRUE, 0);
+gtk_box_pack_start(GTK_BOX(dialog->vbox), rotate, FALSE, FALSE, 0);
 
 g_signal_connect(G_OBJECT(zoomer), "value-changed", G_CALLBACK(map_zoom), NULL);
+g_signal_connect(G_OBJECT(rotate), "value-changed", G_CALLBACK(map_rotate), NULL);
 g_signal_connect(G_OBJECT(map), "zoom-changed", G_CALLBACK(map_zoom_changed), zoomer);
 
 g_signal_connect(G_OBJECT(btn_up), "clicked", G_CALLBACK(map_pan_up), NULL);