Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2003:
[Freeciv-Dev] (PR#4422) Unit selection dialog width
Home

[Freeciv-Dev] (PR#4422) Unit selection dialog width

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4422) Unit selection dialog width
From: "mateusz stefek" <matusik_s@xxxxx>
Date: Tue, 17 Jun 2003 09:05:05 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Hi,

I was trying to increase NUM_SELECT_UNIT_COLS
from gui-gtk-2.0/dialogs.c
to remove the felling that the space on the right of the
unit selection dialog is wasted. (Try Polish or German localization)

And I noticed that the method which chooses unit's position in the 
table works correctly only with NUM_SELECT_UNIT_COLS = 4.
(You can find it at 1579th line of dialogs.c)

The problem is that number of rows is calculated to fill the table
row by row, but actually it's done column by column

For example:

n = 13
NUM_SELECT_UNIT_COLS = 6
=>
r = 3
=>
0369C
147A
258B   (this is the order of units in a table)

(Last 6th column isn't used)

See attached patch which changes NUM_SELECT_UNIT_COLS to 6
and corrects filling method.
--
mateusz
--- freeorig/client/gui-gtk-2.0/dialogs.c       2003-05-19 08:22:35.000000000 
+0200
+++ freeciv/client/gui-gtk-2.0/dialogs.c        2003-06-17 15:10:47.000000000 
+0200
@@ -77,7 +77,7 @@
 static int         sabotage_improvement;
 
 /******************************************************************/
-#define NUM_SELECT_UNIT_COLS 4
+#define NUM_SELECT_UNIT_COLS 6
 #define SELECT_UNIT_READY  1
 #define SELECT_UNIT_SENTRY 2
 
@@ -1576,8 +1576,10 @@
       gtk_container_add(GTK_CONTAINER(cmd), pix);
       gtk_table_attach_defaults(GTK_TABLE(unit_select_table),
                                 cmd,
-                               (i/r), (i/r)+1,
-                               (i%r), (i%r)+1);
+                               (i % NUM_SELECT_UNIT_COLS), 
+                               (i % NUM_SELECT_UNIT_COLS) + 1,
+                               (i / NUM_SELECT_UNIT_COLS),
+                               (i / NUM_SELECT_UNIT_COLS) + 1);
     }
 
     gtk_tooltips_disable(unit_select_tips);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4422) Unit selection dialog width, mateusz stefek <=