Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2003:
[Freeciv-Dev] (PR#2810) [Fwd: select_city_style_modif.diff]
Home

[Freeciv-Dev] (PR#2810) [Fwd: select_city_style_modif.diff]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2810) [Fwd: select_city_style_modif.diff]
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 13 Jan 2003 06:30:13 -0800
Reply-to: rt@xxxxxxxxxxxxxx



-------- Original Message --------
Subject: [Freeciv-Dev] select_city_style_modif.diff
Date: Mon, 13 Jan 2003 14:29:40 +0100
From: Frédéric Rodrigo <f.rodrigo@xxxxxxxxxxxxx>
Reply-To: f.rodrigo@xxxxxxxxxxxxx
To: freeciv-dev@xxxxxxxxxxx

I have done a patch to add name of style of cities in gtk client and add
picture in the gtk-2.0 client. In order to patch 1.14.1-devel

Fred.


diff -ruN -Xfreeciv-cvs-Jan-08/diff_ignore 
freeciv-cvs-Jan-08/client/gui-gtk/dialogs.c 
freeciv-cvs-Jan-08_select_city_style_modif/client/gui-gtk/dialogs.c
--- freeciv-cvs-Jan-08/client/gui-gtk/dialogs.c 2003-01-02 05:55:13.000000000 
+0000
+++ freeciv-cvs-Jan-08_select_city_style_modif/client/gui-gtk/dialogs.c 
2003-01-11 17:46:18.000000000 +0000
@@ -2058,23 +2058,27 @@
   per_row /= 2;
  
   for(i = 0; i < b_s_num; i++) {
-    GtkWidget *box;
+    GtkWidget *box, *sub_box;
     SPRITE *s;
 
     city_style_toggles[i] = gtk_radio_button_new(cgroup);
-    box = gtk_hbox_new(FALSE, 0);
+    box = gtk_vbox_new(FALSE, 0);
     gtk_container_add(GTK_CONTAINER(city_style_toggles[i]), box);
+    gtk_box_pack_start(GTK_BOX(box), gtk_label_new( 
city_styles[city_style_idx[i]].name ),
+                       FALSE, FALSE, 4);
+    sub_box = gtk_hbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), sub_box);
     s = crop_blankspace(sprites.city.tile[i][0]);
-    gtk_box_pack_start(GTK_BOX(box), gtk_pixmap_new(s ->pixmap, s->mask),
+    gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s ->pixmap, s->mask),
                       FALSE, FALSE, 4);
     if ((s->width < 80) && (city_styles[i].tiles_num > 1)){
       s = crop_blankspace(sprites.city.tile[i][1]);
-      gtk_box_pack_start(GTK_BOX(box), gtk_pixmap_new(s->pixmap, s->mask),
+      gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s->pixmap, s->mask),
                         FALSE, FALSE, 4);
     }
     if ((s->width < 40) && (city_styles[i].tiles_num > 2)){
       s = crop_blankspace(sprites.city.tile[i][2]);
-      gtk_box_pack_start(GTK_BOX(box), gtk_pixmap_new(s->pixmap, s->mask),
+      gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s->pixmap, s->mask),
                         FALSE, FALSE, 4);
     }
 
@@ -2085,7 +2089,7 @@
                               city_style_toggles[i],
                               i%per_row, i%per_row+1, i/per_row, i/per_row+1);
   }
-  
+
   /* ------- OK/Disc/Quit buttons ------- */
 
   races_ok_command = gtk_button_new_with_label(_("Ok"));
diff -ruN -Xfreeciv-cvs-Jan-08/diff_ignore 
freeciv-cvs-Jan-08/client/gui-gtk-2.0/dialogs.c 
freeciv-cvs-Jan-08_select_city_style_modif/client/gui-gtk-2.0/dialogs.c
--- freeciv-cvs-Jan-08/client/gui-gtk-2.0/dialogs.c     2003-01-02 
05:55:14.000000000 +0000
+++ freeciv-cvs-Jan-08_select_city_style_modif/client/gui-gtk-2.0/dialogs.c     
2003-01-11 17:46:18.000000000 +0000
@@ -1963,23 +1963,46 @@
   city_style_toggles = fc_calloc( b_s_num, sizeof(struct GtkWidget*) );
 
   fa = gtk_frame_new( _("Select your city style") );
+  gtk_box_pack_start(GTK_BOX( GTK_DIALOG(races_dialog_shell)->vbox),
+                     fa, FALSE, FALSE, 0);
 
-  gtk_box_pack_start( GTK_BOX( GTK_DIALOG( races_dialog_shell )->vbox ),
-                      fa, FALSE, FALSE, 0 );
-  city_style_toggles_form =
-    gtk_table_new(((b_s_num-1)/2)+1, 2, TRUE );
-  gtk_container_add( GTK_CONTAINER( fa ), city_style_toggles_form ); 
-
-  for(i=0; i<b_s_num; i++) {
-      city_style_toggles[i] =
-       gtk_radio_button_new_with_label(cgroup,
-                                       city_styles[city_style_idx[i]].name);
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(city_style_toggles[i]),
-                                  FALSE);
-      cgroup = 
gtk_radio_button_get_group(GTK_RADIO_BUTTON(city_style_toggles[i]));
-      gtk_table_attach_defaults( GTK_TABLE(city_style_toggles_form),
-                                city_style_toggles[i],
-                                 i%2, i%2+1, i/2, i/2+1 );
+  city_style_toggles_form = gtk_table_new(per_row,
+                                          ((b_s_num-1) / per_row) + 1, FALSE);
+  gtk_container_add(GTK_CONTAINER(fa), city_style_toggles_form);
+
+  per_row /= 2;
+
+  for(i = 0; i < b_s_num; i++) {
+    GtkWidget *box, *sub_box;
+    SPRITE *s;
+
+    city_style_toggles[i] = gtk_radio_button_new(cgroup);
+    box = gtk_vbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(city_style_toggles[i]), box);
+    gtk_box_pack_start(GTK_BOX(box), gtk_label_new( 
city_styles[city_style_idx[i]].name ),
+                       FALSE, FALSE, 4);
+    sub_box = gtk_hbox_new(FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), sub_box);
+    s = crop_blankspace(sprites.city.tile[i][0]);
+    gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s ->pixmap, s->mask),
+                       FALSE, FALSE, 4);
+    if ((s->width < 80) && (city_styles[i].tiles_num > 1)){
+      s = crop_blankspace(sprites.city.tile[i][1]);
+      gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s->pixmap, s->mask),
+                         FALSE, FALSE, 4);
+    }
+    if ((s->width < 40) && (city_styles[i].tiles_num > 2)){
+      s = crop_blankspace(sprites.city.tile[i][2]);
+      gtk_box_pack_start(GTK_BOX(sub_box), gtk_pixmap_new(s->pixmap, s->mask),
+                         FALSE, FALSE, 4);
+    }
+
+    gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(city_style_toggles[i]),
+                                FALSE);
+    cgroup = gtk_radio_button_group(GTK_RADIO_BUTTON(city_style_toggles[i]));
+    gtk_table_attach_defaults( GTK_TABLE(city_style_toggles_form),
+                               city_style_toggles[i],
+                               i%per_row, i%per_row+1, i/per_row, i/per_row+1);
   }
 
   /* ------- Disc/Quit buttons ------- */


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2810) [Fwd: select_city_style_modif.diff], Jason Short via RT <=