Dear HMG friends,
Last week my good friend Ben Dekker asked me a question regarding the 'ON SIZE' event using a MODAL window.
When a MODAL window is used with a menu, a resize event is incorrectly triggered when the window is opened.
Normally a resize event is only triggered when the user tries to resize a window. According Ben and my selves this should not happen. When using a MAIN window ( with or without menu ) this unwanted behavior does not occur. Also when using a MODAL window without menu everything works a expected.
To demonstrate the problem I created a demo ( see attachment ). The demo starts a MAIN window ( with a menu ). When the demo is started the main window will open without firing the resize event ( like it should ). When you try to resize the window the resize event is correctly triggered.
On the MAIN window there are 2 buttons:
The first button opens a MODAL window WITHOUT menu. When you try to resize the window the resize event is correctly triggered.
Until now everything works like it should ! The problem starts here:
The second button opens a MODAL window WITH menu. Directly after opening the the window, the resize event is incorrectly triggered (without doing a resize).
So our conclusion is this behavior is probably a bug. Or is there another explanation ?
Best regards,
Theo
ON SIZE bug in a MODAL Window with a menu
Moderator: Rathinagiri
ON SIZE bug in a MODAL Window with a menu
- Attachments
-
- ResizeBugDemo.zip
- (1.47 MiB) Downloaded 76 times
Re: ON SIZE bug in a MODAL Window with a menu
Dear friends,
I am still struggling with this basic issue. I also found out the problem occurs in both the latest versions of HMG and MiniGui ?
Maybe Grigory or Rathi can have a look ?
Thanks in advance !
Theo
I am still struggling with this basic issue. I also found out the problem occurs in both the latest versions of HMG and MiniGui ?
Maybe Grigory or Rathi can have a look ?
Thanks in advance !
Theo
Re: ON SIZE bug in a MODAL Window with a menu
Try this code:
Code: Select all
Function ModalWindowNotOK()
DEFINE WINDOW wndModalWindowWithMenu ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 650 ;
TITLE "MODAL Window WITH MENU ( try to resize )";
MODAL;
ON SIZE { || IF (IsWindowActive (wndModalWindowWithMenu), msgdebug("ON SIZE is triggered to early because of the MENU"), Nil ) }
DEFINE MAIN MENU
POPUP 'Menu'
ITEM 'Dummy menu item' ACTION MsgDebug("TEST")
END POPUP
END MENU
END WINDOW
CENTER WINDOW wndModalWindowWithMenu
ACTIVATE WINDOW wndModalWindowWithMenu
RETURN(nil)
Re: ON SIZE bug in a MODAL Window with a menu
Hi Edk,
Thanks, your work-a-round works fantastic
I just called my friend Ben and you have made his day !
Let's hope Grigory and Rathi can implement this bug fix in the next release of HMG and MiniGui.
Theo
Thanks, your work-a-round works fantastic
I just called my friend Ben and you have made his day !
Let's hope Grigory and Rathi can implement this bug fix in the next release of HMG and MiniGui.
Theo
Re: ON SIZE bug in a MODAL Window with a menu
Hi Theo,
It will be fixed at the next MiniguiEx update (thanks to Edk's tip ).
Thank you for your attention.
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: ON SIZE bug in a MODAL Window with a menu
Grigory,
Great to hear and thanks for following up !
Theo
Great to hear and thanks for following up !
Theo