fett8802 Posted November 15, 2010 Share Posted November 15, 2010 (edited) This isn't so much asking about specific code as much as ideas for a good way to go about doing this. I have a fairly complex GUI that is essentially an IDE for a coding language that my company uses internally. The GUI itself is fully functional and now on version 8.6.7. I'm adding a save tree functionality to it in order to simplify the saving and loading process. This is also fully functional. Now, where I run into my question is this: The save tree can be toggled on or off and when off, only the IDE window is viewed. This window can be maximized just like normal. When the save tree is toggled on, it docks to the left side of the GUI and resizes and minimizes with the IDE. The tree itself is only about an inch (comparably) in width, which is fixed, and only resizes to become taller or shorter. My question is: what is a good way to go about making it so that when the save tree is toggled ON and the IDE is maximized, that the IDE and the save tree maximize together, but the IDE leaves room on the left for the save tree to be visible. If that isn't very clear, I can upload pics of what I mean. Thanks!!! Edited December 6, 2010 by fett8802 [sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 15, 2010 Moderators Share Posted November 15, 2010 fett8802,You could use something like this to limit the size of your GUI so that there is always room for the tree. As you can see, you use WinMove to get the maximized GUI away from the left edge of the screen. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $GUIMINWID = 300, $GUIMINHT = 100 ; set your restrictions here Global $GUIMAXWID = 800, $GUIMAXHT = 500 $hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE WinMove($hGUI, "", 100, 0) Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, $GUIMAXWID ) ; max X DllStructSetData($tagMaxinfo, 10, $GUIMAXHT ) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFOI would look at the @DesktopWidth and @DesktopHeight macros to set the required max sizes. Please ask if anything is unclear - or if it does not do what you want. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
fett8802 Posted November 16, 2010 Author Share Posted November 16, 2010 (edited) Thanks Melba! That will do exactly what I need, but I have one problem. I'm using Opt("GUIOnEventMode",1) and as such, can't use GUIGetMsg. Is there anyway to accomplish that same polling of the GUI for the maximize command without using GUIGetMsg? Thanks! EDIT: Figured it out: GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Maximize_Window",$MainGUI) Thanks again Melba! Edited November 16, 2010 by fett8802 [sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 16, 2010 Moderators Share Posted November 16, 2010 (edited) fett8802, Is there anyway to accomplish that same polling of the GUI for the maximize command without using GUIGetMsgOf course: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $GUIMINWID = 300, $GUIMINHT = 100 ; set your restrictions here Global $GUIMAXWID = 800, $GUIMAXHT = 500 $hGUI = GUICreate("Test", 500, 500, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetOnEvent($GUI_EVENT_CLOSE, "_On_Exit") GUISetOnEvent($GUI_EVENT_Maximize, "_On_Max") GUISetState() GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") While 1 Sleep(100) WEnd Func _On_Exit() Exit EndFunc Func _On_Max() WinMove($hGUI, "", 100, 0) EndFunc Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, $GUIMAXWID ) ; max X DllStructSetData($tagMaxinfo, 10, $GUIMAXHT ) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO M23 Edit: See you found it yourself - always more satisfying that way! Edited November 17, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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