ISAWHIM
24-10-2008, 06:18
NOTE: This is on the 1.7.0.0 Beta (Latest release)
The UI does not redraw using the "Clipping" rules, when "%WM_SIZE" is triggered on the parent when triggered from a minimized state "%WM_SYSCOMMAND & %SC_RESTORE".
The UI also does not redraw using the "Clipping" rules, when a window is selected, before moving begins.
I am guessing that the order is... (WM_SYSCOMMAND-SC_RESTORE) triggers (WM_SIZE)... But there is no screen at the point of (WM_SYSCOMMAND-SC_RESTORE), since the window is NO-SIZE. However, even with a MANUAL REDRAW of all window handles at the (WM_SIZE), the window does not get resized.
Uncomment the BEEP's to confirm the event order.
Method to reproduce (Restore Parent non-redraw) situation:
- Run the program
- Maximize any CHILD
- Minimize the PARENT
- Restore the PARENT
- - Results show the PARENT button which is under the Maximized CHILD, is now drawn over the CHILD caption/menu/client-area.
To confirm the issue is specific only to the RESTORE from MINIMIZED PARENT. Maximize the PARENT, and the CHILD and PARENT are both redrawn. Now RESTORE the CHILD while the PARENT is MAXIMIZED, Followed by MAXIMIZE of the CHILD. (That brings the child back up to the size of the client.) Now RESTORE the PARENT, and all is redrawn correctly. (That localizes the issue to MINIMIZE RESTORE, and not MAXIMIZE RESTORE.)
Method to reproduce (Move Child non-redraw) situation:
- Run the program
- Move Child 1, partly over Child 2
- Move Child 2, and you notice that the selected window has not redrawn (To bring it to the top), prior to motion.
Attempted resolution to "Bring to top" prior to motion failed. (Window floats-under control of ThinBASIC, and ignores Z-Order commands until the window is released.)
Suggested possible fix... (In ThinBASIC) At the instance the mouse is clicked, prior to move, if the window is enabled (Valid to get focus), focus should fall to the window, followed by z-order of "TopMost", followed by mouse-move translation, and ending mouse-move translation with z-order of "Top" set to the window. (Bringing it to the "TopMost" should pull the parent through any windows it may be behind, followed by the child being the only container on top, where a "Topmost" dialog may hide the window being moved. Which would return to "Top" so that the "Topmost" dialog would be restored, such as a warning prompt.)
' Empty GUI script created on 10-23-2008 10:08:51 by (ThinAIR)
'#########################
' -- NOTE: All comment are NOT "The way", they are, "The way I have figured-out, through trial and error."
'#########################
USES "UI"
BEGIN CONST
%btnCOMMAND = 1
END CONST
GLOBAL hWnd, hWndChild1, hWndChild2 AS DWORD
GLOBAL ClickWatch AS STRING
GLOBAL MaxWinHandle AS DWORD
GLOBAL hWndWidth, hWndHeight AS DWORD
GLOBAL xTempDWORD, yTempDWORD AS DWORD
FUNCTION TBMAIN()
DIALOG NEW PIXELS, 0, "CWAD Control Center",-1,-1, 350, 150, _
%WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
0 TO hWnd
' -- Could not figure out how to use these... Had no effect on control or display...
' -- Causes some graphical glitches... Pulling graphics through the child clients...
'%WS_EX_CONTROLPARENT
DIALOG NEW PIXELS, hWnd, "Child 1", 10, 50, 150, 40, _
%WS_CHILD OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
%WS_EX_CLIENTEDGE TO hWndChild1
DIALOG NEW PIXELS, hWnd, "Child 2", 180, 50, 150, 40, _
%WS_CHILD OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
%WS_EX_CLIENTEDGE TO hWndChild2
' -- Not sure what this does... Had no effect on control or display...
'%WS_EX_MDICHILD OR
CONTROL ADD BUTTON, hWnd, %btnCOMMAND, "TEST BTN 0", 10, 10, 130, 22, CALL FC_btnCOMMAND()
CONTROL ADD BUTTON, hWndChild1, %btnCOMMAND, "TEST BTN 1", 10, 10, 130, 22, CALL FC_btnCOMMAND()
CONTROL ADD BUTTON, hWndChild2, %btnCOMMAND, "TEST BTN 2", 10, 10, 130, 22, CALL FC_btnCOMMAND()
' -- Show PARENT and CALL...
DIALOG SHOW MODAL hWnd, CALL dlgProc()
DIALOG GET SIZE hWnd TO hWndWidth, hWndHeight
END FUNCTION
' -- Callback Function for dialog
CALLBACK FUNCTION dlgProc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
' -- Once the parent is SHOWN, Show CHILDREN and CALL...
DIALOG SHOW MODELESS hWndChild1, CALL child1Proc()
DIALOG SHOW MODELESS hWndChild2, CALL child2Proc()
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
CASE %SC_RESTORE
'BEEP
'DIALOG REDRAW hWnd
'DIALOG REDRAW hWndChild1
'DIALOG REDRAW hWndChild2
CASE %SC_MAXIMIZE
CASE %SC_CLOSE
CASE %SC_MOVE
'DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
'BEEP
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
'BEEP
'DIALOG REDRAW hWnd
'DIALOG REDRAW hWndChild1
'DIALOG REDRAW hWndChild2
DIALOG GET SIZE hWnd TO hWndWidth, hWndHeight
IF MaxWinHandle <> hWnd THEN
DIALOG SET SIZE MaxWinHandle, hWndWidth, hWndHeight
DIALOG SET TEXT hWnd, "Parent Size: W=("+hWndWidth+"), H=("+hWndHeight+")"
END IF
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Parent)"
DIALOG SET TEXT hWnd, ClickWatch
' -- Here is where I was "Attempting" to SHOW a CHILD, once it was closed...
' -- I removed all code, since it did nothing.
' -- Tried DIALOG SHOW MODELESS
' -- Tried DIALOG ENABLE
END IF
END SELECT
CASE %WM_CLOSE
DIALOG END CBHNDL
END SELECT
END FUNCTION
' -- Callback Function for child1
CALLBACK FUNCTION child1Proc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
IF MaxWinHandle = hWndChild1 THEN MaxWinHandle = hWnd
CASE %SC_RESTORE
IF MaxWinHandle = hWndChild1 THEN MaxWinHandle = hWnd
CASE %SC_MAXIMIZE
MaxWinHandle = hWndChild1
CASE %SC_CLOSE
CASE %SC_MOVE
DIALOG SET TOPMOST hWndChild1, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Child 1)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
CASE %WM_CLOSE
DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
END FUNCTION
' -- Callback Function for child2
CALLBACK FUNCTION child2Proc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
IF MaxWinHandle = hWndChild2 THEN MaxWinHandle = hWnd
CASE %SC_RESTORE
IF MaxWinHandle = hWndChild2 THEN MaxWinHandle = hWnd
CASE %SC_MAXIMIZE
MaxWinHandle = hWndChild2
CASE %SC_CLOSE
CASE %SC_MOVE
DIALOG SET TOPMOST hWndChild2, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Child2)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
CASE %WM_CLOSE
DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
END FUNCTION
' -- Callback Function for btnCOMMAND
CALLBACK FUNCTION FC_btnCOMMAND()
IF CBMSG = %WM_COMMAND THEN
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
If LEN(ClickWatch) > 0 THEN ClickWatch =""
ClickWatch += "(BTN:ALL)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
END IF
END FUNCTION
Add one more bug to the UI...
Button on PARENT floats above CHILDREN when MOUSE-OVER. (Pulls through child.)
Steps to reproduce issue...
- Move Child 1 half-way over the button on PARENT
- Move mouse over button. (Button pulls through child.)
- Move mouse over Child 1 Minimize, Maximize, Close buttons on menu. (If they cover the button, those buttons will pull through the button on the parent, which pulled through the child.)
The UI does not redraw using the "Clipping" rules, when "%WM_SIZE" is triggered on the parent when triggered from a minimized state "%WM_SYSCOMMAND & %SC_RESTORE".
The UI also does not redraw using the "Clipping" rules, when a window is selected, before moving begins.
I am guessing that the order is... (WM_SYSCOMMAND-SC_RESTORE) triggers (WM_SIZE)... But there is no screen at the point of (WM_SYSCOMMAND-SC_RESTORE), since the window is NO-SIZE. However, even with a MANUAL REDRAW of all window handles at the (WM_SIZE), the window does not get resized.
Uncomment the BEEP's to confirm the event order.
Method to reproduce (Restore Parent non-redraw) situation:
- Run the program
- Maximize any CHILD
- Minimize the PARENT
- Restore the PARENT
- - Results show the PARENT button which is under the Maximized CHILD, is now drawn over the CHILD caption/menu/client-area.
To confirm the issue is specific only to the RESTORE from MINIMIZED PARENT. Maximize the PARENT, and the CHILD and PARENT are both redrawn. Now RESTORE the CHILD while the PARENT is MAXIMIZED, Followed by MAXIMIZE of the CHILD. (That brings the child back up to the size of the client.) Now RESTORE the PARENT, and all is redrawn correctly. (That localizes the issue to MINIMIZE RESTORE, and not MAXIMIZE RESTORE.)
Method to reproduce (Move Child non-redraw) situation:
- Run the program
- Move Child 1, partly over Child 2
- Move Child 2, and you notice that the selected window has not redrawn (To bring it to the top), prior to motion.
Attempted resolution to "Bring to top" prior to motion failed. (Window floats-under control of ThinBASIC, and ignores Z-Order commands until the window is released.)
Suggested possible fix... (In ThinBASIC) At the instance the mouse is clicked, prior to move, if the window is enabled (Valid to get focus), focus should fall to the window, followed by z-order of "TopMost", followed by mouse-move translation, and ending mouse-move translation with z-order of "Top" set to the window. (Bringing it to the "TopMost" should pull the parent through any windows it may be behind, followed by the child being the only container on top, where a "Topmost" dialog may hide the window being moved. Which would return to "Top" so that the "Topmost" dialog would be restored, such as a warning prompt.)
' Empty GUI script created on 10-23-2008 10:08:51 by (ThinAIR)
'#########################
' -- NOTE: All comment are NOT "The way", they are, "The way I have figured-out, through trial and error."
'#########################
USES "UI"
BEGIN CONST
%btnCOMMAND = 1
END CONST
GLOBAL hWnd, hWndChild1, hWndChild2 AS DWORD
GLOBAL ClickWatch AS STRING
GLOBAL MaxWinHandle AS DWORD
GLOBAL hWndWidth, hWndHeight AS DWORD
GLOBAL xTempDWORD, yTempDWORD AS DWORD
FUNCTION TBMAIN()
DIALOG NEW PIXELS, 0, "CWAD Control Center",-1,-1, 350, 150, _
%WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
0 TO hWnd
' -- Could not figure out how to use these... Had no effect on control or display...
' -- Causes some graphical glitches... Pulling graphics through the child clients...
'%WS_EX_CONTROLPARENT
DIALOG NEW PIXELS, hWnd, "Child 1", 10, 50, 150, 40, _
%WS_CHILD OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
%WS_EX_CLIENTEDGE TO hWndChild1
DIALOG NEW PIXELS, hWnd, "Child 2", 180, 50, 150, 40, _
%WS_CHILD OR %WS_CLIPCHILDREN OR %WS_CLIPSIBLINGS OR _
%WS_OVERLAPPEDWINDOW, _
%WS_EX_CLIENTEDGE TO hWndChild2
' -- Not sure what this does... Had no effect on control or display...
'%WS_EX_MDICHILD OR
CONTROL ADD BUTTON, hWnd, %btnCOMMAND, "TEST BTN 0", 10, 10, 130, 22, CALL FC_btnCOMMAND()
CONTROL ADD BUTTON, hWndChild1, %btnCOMMAND, "TEST BTN 1", 10, 10, 130, 22, CALL FC_btnCOMMAND()
CONTROL ADD BUTTON, hWndChild2, %btnCOMMAND, "TEST BTN 2", 10, 10, 130, 22, CALL FC_btnCOMMAND()
' -- Show PARENT and CALL...
DIALOG SHOW MODAL hWnd, CALL dlgProc()
DIALOG GET SIZE hWnd TO hWndWidth, hWndHeight
END FUNCTION
' -- Callback Function for dialog
CALLBACK FUNCTION dlgProc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
' -- Once the parent is SHOWN, Show CHILDREN and CALL...
DIALOG SHOW MODELESS hWndChild1, CALL child1Proc()
DIALOG SHOW MODELESS hWndChild2, CALL child2Proc()
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
CASE %SC_RESTORE
'BEEP
'DIALOG REDRAW hWnd
'DIALOG REDRAW hWndChild1
'DIALOG REDRAW hWndChild2
CASE %SC_MAXIMIZE
CASE %SC_CLOSE
CASE %SC_MOVE
'DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
'BEEP
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
'BEEP
'DIALOG REDRAW hWnd
'DIALOG REDRAW hWndChild1
'DIALOG REDRAW hWndChild2
DIALOG GET SIZE hWnd TO hWndWidth, hWndHeight
IF MaxWinHandle <> hWnd THEN
DIALOG SET SIZE MaxWinHandle, hWndWidth, hWndHeight
DIALOG SET TEXT hWnd, "Parent Size: W=("+hWndWidth+"), H=("+hWndHeight+")"
END IF
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Parent)"
DIALOG SET TEXT hWnd, ClickWatch
' -- Here is where I was "Attempting" to SHOW a CHILD, once it was closed...
' -- I removed all code, since it did nothing.
' -- Tried DIALOG SHOW MODELESS
' -- Tried DIALOG ENABLE
END IF
END SELECT
CASE %WM_CLOSE
DIALOG END CBHNDL
END SELECT
END FUNCTION
' -- Callback Function for child1
CALLBACK FUNCTION child1Proc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
IF MaxWinHandle = hWndChild1 THEN MaxWinHandle = hWnd
CASE %SC_RESTORE
IF MaxWinHandle = hWndChild1 THEN MaxWinHandle = hWnd
CASE %SC_MAXIMIZE
MaxWinHandle = hWndChild1
CASE %SC_CLOSE
CASE %SC_MOVE
DIALOG SET TOPMOST hWndChild1, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Child 1)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
CASE %WM_CLOSE
DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
END FUNCTION
' -- Callback Function for child2
CALLBACK FUNCTION child2Proc()
' -- Test for messages
SELECT CASE CBMSG
CASE %WM_INITDIALOG
' -- Put code to be executed after dialog creation here
CASE %WM_SYSCOMMAND
SELECT CASE CBWPARAM
CASE %SC_MINIMIZE
IF MaxWinHandle = hWndChild2 THEN MaxWinHandle = hWnd
CASE %SC_RESTORE
IF MaxWinHandle = hWndChild2 THEN MaxWinHandle = hWnd
CASE %SC_MAXIMIZE
MaxWinHandle = hWndChild2
CASE %SC_CLOSE
CASE %SC_MOVE
DIALOG SET TOPMOST hWndChild2, %HWND_TOP
END SELECT
CASE %WM_SIZING
' -- This event is "Border Resize" with MOUSE
CASE %WM_SIZE
' -- This is ANY resize... Button, Mouse, Minimize, Maximize, Restore
CASE %WM_COMMAND
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
ClickWatch += "(BTN:Child2)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
CASE %WM_CLOSE
DIALOG SET TOPMOST hWnd, %HWND_TOP
END SELECT
END FUNCTION
' -- Callback Function for btnCOMMAND
CALLBACK FUNCTION FC_btnCOMMAND()
IF CBMSG = %WM_COMMAND THEN
SELECT CASE CBCTL
CASE %btnCOMMAND
IF CBCTLMSG = %BN_CLICKED THEN
If LEN(ClickWatch) > 0 THEN ClickWatch =""
ClickWatch += "(BTN:ALL)"
DIALOG SET TEXT hWnd, ClickWatch
END IF
END SELECT
END IF
END FUNCTION
Add one more bug to the UI...
Button on PARENT floats above CHILDREN when MOUSE-OVER. (Pulls through child.)
Steps to reproduce issue...
- Move Child 1 half-way over the button on PARENT
- Move mouse over button. (Button pulls through child.)
- Move mouse over Child 1 Minimize, Maximize, Close buttons on menu. (If they cover the button, those buttons will pull through the button on the parent, which pulled through the child.)