Commit aa501123 authored by Peter Achten's avatar Peter Achten
Browse files

(PA) title of window in SDI frame is now displayed.

parent a0dc411c
......@@ -823,31 +823,6 @@ 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.
......@@ -3444,7 +3419,6 @@ 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.
......@@ -3627,7 +3601,6 @@ 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;
......@@ -3797,7 +3770,6 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
DestroyLocalWindowData (wdata); // and destroy it.
ghTopDocWindow=NULL;
AdjustMenuBarName ();
return 0;
}
case WM_ENTERMENULOOP:
......@@ -3957,7 +3929,6 @@ MDIWindowProcedure (HWND hWin,UINT uMess,WPARAM wPara,LPARAM lPara)
ghActiveFrameWindow = NULL;
ghActiveClientWindow = NULL;
}
AdjustMenuBarName ();
return DefMDIChildProc (hWin, uMess, wPara, lPara);
}
break;
......@@ -4995,14 +4966,16 @@ HandleCleanRequest (CrossCallInfo * pcci)
}
break;
/* Create a SDI document window. */
case CcRqCREATESDIDOCWINDOW: /* not used, frameptr, packed pos, w,h, flags; client ptr result. */
case CcRqCREATESDIDOCWINDOW: /* textptr, 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;
......@@ -5027,13 +5000,14 @@ 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 */
NULL, /* No title */
pwintitle, /* title */
styleFlags, /* SDI client style flags */
0, tbHeight, /* x, y */
clientDims.x,clientDims.y, /* width, height */
......@@ -5147,9 +5121,7 @@ HandleCleanRequest (CrossCallInfo * pcci)
break;
case CcRqSETWINDOWTITLE: /* hwnd, textptr no result. */
{
rprintf ("SWT: handle = %d, text = \"%s\"\n", (HWND) pcci->p1, (char *) pcci->p2);
SetWindowText ((HWND) pcci->p1, (char *) pcci->p2);
AdjustMenuBarName ();
SetWindowText ((HWND) pcci->p1, (LPCTSTR) pcci->p2);
MakeReturn0Cci (pcci);
}
break;
......
......@@ -228,12 +228,14 @@ OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbi
= (reverse delay_info,wPtr,OSNoWindowPtr,OSNoWindowPtr,osdInfo,control_info,tb)
| di==SDI
# styleFlags = (if hasHScroll WS_HSCROLL 0) bitor (if hasVScroll WS_VSCROLL 0)
createcci = Rq6Cci CcRqCREATESDIDOCWINDOW 0 osFrame (x<<16+(y<<16)>>16) w h styleFlags
# (textPtr,tb) = WinMakeCString title tb // PA+++
styleFlags = (if hasHScroll WS_HSCROLL 0) bitor (if hasVScroll WS_VSCROLL 0)
createcci = Rq6Cci CcRqCREATESDIDOCWINDOW textPtr osFrame (x<<16+(y<<16)>>16) w h styleFlags
# (returncci,(control_info,delay_info),tb)
= IssueCleanRequest (OScreateWindowCallback isResizable minSize maxSize create_controls update_controls)
createcci
(control_info,[]) tb
# tb = WinReleaseCString textPtr tb // PA+++
clientPtr = case returncci.ccMsg of
CcRETURN1 -> returncci.p1
CcWASQUIT -> OSNoWindowPtr
......@@ -241,7 +243,7 @@ OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbi
osdInfo = setOSDInfoOSInfo {osinfo & osClient=clientPtr} osdInfo
# tb = setScrollRangeAndPos hasHScroll False wMetrics SB_HORZ hInfo.cbiState (0,0) clientPtr tb
# tb = setScrollRangeAndPos hasVScroll False wMetrics SB_VERT vInfo.cbiState (0,0) clientPtr tb
# tb = OSsetWindowTitle osFrame title tb
// # tb = OSsetWindowTitle osFrame title tb
= (reverse delay_info,clientPtr,OSNoWindowPtr,OSNoWindowPtr,osdInfo,control_info,tb)
| otherwise
......
......@@ -1557,7 +1557,8 @@ setWindowTitle id title ioState
_ -> (OSNoWindowPtr,OSNoWindowPtr)
(wids,wsH) = getWindowStateHandleWIDS wsH
wsH = setWindowStateHandleWindowTitle title wsH
# ioState = appIOToolbox (OSsetWindowTitle (if (isSDI && wids.wPtr==clientPtr) framePtr wids.wPtr) title) ioState
// # ioState = appIOToolbox (OSsetWindowTitle (if (isSDI && wids.wPtr==clientPtr) framePtr wids.wPtr) title) ioState
# ioState = appIOToolbox (OSsetWindowTitle (if isSDI framePtr wids.wPtr) title) ioState
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH windows)) ioState
setWindowOk :: !Id Id !(IOSt .l) -> IOSt .l
......
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