Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs16:/tmp/cvs-serv11481/src

Modified Files:
	dashboard.c newwin.c redraw.c 
Log Message:
Fix assumption in STATSIZE and MESSAGESIZE defines that text is
only 10 pixels high.
Fixed text dashboard to work with increased font size.
New function DashMaxWidth() to take into account that dash may
need to be wider than tactical, if font size is sufficiently large.  Tested
against text dashboard only so far.

Index: redraw.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/redraw.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- redraw.c	6 Apr 2007 06:46:32 -0000	1.12
+++ redraw.c	13 Apr 2007 09:10:16 -0000	1.13
@@ -161,7 +161,7 @@
         oldbuf = buf1;
     }
     /* TIMER */
-    db_timer (flag, 428, 27);
+    db_timer (flag, 50 + 63 * W_Textwidth, 5 + 2 * W_Textheight + 2);
 
     light_erase();
 
@@ -323,7 +323,7 @@
     if (whichbuf == 0)
     {
         /* Draw status line */
-        W_WriteText (tstatw, 50, 16, textColor, buf, 64, W_RegularFont);
+        W_WriteText (tstatw, 50, 5 + W_Textheight + 1, textColor, buf, 64, W_RegularFont);
         whichbuf = 1;
     }
     else
@@ -351,7 +351,7 @@
                 j++;
                 if (j == 20)
                 {               /* Random number */
-                    W_WriteText (tstatw, 50 + W_Textwidth * k, 16, textColor,
+                    W_WriteText (tstatw, 50 + W_Textwidth * k, 5 + W_Textheight + 1, textColor,
                                  s, i - k - 19, W_RegularFont);
                     j = -1;
                 }
@@ -359,7 +359,7 @@
         }
         if (j != -1)
         {
-            W_WriteText (tstatw, 50 + W_Textwidth * k, 16, textColor, s,
+            W_WriteText (tstatw, 50 + W_Textwidth * k, 5 + W_Textheight + 1, textColor, s,
                          i - k - j, W_RegularFont);
         }
     }
@@ -453,5 +453,5 @@
                  troop_capacity,
                  me->p_ship.s_maxfuel, me->p_ship.s_maxwpntemp / 10,
                  me->p_ship.s_maxegntemp / 10);
-    W_WriteText (tstatw, 50, 27, textColor, buf, strlen (buf), W_RegularFont);
+    W_WriteText (tstatw, 50, 5 + 2 * W_Textheight + 2, textColor, buf, strlen (buf), W_RegularFont);
 }

Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- newwin.c	13 Apr 2007 07:52:41 -0000	1.62
+++ newwin.c	13 Apr 2007 09:10:16 -0000	1.63
@@ -45,8 +45,6 @@
 #define BOXSIDE         (TWINSIDE / 5)
 #define MENU_PAD 4
 #define TILESIDE        16
-#define MESSAGESIZE     20
-#define STATSIZE        (MESSAGESIZE * 2 + BORDER * 2)
 #define YOFF            0
 
 /* Local function prototypes */
@@ -817,10 +815,15 @@
 newwin (char *hostmon,
         char *progname)
 {
+    int MESSAGESIZE, STATSIZE;
     int i;
 
     W_Initialize (hostmon);
 
+    // We now know the font size
+    MESSAGESIZE = 2 * W_Textheight;
+    STATSIZE = (MESSAGESIZE * 2 + BORDER * 2);
+
     baseWin = W_MakeWindow ("netrek", 0, 0, 1024, 768, NULL, BORDER, gColor);
 
     w = W_MakeWindow ("local", 0, 0, TWINSIDE, TWINSIDE, baseWin, THICKBORDER, foreColor);
@@ -832,7 +835,7 @@
 
     mapSDB = W_InitSDB (mapw);
 
-    tstatw = W_MakeWindow ("tstat", 0, TWINSIDE + 2 * THICKBORDER, TWINSIDE + (2 * THICKBORDER - 2 * BORDER),
+    tstatw = W_MakeWindow ("tstat", 0, TWINSIDE + 2 * THICKBORDER, DashMaxWidth(),
                             STATSIZE, baseWin, BORDER, foreColor);
 
     W_SetWindowExposeHandler (tstatw, redrawTstats);

Index: dashboard.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/dashboard.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- dashboard.c	26 Mar 2007 04:40:52 -0000	1.20
+++ dashboard.c	13 Apr 2007 09:10:16 -0000	1.21
@@ -97,6 +97,16 @@
 }
 
 /******************************************************************************/
+/***  DashMaxWidth() - return width adjusted for text size (if font is      ***/
+/***  large), or if font is small, return the size of tactical window       ***/
+/******************************************************************************/
+int
+DashMaxWidth(void)
+{
+    return MAX(TWINSIDE + (2 * THICKBORDER - 2 * BORDER), 50 + 75 * W_Textwidth);
+}
+
+/******************************************************************************/
 /***  timerString()                                                         ***/
 /******************************************************************************/
 char *