martin Posted April 25, 2009 Share Posted April 25, 2009 (edited) GuiCtrlSetResizing should set how a control is resized when the parent window is resized. It appears not to override the globally set resizing method for graphic controls. Here is an example which looks to me like a bug. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GuiREsizeMode", $GUI_DOCKALL) $gui = GUICreate("graphic resizing",-1,-1,-1,-1,BitOr($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX)) $btn = GUICtrlCreateButton("button",30,50,80,22) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM)) $g1 = GUICtrlCreateGraphic(50,120,100,100) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM)) GUISetState() while GUIGetMsg() <> -3 WEnd Can someone confirm? I am using production version 3.3.0.0 Edited April 25, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Authenticity Posted April 26, 2009 Share Posted April 26, 2009 It seems like there is a collision or conflict between the "GuiResizeMode" option and the GUICtrlSetResizing function. If you drop the Opt call and use GUICtrlSetResizing(-1, $GUI_DOCKALL) on both, then it seems to function correctly. Link to comment Share on other sites More sharing options...
Quual Posted April 26, 2009 Share Posted April 26, 2009 At first I thought it was because you used bitor for joining the $gui_dock vars, I have always just added them, Took me a minute to realize in this case they produce same result. lol If BitOr($GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM) = $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM Then MsgBox(0,'','Yep they be equal') And yes I experienced same results as both of you. Link to comment Share on other sites More sharing options...
martin Posted April 26, 2009 Author Share Posted April 26, 2009 (edited) At first I thought it was because you used bitor for joining the $gui_dock vars, I have always just added them, Took me a minute to realize in this case they produce same result. lolIf BitOr($GUI_DOCKHEIGHT, $GUI_DOCKWIDTH, $GUI_DOCKLEFT, $GUI_DOCKBOTTOM) = $GUI_DOCKHEIGHT + $GUI_DOCKWIDTH + $GUI_DOCKLEFT + $GUI_DOCKBOTTOM Then MsgBox(0,'','Yep they be equal')And yes I experienced same results as both of you.Thank you Authenticity and Quual, I have reported it as a bug (ticket #931) @Quual You need to change the way you deal with values which give styles or characteristics. It is true that adding often gives the same result as oring but you should never add values even though you will see many people doing that and even in the help file. This is an example of where it makes no difference BitOr($GUI_DOCKRIGHT,$GUI_DOCKHEIGHT,$GUI_DOCKTOP,$GUI_DOCKWIDTH) It makes no difference because each value is a different multiple of 2. Here is an example where it does make a difference BitOr($GUI_DOCKMENUBAR,$GUI_DOCKTOP)which seems logical because you want a menu bar at the top but it does not give the same effect asBitAnd($GUI_DOCKMENUBAR,$GUI_DOCKTOP)There are many Gui window styles which are combinations of other styles and if you add them together instead of oring them you can get unexpected results which can even make you script crash.After all, 2 OR 2 OR 2 = 2, but 2 AND 2 ANd 2 = 6 Edited April 26, 2009 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Quual Posted April 26, 2009 Share Posted April 26, 2009 Thank you Authenticity and Quual, I have reported it as a bug (ticket #931) @Quual You need to change the way you deal with values which give styles or characteristics. It is true that adding often gives the same result as oring but you should never add values even though you will see many people doing that and even in the help file. There are many Gui window styles which are combinations of other styles and if you add them together instead of oring them you can get unexpected results which can even make you script crash.Ah I see your point, just adding them works fine, unless you run into a case where you add a value to another that already contains that value. as in your example$GUI_DOCKMENUBAR = $GUI_DOCKTOP + $GUI_DOCKHEIGHT so adding another $GUI_DOCKTOP into it would cause a problem. where bitor avoids the issue.I do always bitor styles, and I never ran into a issue with docking because I never use Docksize, Dockmenubar, Dockstatebar, Dockall or Dockborders Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now