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