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

(PA): (1) hiding/showing layout control in window bug fixed.

(2) activate bug of zoomed windows fixed.
parent de47019b
...@@ -82,7 +82,7 @@ OSgetSliderControlMinWidth :: !OSWindowMetrics -> Int ...@@ -82,7 +82,7 @@ OSgetSliderControlMinWidth :: !OSWindowMetrics -> Int
it is an OSWindowPtr if it must be placed behind a given window. it is an OSWindowPtr if it must be placed behind a given window.
OScreateWindow isResizable hScrollInfo vScrollInfo minSize maxSize OScreateWindow isResizable hScrollInfo vScrollInfo minSize maxSize
isClosable title pos size isClosable title pos size
getcontrolfocus createcontrols updatecontrols osdocinfo controlinfo getcontrolfocus createcontrols updatecontrols osdocinfo behindPtr controlinfo
creates a window with the given title, position and size. creates a window with the given title, position and size.
The isResizable argument is True iff the window is user resizable. The isResizable argument is True iff the window is user resizable.
The hScrollInfo argument represents the horizontal scrollbar of the window. The hScrollInfo argument represents the horizontal scrollbar of the window.
...@@ -122,9 +122,10 @@ OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!I ...@@ -122,9 +122,10 @@ OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!I
!(.s->(OSWindowPtr,.s)) !(.s->(OSWindowPtr,.s))
!(OSWindowPtr-> .s -> *OSToolbox -> (.s,*OSToolbox)) !(OSWindowPtr-> .s -> *OSToolbox -> (.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox)) !(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !.s !*OSToolbox !OSDInfo !OSWindowPtr !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox) -> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox)
OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> .s -> ([Int],.s)) !.s !*OSToolbox-> (!Bool,!.s,!*OSToolbox) OScreateModalDialog :: !Bool !String !OSDInfo !(Maybe OSWindowPtr) !(OSEvent -> .s -> ([Int],.s)) !.s !*OSToolbox
-> (!Bool,!.s,!*OSToolbox)
// Mike // // Mike //
...@@ -339,17 +340,21 @@ OSvalidateWindowRgn :: !OSWindowPtr !OSRgnHandle !*OSToolbox -> *OSToolbox ...@@ -339,17 +340,21 @@ OSvalidateWindowRgn :: !OSWindowPtr !OSRgnHandle !*OSToolbox -> *OSToolbox
OSdisableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox OSdisableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox
OSenableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox OSenableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox
/* OSactivateWindow osdInfo thisWindow /* OSactivateWindow osdInfo thisWindow handleEvents info
activates thisWindow. activates thisWindow. The handleEvents function is applied when updates are required.
OSactivateControl parentWindow theControl OSactivateControl parentWindow theControl
activates theControl which is in parentWindow. activates theControl which is in parentWindow.
OSstackWindow thisWindow behindWindow OSstackWindow thisWindow behindWindow
moves the window identified by thisWindow behind the window identified by behindWindow. moves the window identified by thisWindow behind the window identified by behindWindow.
OSstackWindow assumes that thisWindow and behindWindow are valid values. OSstackWindow assumes that thisWindow and behindWindow are valid values.
*/ */
OSactivateWindow :: !OSDInfo !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox) //OSactivateWindow :: !OSDInfo !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox)
OSactivateWindow :: !OSDInfo !OSWindowPtr !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !.s !*OSToolbox
-> (![DelayActivationInfo],!.s,!*OSToolbox)
OSactivateControl :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox) OSactivateControl :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox)
OSstackWindow :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> *OSToolbox //OSstackWindow :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> *OSToolbox
OSstackWindow :: !OSWindowPtr !OSWindowPtr !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !.s !*OSToolbox
-> (![DelayActivationInfo],!.s,!*OSToolbox)
/* OShideWindow thisWindow activate /* OShideWindow thisWindow activate
hides the window. If the Boolean activate is True then a new window is made the active window. hides the window. If the Boolean activate is True then a new window is made the active window.
......
...@@ -197,14 +197,14 @@ OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!I ...@@ -197,14 +197,14 @@ OScreateWindow :: !OSWindowMetrics !Bool !ScrollbarInfo !ScrollbarInfo !(!Int,!I
!(.s->(OSWindowPtr,.s)) !(.s->(OSWindowPtr,.s))
!(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox)) !(OSWindowPtr->.s->*OSToolbox->(.s,*OSToolbox))
!(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox)) !(OSWindowPtr->OSWindowPtr->OSPictContext->.s->*OSToolbox->(.s,*OSToolbox))
!OSDInfo !.s !*OSToolbox !OSDInfo !OSWindowPtr !.s !*OSToolbox
-> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox) -> (![DelayActivationInfo],!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!OSDInfo,!.s,!*OSToolbox)
OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbiHasScroll=hasVScroll} minSize maxSize OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbiHasScroll=hasVScroll} minSize maxSize
isClosable title pos size isClosable title pos size
get_focus get_focus
create_controls create_controls
update_controls update_controls
osdInfo control_info tb osdInfo behindPtr control_info tb
| di==MDI | di==MDI
# (textPtr,tb) = WinMakeCString title tb # (textPtr,tb) = WinMakeCString title tb
styleFlags = WS_SYSMENU styleFlags = WS_SYSMENU
...@@ -213,7 +213,7 @@ OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbi ...@@ -213,7 +213,7 @@ OScreateWindow wMetrics isResizable hInfo=:{cbiHasScroll=hasHScroll} vInfo=:{cbi
bitor (if hasVScroll WS_VSCROLL 0) bitor (if hasVScroll WS_VSCROLL 0)
bitor (if isResizable WS_THICKFRAME 0) bitor (if isResizable WS_THICKFRAME 0)
// bitor WS_CLIPCHILDREN // bitor WS_CLIPCHILDREN
createcci = Rq6Cci CcRqCREATEMDIDOCWINDOW textPtr osinfo.osClient (x<<16+(y<<16)>>16) w h styleFlags createcci = Rq6Cci CcRqCREATEMDIDOCWINDOW textPtr osinfo.osClient behindPtr (x<<16+(y<<16)>>16) (w<<16+(h<<16)>>16) 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
...@@ -972,15 +972,30 @@ OSenableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox ...@@ -972,15 +972,30 @@ OSenableWindow :: !OSWindowPtr !(!Bool,!Bool) !Bool !*OSToolbox -> *OSToolbox
OSenableWindow theWindow scrollInfo modalContext tb OSenableWindow theWindow scrollInfo modalContext tb
= WinSetSelectStateWindow theWindow scrollInfo True modalContext tb = WinSetSelectStateWindow theWindow scrollInfo True modalContext tb
OSactivateWindow :: !OSDInfo !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox) OSactivateWindow :: !OSDInfo !OSWindowPtr !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !.s !*OSToolbox
OSactivateWindow osdInfo thisWindow tb -> (![DelayActivationInfo],!.s,!*OSToolbox)
# (_,delayinfo,tb) = IssueCleanRequest osIgnoreCallback` (Rq3Cci CcRqACTIVATEWINDOW (toInt isMDI) clientPtr thisWindow) [] tb OSactivateWindow osdInfo thisWindow handleOSEvent state tb
= (reverse delayinfo,tb) # (_,(delayinfo,state),tb) = IssueCleanRequest (osCallback handleOSEvent) (Rq3Cci CcRqACTIVATEWINDOW (toInt isMDI) clientPtr thisWindow) ([],state) tb
= (reverse delayinfo,state,tb)
where where
isMDI = getOSDInfoDocumentInterface osdInfo==MDI isMDI = getOSDInfoDocumentInterface osdInfo==MDI
clientPtr = case (getOSDInfoOSInfo osdInfo) of clientPtr = case (getOSDInfoOSInfo osdInfo) of
Just {osClient} -> osClient Just {osClient} -> osClient
nothing -> oswindowFatalError "OSactivateWindow" "illegal DocumentInterface context" nothing -> oswindowFatalError "OSactivateWindow" "illegal DocumentInterface context"
/* osCallback delays activate and deactivate events.
All other events are passed to the callback function.
PA: is now identical to OSstackWindow!!
*/ osCallback :: !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !CrossCallInfo !(![DelayActivationInfo],!.s) !*OSToolbox
-> (!CrossCallInfo,!(![DelayActivationInfo],!.s),!*OSToolbox)
osCallback handleOSEvent {ccMsg=CcWmACTIVATE,p1=hwnd} (delayinfo,s) tb
= (Return0Cci,([DelayActivatedWindow hwnd:delayinfo],s),tb)
osCallback handleOSEvent {ccMsg=CcWmDEACTIVATE,p1=hwnd} (delayinfo,s) tb
= (Return0Cci,([DelayDeactivatedWindow hwnd:delayinfo],s),tb)
osCallback handleOSEvent osEvent (delayinfo,s) tb
# (s,tb) = handleOSEvent osEvent (s,tb)
= (Return0Cci,(delayinfo,s),tb)
OSactivateControl :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox) OSactivateControl :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox)
OSactivateControl parentWindow controlPtr tb OSactivateControl parentWindow controlPtr tb
...@@ -997,10 +1012,35 @@ where ...@@ -997,10 +1012,35 @@ where
osIgnoreCallback` _ s tb osIgnoreCallback` _ s tb
= (Return0Cci,s,tb) = (Return0Cci,s,tb)
/* PA: previous implementation of OSstackWindow ignored window updates and resizes. This is fixed below.
OSstackWindow :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> *OSToolbox OSstackWindow :: !OSWindowPtr !OSWindowPtr !*OSToolbox -> *OSToolbox
OSstackWindow thisWindow behindWindow tb OSstackWindow thisWindow behindWindow tb
= WinRestackWindow thisWindow behindWindow tb = WinRestackWindow thisWindow behindWindow tb
WinRestackWindow :: !HWND !HWND !*OSToolbox -> *OSToolbox
WinRestackWindow theWindow behindWindow tb
= snd (IssueCleanRequest2 (ErrorCallback2 "WinRestackWindow") (Rq2Cci CcRqRESTACKWINDOW theWindow behindWindow) tb)
*/
OSstackWindow :: !OSWindowPtr !OSWindowPtr !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !.s !*OSToolbox
-> (![DelayActivationInfo],!.s,!*OSToolbox)
OSstackWindow thisWindow behindWindow handleOSEvent state tb
# (_,(delayinfo,state),tb) = IssueCleanRequest (osCallback handleOSEvent) (Rq2Cci CcRqRESTACKWINDOW thisWindow behindWindow) ([],state) tb
= (reverse delayinfo,state,tb)
where
/* osCallback delays activate and deactivate events.
All other events are passed to the callback function.
PA: is now identical to OSactivateWindow!!
*/ osCallback :: !(OSEvent->(.s,*OSToolbox)->(.s,*OSToolbox)) !CrossCallInfo !(![DelayActivationInfo],!.s) !*OSToolbox
-> (!CrossCallInfo,!(![DelayActivationInfo],!.s),!*OSToolbox)
osCallback handleOSEvent {ccMsg=CcWmACTIVATE,p1=hwnd} (delayinfo,s) tb
= (Return0Cci,([DelayActivatedWindow hwnd:delayinfo],s),tb)
osCallback handleOSEvent {ccMsg=CcWmDEACTIVATE,p1=hwnd} (delayinfo,s) tb
= (Return0Cci,([DelayDeactivatedWindow hwnd:delayinfo],s),tb)
osCallback handleOSEvent osEvent (delayinfo,s) tb
# (s,tb) = handleOSEvent osEvent (s,tb)
= (Return0Cci,(delayinfo,s),tb)
OShideWindow :: !OSWindowPtr !Bool !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox) OShideWindow :: !OSWindowPtr !Bool !*OSToolbox -> (![DelayActivationInfo],!*OSToolbox)
OShideWindow wPtr activate tb OShideWindow wPtr activate tb
# (_,delayinfo,tb) = IssueCleanRequest osIgnoreCallback` (Rq3Cci CcRqSHOWWINDOW wPtr (toInt False) (toInt activate)) [] tb # (_,delayinfo,tb) = IssueCleanRequest osIgnoreCallback` (Rq3Cci CcRqSHOWWINDOW wPtr (toInt False) (toInt activate)) [] tb
......
...@@ -118,8 +118,6 @@ WinSetScrollThumbSize :: !HWND !Int !Int !Int !Int !Int !*OSToolbox -> *OSToolbo ...@@ -118,8 +118,6 @@ WinSetScrollThumbSize :: !HWND !Int !Int !Int !Int !Int !*OSToolbox -> *OSToolbo
*/ */
WinSetEditSelection :: !HWND !Int !Int !*OSToolbox -> *OSToolbox // Note: @2<=@3, @1 must point to an edit control. WinSetEditSelection :: !HWND !Int !Int !*OSToolbox -> *OSToolbox // Note: @2<=@3, @1 must point to an edit control.
WinRestackWindow :: !HWND !HWND !*OSToolbox -> *OSToolbox // PA: new function to put first window behind second window
WinShowControl :: !HWND !Bool !*OSToolbox -> *OSToolbox // PA: new routine to hide (False) & show (True) controls. WinShowControl :: !HWND !Bool !*OSToolbox -> *OSToolbox // PA: new routine to hide (False) & show (True) controls.
WinEnableControl :: !HWND !Bool !*OSToolbox -> *OSToolbox WinEnableControl :: !HWND !Bool !*OSToolbox -> *OSToolbox
WinEnablePopupItem :: !HWND !Int !Bool !*OSToolbox -> *OSToolbox // PA: this function is currently not used, but might be WinEnablePopupItem :: !HWND !Int !Bool !*OSToolbox -> *OSToolbox // PA: this function is currently not used, but might be
......
...@@ -220,10 +220,6 @@ WinSetEditSelection :: !HWND !Int !Int !*OSToolbox -> *OSToolbox ...@@ -220,10 +220,6 @@ WinSetEditSelection :: !HWND !Int !Int !*OSToolbox -> *OSToolbox
WinSetEditSelection editHWND first last tb WinSetEditSelection editHWND first last tb
= snd (IssueCleanRequest2 (ErrorCallback2 "WinSetEditSelection") (Rq3Cci CcRqSETEDITSELECTION editHWND first last) tb) = snd (IssueCleanRequest2 (ErrorCallback2 "WinSetEditSelection") (Rq3Cci CcRqSETEDITSELECTION editHWND first last) tb)
WinRestackWindow :: !HWND !HWND !*OSToolbox -> *OSToolbox
WinRestackWindow theWindow behindWindow tb
= snd (IssueCleanRequest2 (ErrorCallback2 "WinRestackWindow") (Rq2Cci CcRqRESTACKWINDOW theWindow behindWindow) tb)
WinShowControl :: !HWND !Bool !*OSToolbox -> *OSToolbox WinShowControl :: !HWND !Bool !*OSToolbox -> *OSToolbox
WinShowControl hwnd bool tb WinShowControl hwnd bool tb
= snd (IssueCleanRequest2 (ErrorCallback2 "WinShowControl") (Rq2Cci CcRqSHOWCONTROL hwnd (toInt bool)) tb) = snd (IssueCleanRequest2 (ErrorCallback2 "WinShowControl") (Rq2Cci CcRqSHOWCONTROL hwnd (toInt bool)) tb)
......
Supports Markdown
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