Burgaud Posted April 7, 2018 Share Posted April 7, 2018 I have a GUI (called $MW) that can resize. Global $GUIMinX = 0.75 * @DesktopWidth Global $GUIMinY = 0.75 * @DesktopHeigth func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMinX) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMinY) ; min Y DllStructSetData($tagMaxinfo, 9, @DesktopWidth ); max X DllStructSetData($tagMaxinfo, 10, @DesktopHeigth ) ; max Y return 0 endfunc ;==>WM_GETMINMAXINFO GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") Global $MW = GUICreate($TITLE & " " & $VERSION, $GUIMinX, $GUIMinY, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) Within this GUI, I have several panels/items: Labels, List, Buttons, Inputs in different locations, sizes, fonts, colors and bgcolors. local $Panel1 = GUICtrlCreateLabel("Names", 5, 5, 200, 150) local $Panel2 = GUICtrlCreateList("", 210, 5, $GUIMinX-215, 150) local $Panel3 = GUICtrlCreateLabel("Address", 5, 160, 200, 150) local $Panel4 = GUICtrlCreateList("", 210, 160, $GUIMinX-215, 150) local $Panel5 = GUICtrlCreateList("", 5, 310, $GUIMinX-10, $GUIMinY-350) Here is my problem: I dont want Panel1 and Panel3 to resize. both fixed dimension. (Both are Labels) Panel2, and Panel4 is allowed to resize horizontally only. (Both are Lists) Panel5 is allowed to resize horizontally and vertically (no problem). How to do? PS: What is the equivalent in Autoit of: perl's ROText perl's -relief => 'groove' (for the outlines of labels and lists). thanks! Link to comment Share on other sites More sharing options...
Xandy Posted April 7, 2018 Share Posted April 7, 2018 (edited) I keep my GUI control sizes the same with this function: GUICtrlSetResizing() Not sure if that's what you're looking for :). ; Confirm Button (Stays at bottom right during window resize event and retains starting size) $aControl[$eCommand_dialog_confirm][$eControl_data] = control_create("Button", "Confirm", $aGui_rect[2] - 75, $aGui_rect[3] - $control_pos_pad_from_bottom, 50, 20, "Confirm Commands and Exit") GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM) control_create() is a custom function to provide labels and tooltips for controls. You can replace that line with any GUIControlCreate.. function. Edited April 7, 2018 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 Burgaud, This should get you started: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $GUIMinX = 0.5 * @DesktopWidth Global $GUIMinY = 0.5 * @DesktopHeight Global $MW = GUICreate("Test", $GUIMinX, $GUIMinY, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) local $Panel1 = GUICtrlCreateLabel("Names", 5, 5, 200, 150) GUICtrlSetBkColor($Panel1, 0xFFCCCC) GUICtrlSetResizing($Panel1, BitOR($GUI_DOCKSIZE, $GUI_DOCKALL)) local $Panel2 = GUICtrlCreateList("", 210, 5, $GUIMinX-215, 150) GUICtrlSetResizing($Panel2, BitOR($GUI_DOCKAUTO, $GUI_DOCKHEIGHT, $GUI_DOCKTOP)) local $Panel3 = GUICtrlCreateLabel("Address", 5, 160, 200, 150) GUICtrlSetBkColor($Panel3, 0xCCFFCC) GUICtrlSetResizing($Panel3, BitOR($GUI_DOCKSIZE, $GUI_DOCKALL)) local $Panel4 = GUICtrlCreateList("", 210, 160, $GUIMinX-215, 150) GUICtrlSetResizing($Panel4, BitOR($GUI_DOCKAUTO, $GUI_DOCKHEIGHT, $GUI_DOCKTOP)) local $Panel5 = GUICtrlCreateList("", 5, 310, $GUIMinX-10, $GUIMinY-350) GUICtrlSetResizing($Panel5, $GUI_DOCKTOP) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23 Xandy 1 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...
Burgaud Posted April 7, 2018 Author Share Posted April 7, 2018 (edited) So this GUICtrlSetResizing function is more or less similar to perl's pack with some differences: GUICtrlSetResizing expands ratiometric to the original size it was created. pack expands to cover everything. I just need to think differently away from perl's method indeed it is the start I am looking for. thanx Edited April 7, 2018 by Burgaud Link to comment Share on other sites More sharing options...
Burgaud Posted April 7, 2018 Author Share Posted April 7, 2018 after some more thoughts, I found $GUI_EVENT_RESIZED as the perfect solution to reshaping/resizing GUI! I just need to GUICtrlSetPos each panel after a resize event which is not a huge task. awesome! autoit thought of it! 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