armoros Posted June 2, 2012 Share Posted June 2, 2012 (edited) After Melba23's guidance how to divide a GUI in two frames i am asking if we can just click on the bar that divides the GUI than to drag it up or down. Could i use a pre autom. macro/script and then trigger that action from inside the script. Do i confuse you..tell me to explain better if i do #include #include #include #include "GUIFrame.au3" $hGUI = GUICreate("GUI_Parent", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) ; Create a 1st level frame $iFrame = _GUIFrame_Create($hGUI, 1) _GUIFrame_SetMin($iFrame, 250, 250) GUISetState(@SW_SHOW) $hTopFrame = _GUIFrame_GetHandle($iFrame, 1) _GUIFrame_Switch($iFrame, 1) GUICtrlCreateLabel("", 0, 0, 0, 0) $hGUI_Child = GUICreate("GUI_Child", 100, 100, 50, 50, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor(0xFF0000) _WinAPI_SetParent($hGUI_Child, $hTopFrame) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited June 2, 2012 by armoros [font="verdana, geneva, sans-serif"] [/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 2, 2012 Moderators Share Posted June 2, 2012 armoros, Do you mean you want to prevent the resizing of the 2 parts of the GUI? If so then just look at how I create the internal frames within the UDF itself - you can leave out the subclassing code for the separator. Give it a go yourself and come back if you run into difficulties. 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...
armoros Posted June 2, 2012 Author Share Posted June 2, 2012 Thank you Melba23,i failed to describe what i want.For example in the script above we have to drag the line up or down a little to grow our frames etc. What i am searching is how to just click on the line and that automatically moves up or down.like this action in technet site when you click the button that separates the menu from the main page..Thank you again. [font="verdana, geneva, sans-serif"] [/font] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 2, 2012 Moderators Share Posted June 2, 2012 (edited) armoros,Try using a button on the GUI which fires the _GUIFrame_SetSepPos function - something like this:#include <guiconstantsex.au3> #include <windowsconstants.au3> #include <winapi.au3> #include "GUIFrame.au3" Global $aSepPos[4] = [2, 100, 200, 300] $hGUI = GUICreate("GUI_Parent", 500, 500, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) ; Create a 1st level frame $iFrame = _GUIFrame_Create($hGUI, 1) _GUIFrame_SetSepPos($iFrame, 200) ;_GUIFrame_SetMin($iFrame, 100, 200) GUISetState(@SW_SHOW) $hTopFrame = _GUIFrame_GetHandle($iFrame, 1) _GUIFrame_Switch($iFrame, 1) GUICtrlCreateLabel("", 0, 0, 0, 0) $hGUI_Child = GUICreate("GUI_Child", 100, 100, 50, 50, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetBkColor(0xFF0000) _WinAPI_SetParent($hGUI_Child, $hTopFrame) GUISetState(@SW_SHOW) _GUIFrame_Switch($iFrame, 2) $cButton = GUICtrlCreateButton("Press", 0, 0, 40, 20) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cButton $aSepPos[0] = Mod($aSepPos[0] + 1, 3) _GUIFrame_SetSepPos($iFrame, $aSepPos[$aSepPos[0] + 1]) EndSwitch WEndHow is that? M23Edit:If you want to prevent the separator bar from being dragged manually, you will need to amend the UDF - comment out these lines:GUICtrlSetCursor(-1, 11) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Line 151 ; Subclass the separator ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Lines 170 to 178 If _GUIFrame_SepSubClass($hSeparator) = 0 Then ; If Subclassing failed then delete all GUIs and return error GUIDelete($hParent) GUIDelete($hSeparator) GUIDelete($hFirstFrame) GUIDelete($hSecondFrame) Return SetError(3, 0, 0) EndIf Edited June 2, 2012 by Melba23 Added code 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...
armoros Posted June 2, 2012 Author Share Posted June 2, 2012 (edited) Melba23 that is what i needed exactly. Thank you very much for the solution and the 2nd tip I hope to give something back in the future. Thank you again Melba Edited June 2, 2012 by armoros [font="verdana, geneva, sans-serif"] [/font] 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