Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28263/src

Modified Files:
	data.c defaults.c mswindow.c 
Log Message:
Added a disabled richText option.  Disabled cause it's buggy in
several respects.  Requires a windows guru to fix, I've tried several
times to fix it completely.  Main issues are scrolling (all richtext windows
seem to have an extra blank line at the end) and keyboard actions
over message windows (messaging is broken with cursor in message
windows).  Also the order of loading defaults and window creation do
not allow the option to be set as a netrekrc option at this time.
I did manage to fix the problem with keyboard input being locked out
upon the cursor entering a richtext window.  URL support and cut/paste
out of richtext message windows does work.

Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- mswindow.c	19 Mar 2007 09:25:17 -0000	1.50
+++ mswindow.c	19 Mar 2007 19:59:43 -0000	1.51
@@ -2290,8 +2290,12 @@
 
     case WM_MOUSEMOVE:
         GET_STRUCT_PTR;
-        /*if (win->hwnd != GetFocus ())
-            SetFocus (win->hwnd);*/
+        if (richText) /* Richtext windows set focus, we need to get it back
+                         if mouse moves out of the window */
+        {
+            if (win->hwnd != GetFocus ())
+                SetFocus (win->hwnd);
+        }
         SetCursor (win->cursor);
 
 #if defined(MOTION_MOUSE) || defined(XTRA_MESSAGE_UI)
@@ -2758,31 +2762,31 @@
         GET_STRUCT_PTR;
 
         // If we're not in message windows then we'll map wheel up and
-		// wheel down events as regular mouse events
+        // wheel down events as regular mouse events
         if (win->type == WIN_GRAPH || win->type == WIN_TEXT || win->type == WIN_MENU)
-		{
-	        //BringWindowToTop (hwnd);
-			//GET_STRUCT_PTR;
+        {
+            //BringWindowToTop (hwnd);
+            //GET_STRUCT_PTR;
 
             /* Let's see whether we should process wheel messages */
             if (!allowWheelActions)
                 return (1);
 
-			STORE_EVENT_MOUSE;
-			LastPressHwnd = hwnd;
+            STORE_EVENT_MOUSE;
+            LastPressHwnd = hwnd;
 
-			if (wheel > 0)
-			{
-				EventQueue[EventTail].key = W_WHEELUP;
-				EventQueue[EventTail].type = W_EV_BUTTON;
-			}
-			else if (wheel < 0)
-			{
-				EventQueue[EventTail].key = W_WHEELDOWN;
-				EventQueue[EventTail].type = W_EV_BUTTON;
-			}
+            if (wheel > 0)
+            {
+                EventQueue[EventTail].key = W_WHEELUP;
+                EventQueue[EventTail].type = W_EV_BUTTON;
+            }
+            else if (wheel < 0)
+            {
+                EventQueue[EventTail].key = W_WHEELDOWN;
+                EventQueue[EventTail].type = W_EV_BUTTON;
+            }
             return (0);
-		}
+        }
         else if (win->type == WIN_SCROLL)
         {
             i = GetScrollPos (hwnd, SB_VERT);
@@ -2814,7 +2818,7 @@
             SendMessage (win->hwnd, EM_GETRECT, 0, (LPARAM) &r);
             visline = SendMessage (win->hwnd, EM_GETFIRSTVISIBLELINE, 0, 0);
             lines = SendMessage (win->hwnd, EM_GETLINECOUNT, 0, 0);
-
+            //LineToConsole("%d visline, %d total lines\n", visline, lines);
             maxscroll = ((lines - visline) - (r.bottom / W_Textheight)) * W_Textheight;
 
             switch (wheel)
@@ -5875,9 +5879,8 @@
         W_ChangeBorder ((W_Window) win, W_White);
         break;*/
 
-/*    case WM_KEYDOWN:
-        LineToConsole ("key down\n");
-        return (0);*/
+    case WM_KEYDOWN:
+        return (0);
     case WM_LBUTTONDOWN:
         BringWindowToTop (hwnd);
         break;

Index: defaults.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- defaults.c	19 Mar 2007 04:33:51 -0000	1.61
+++ defaults.c	19 Mar 2007 19:59:43 -0000	1.62
@@ -527,6 +527,12 @@
             NULL
         }
     },
+    {"richText", &richText, RC_BOOL,
+        {
+            "Use rich text message windows, currently disabled",
+            NULL
+        }
+    },
     {"rotatePlanets", &rotatePlanets, RC_BOOL,
         {
             "Rotate planets (only works with new planet bitmaps)",
@@ -1616,6 +1622,7 @@
 
     doubleBuffering = booleanDefault ("doubleBuffering", doubleBuffering);
     allowWheelActions = booleanDefault ("allowWheelActions", allowWheelActions);
+    //richText = booleanDefault ("richText", richText);
     newQuit = booleanDefault ("newQuit", newQuit);
     newTeams = booleanDefault ("newTeams", newTeams);
     soundVolume= intDefault ("soundVolume", soundVolume);

Index: data.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- data.c	19 Mar 2007 04:33:50 -0000	1.69
+++ data.c	19 Mar 2007 19:59:43 -0000	1.70
@@ -801,7 +801,7 @@
 
 WNDPROC lpfnDefRichEditWndProc;     /* default window proc */
 
-int richText = 0;   		/* temporary variable to select rich text message windows */
+int richText = 0;   		/* rich text message windows */
 int newQuit = 0;    		/* new quit clock */
 int newTeams = 0;		/* new team windows */
 int soundVolume = 64;		/* Starting sound volume (0-128 range) */