Commit 6dc6f731 authored by Mike Wiering's avatar Mike Wiering
Browse files

Improved 256 color support

parent de161c0c
...@@ -823,6 +823,31 @@ EnumFontSizeProc (ENUMLOGFONT FAR * lpelf, /* pointer to logical-font data */ ...@@ -823,6 +823,31 @@ EnumFontSizeProc (ENUMLOGFONT FAR * lpelf, /* pointer to logical-font data */
return 1; return 1;
} }
static void
AdjustMenuBarName (void)
{
/* PA: previous version did not set the frame window title.
Appending the topDocWindow title should be done by the MDI interface.
char apptitle[70];
char wintitle[32];
if (ghTopDocWindow != NULL)
{
GetWindowText (ghTopDocWindow, wintitle, 31);
wsprintf (apptitle, "%s - [%s]", gAppName, wintitle);
SetWindowText (ghActiveFrameWindow, apptitle);
}
else
{
SetWindowText (ghMainWindow, gAppName);
}
*/
if (ghActiveFrameWindow != NULL)
{
SetWindowText (ghActiveFrameWindow, gAppName);
}
}
/* Win(M/S)DIClientToOuterSizeDims returns the width and height needed to add/subtract /* Win(M/S)DIClientToOuterSizeDims returns the width and height needed to add/subtract
from the client/outer size to obtain the outer/client size. from the client/outer size to obtain the outer/client size.
...@@ -3419,6 +3444,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara) ...@@ -3419,6 +3444,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ProcessShortcutTable shortcuts; ProcessShortcutTable shortcuts;
ghTopDocWindow=NULL; ghTopDocWindow=NULL;
AdjustMenuBarName ();
shortcuts = (ProcessShortcutTable) GetWindowLong (hWin, 0); // get the local shortcut table shortcuts = (ProcessShortcutTable) GetWindowLong (hWin, 0); // get the local shortcut table
DestroyProcessShortcutTable (shortcuts); // and destroy it. DestroyProcessShortcutTable (shortcuts); // and destroy it.
...@@ -3601,6 +3627,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara) ...@@ -3601,6 +3627,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ghActiveClientWindow = NULL; ghActiveClientWindow = NULL;
gAcceleratorTableIsUpToDate = FALSE; // The active global accelerator table is not up to date gAcceleratorTableIsUpToDate = FALSE; // The active global accelerator table is not up to date
} }
AdjustMenuBarName ();
return DefWindowProc (hWin, uMess, wPara, lPara); return DefWindowProc (hWin, uMess, wPara, lPara);
} }
break; break;
...@@ -3650,7 +3677,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara) ...@@ -3650,7 +3677,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
HWND_BOTTOM, /* this value is ignored (SWP_NOZORDER) */ HWND_BOTTOM, /* this value is ignored (SWP_NOZORDER) */
0,0, /* these values are ignored (SWP_NOMOVE) */ 0,0, /* these values are ignored (SWP_NOMOVE) */
(int)LOWORD (lPara),(int)HIWORD (lPara)-toolbarHeight, /* new width and height */ (int)LOWORD (lPara),(int)HIWORD (lPara)-toolbarHeight, /* new width and height */
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW
); );
} }
} }
...@@ -3770,6 +3797,7 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara) ...@@ -3770,6 +3797,7 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
DestroyLocalWindowData (wdata); // and destroy it. DestroyLocalWindowData (wdata); // and destroy it.
ghTopDocWindow=NULL; ghTopDocWindow=NULL;
AdjustMenuBarName ();
return 0; return 0;
} }
case WM_ENTERMENULOOP: case WM_ENTERMENULOOP:
...@@ -3929,6 +3957,7 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara) ...@@ -3929,6 +3957,7 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ghActiveFrameWindow = NULL; ghActiveFrameWindow = NULL;
ghActiveClientWindow = NULL; ghActiveClientWindow = NULL;
} }
AdjustMenuBarName ();
return DefMDIChildProc (hWin, uMess, wPara, lPara); return DefMDIChildProc (hWin, uMess, wPara, lPara);
} }
break; break;
...@@ -4966,16 +4995,14 @@ HandleCleanRequest (CrossCallInfo * pcci) ...@@ -4966,16 +4995,14 @@ HandleCleanRequest (CrossCallInfo * pcci)
} }
break; break;
/* Create a SDI document window. */ /* Create a SDI document window. */
case CcRqCREATESDIDOCWINDOW: /* textptr, frameptr, packed pos, w,h, flags; client ptr result. */ case CcRqCREATESDIDOCWINDOW: /* not used, frameptr, packed pos, w,h, flags; client ptr result. */
{ {
HWND hwndFrame, hwndClient, hwndToolbar; HWND hwndFrame, hwndClient, hwndToolbar;
POINT clientDims, frameDims, winpos; POINT clientDims, frameDims, winpos;
LPCTSTR pwintitle;
DWORD styleFlags; DWORD styleFlags;
RECT tbRect; RECT tbRect;
int tbHeight; int tbHeight;
pwintitle = (LPCTSTR) pcci->p1;
hwndFrame = (HWND) pcci->p2; hwndFrame = (HWND) pcci->p2;
winpos.x = pcci->p3>>16; winpos.x = pcci->p3>>16;
winpos.y = (pcci->p3<<16)>>16; winpos.y = (pcci->p3<<16)>>16;
...@@ -5000,14 +5027,13 @@ HandleCleanRequest (CrossCallInfo * pcci) ...@@ -5000,14 +5027,13 @@ HandleCleanRequest (CrossCallInfo * pcci)
/* Adjust the pos and size of the frame window. */ /* Adjust the pos and size of the frame window. */
SetWindowPos (hwndFrame,NULL,winpos.x,winpos.y,frameDims.x,frameDims.y,SWP_NOZORDER); SetWindowPos (hwndFrame,NULL,winpos.x,winpos.y,frameDims.x,frameDims.y,SWP_NOZORDER);
UpdateWindow (hwndFrame); UpdateWindow (hwndFrame);
SetWindowText (hwndFrame,pwintitle);
/* The client style flags are WS_CHILD and styleFlags. */ /* The client style flags are WS_CHILD and styleFlags. */
styleFlags |= WS_CHILD; styleFlags |= WS_CHILD;
/* Create the new client window of the frame window. */ /* Create the new client window of the frame window. */
hwndClient = CreateWindow (SDIWindowClassName, /* Class name */ hwndClient = CreateWindow (SDIWindowClassName, /* Class name */
pwintitle, /* title */ NULL, /* No title */
styleFlags, /* SDI client style flags */ styleFlags, /* SDI client style flags */
0, tbHeight, /* x, y */ 0, tbHeight, /* x, y */
clientDims.x,clientDims.y, /* width, height */ clientDims.x,clientDims.y, /* width, height */
...@@ -5121,7 +5147,9 @@ HandleCleanRequest (CrossCallInfo * pcci) ...@@ -5121,7 +5147,9 @@ HandleCleanRequest (CrossCallInfo * pcci)
break; break;
case CcRqSETWINDOWTITLE: /* hwnd, textptr no result. */ case CcRqSETWINDOWTITLE: /* hwnd, textptr no result. */
{ {
SetWindowText ((HWND) pcci->p1, (LPCTSTR) pcci->p2); rprintf ("SWT: handle = %d, text = \"%s\"\n", (HWND) pcci->p1, (char *) pcci->p2);
SetWindowText ((HWND) pcci->p1, (char *) pcci->p2);
AdjustMenuBarName ();
MakeReturn0Cci (pcci); MakeReturn0Cci (pcci);
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment