Commit e95f92e5 authored by Mike Wiering's avatar Mike Wiering
Browse files

Improved 256 color support

parent b87ceaf7
......@@ -823,6 +823,31 @@ EnumFontSizeProc (ENUMLOGFONT FAR * lpelf, /* pointer to logical-font data */
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
from the client/outer size to obtain the outer/client size.
......@@ -3419,6 +3444,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ProcessShortcutTable shortcuts;
ghTopDocWindow=NULL;
AdjustMenuBarName ();
shortcuts = (ProcessShortcutTable) GetWindowLong (hWin, 0); // get the local shortcut table
DestroyProcessShortcutTable (shortcuts); // and destroy it.
......@@ -3601,6 +3627,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ghActiveClientWindow = NULL;
gAcceleratorTableIsUpToDate = FALSE; // The active global accelerator table is not up to date
}
AdjustMenuBarName ();
return DefWindowProc (hWin, uMess, wPara, lPara);
}
break;
......@@ -3650,7 +3677,7 @@ SDIFrameProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
HWND_BOTTOM, /* this value is ignored (SWP_NOZORDER) */
0,0, /* these values are ignored (SWP_NOMOVE) */
(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)
DestroyLocalWindowData (wdata); // and destroy it.
ghTopDocWindow=NULL;
AdjustMenuBarName ();
return 0;
}
case WM_ENTERMENULOOP:
......@@ -3929,6 +3957,7 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ghActiveFrameWindow = NULL;
ghActiveClientWindow = NULL;
}
AdjustMenuBarName ();
return DefMDIChildProc (hWin, uMess, wPara, lPara);
}
break;
......@@ -4966,16 +4995,14 @@ HandleCleanRequest (CrossCallInfo * pcci)
}
break;
/* 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;
POINT clientDims, frameDims, winpos;
LPCTSTR pwintitle;
DWORD styleFlags;
RECT tbRect;
int tbHeight;
pwintitle = (LPCTSTR) pcci->p1;
hwndFrame = (HWND) pcci->p2;
winpos.x = pcci->p3>>16;
winpos.y = (pcci->p3<<16)>>16;
......@@ -5000,14 +5027,13 @@ HandleCleanRequest (CrossCallInfo * pcci)
/* Adjust the pos and size of the frame window. */
SetWindowPos (hwndFrame,NULL,winpos.x,winpos.y,frameDims.x,frameDims.y,SWP_NOZORDER);
UpdateWindow (hwndFrame);
SetWindowText (hwndFrame,pwintitle);
/* The client style flags are WS_CHILD and styleFlags. */
styleFlags |= WS_CHILD;
/* Create the new client window of the frame window. */
hwndClient = CreateWindow (SDIWindowClassName, /* Class name */
pwintitle, /* title */
NULL, /* No title */
styleFlags, /* SDI client style flags */
0, tbHeight, /* x, y */
clientDims.x,clientDims.y, /* width, height */
......@@ -5121,7 +5147,9 @@ HandleCleanRequest (CrossCallInfo * pcci)
break;
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);
}
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