robinsiebler Posted June 5, 2012 Posted June 5, 2012 I only want 1 at at time. How do I get 1 at a time? Do I kill the 1st form somehow?
Moderators Melba23 Posted June 5, 2012 Author Moderators Posted June 5, 2012 robinsiebler,You use GUIDelete to delete a GUI. You need to use _GUIExtender_Clear to reset the UDF and then you create your new GUI. That way both the GUIs can be extendable. You can do the same thing again if you need to create yet another GUI. The only stipulation is that the GUI needs to be recreated each time - you cannot just hide/show it. Post the GUI code you want to use and I will see if I can help you get it right. 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
robinsiebler Posted June 5, 2012 Posted June 5, 2012 I've attached the script. The 1st form you already helped me with, thank you ever so much! For the 2nd form, I am currently hiding and showing the controls I would like to extend (but it makes the form look awkward). You have to make the following choices to get the 2nd form to appear:Branch: Any choiceProduct: Citrix HDXComponent: Any ChoiceType: Any choiceOptions: Install a specific versionThe script needs this INI to run:[Config] Branch=Barrayar|Caprica|Trunk Product=C3 Communicator|Citrix HDX|Unified Component=RTME|RTC Type=Debug|Release Options=Install the latest build|Install a specific version|Browse for an installerBuild_Auto_Installer.au3
Moderators Melba23 Posted June 5, 2012 Author Moderators Posted June 5, 2012 (edited) robinsiebler, I will look at it tomorrow - it seems the weather will be too bad to go flying. M23 Edited June 5, 2012 by Melba23 Typo 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
robinsiebler Posted June 5, 2012 Posted June 5, 2012 (edited) I'm sorry to hear that. I take it you are a pilot? That must be cool! I got to fly in an F-16 once...I redesigned my 1st form a little and I really tried to merge the 2 forms together, but obviously I am missing something. The 1st (static) part of my form appeared correctly. But when I made the 2nd (expandable) section appear the form did not re-size and my 3rd (static) section got pushed off the bottom of the form.I'm going to give it 1 last try and if that doesn't work, I will need your help.Ok, I have my GUI design nailed down. I gave it another try, but I didn't fare any better than the last time.If you look at the form, all of the combo boxes are the static section. If you choose "Install a specific version" from the last combo box, you will see the controls appear. That is the section I want to be able to collapse/expand.The script is attached. Once again, you need the INI file to populate the combo boxes.[Config] Branch=Barrayar|Caprica|Trunk Product=Avistar C3 Communicator|Citrix HDX RealTime Media Engine|Citrix RealTime Connector|Avistar C3 Unified Type=Debug|Release Options=Install the latest build|Install a specific version|Browse for an installerBuild_Auto_Installer.au3 Edited June 6, 2012 by robinsiebler
robinsiebler Posted June 5, 2012 Posted June 5, 2012 When trying to determine the sizes of the sections, how do you do it? Is there some tool to help? Before I got your help on the 1st form, I just kept guessing and increasing the numbers.
Moderators Melba23 Posted June 6, 2012 Author Moderators Posted June 6, 2012 robinsiebler,Try this for size: expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=avistar.ico #AutoIt3Wrapper_Res_Description=This script will install the Avistar product the user selects after uninstalling the old version #AutoIt3Wrapper_Res_Fileversion=0.4.0.7 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #AutoIt3Wrapper_Res_LegalCopyright=Author: Robin Siebler #AutoIt3Wrapper_Res_Language=1033 #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker ://////=__= ://////=__= #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #comments-start ------------------------------------------------------------------------------- Name: Build Auto Installer Purpose: This script will install the Avistar product the user selects after uninstalling the old version Author: Robin Siebler Created: 6/1/2012 Version: 0.4 ------------------------------------------------------------------------------- #comments-end ; **** To Do: Add registry search for uninstall string ; Includes #include <file.au3> #include <array.au3> #include <date.au3> #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIButton.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include "GUIExtender.au3" Opt("GUIOnEventMode", 1) TraySetIcon(@ScriptDir & "avistar.ico", -1) ; Variables Global $BaseFolder, $Branch, $BuildFolder, $BuildFound, $BuildNo, $BuildType, $Installer, $NewestDir, $Options, $Product, $RelBuildNo, $Type, $_Product Local $IniFile = @ScriptDir & "Build_Auto_Installer.ini" Local $ConfigData = IniReadSection($IniFile, "Config") $BaseFolder = "hqfile04Buildreleases" ;----------------------- Build Selection Dialog ---- #Region ### START Koda GUI section ### Form=c:scriptsautoitbuild_auto_installerbuildselectiondialog.kxf $Form1 = GUICreate("Build Auto Installer", 366, 426) GUISetIcon(@ScriptDir & "avistar.ico", -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ProcessCancel") _GUIExtender_Init($Form1) ; Initialise the GUI GUICtrlCreateLabel("Please choose from the below options to install a build:", 25, 23, 321, 21) GUICtrlCreateLabel("Branch:", 25, 53, 51, 21) GUICtrlCreateLabel("Product:", 25, 92, 54, 21) GUICtrlCreateLabel("Options:", 25, 171, 53, 21) $CB_Branch = GUICtrlCreateCombo("", 84, 53, 259, 25, $CBS_DROPDOWNLIST) GUICtrlSetData($CB_Branch, $ConfigData[1][1]) $CB_Product = GUICtrlCreateCombo("", 84, 92, 259, 25, $CBS_DROPDOWNLIST) GUICtrlSetData($CB_Product, $ConfigData[2][1]) GUICtrlCreateLabel("Type:", 25, 132, 38, 21) $CB_Type = GUICtrlCreateCombo("", 84, 132, 259, 25, $CBS_DROPDOWNLIST) GUICtrlSetData($CB_Type, $ConfigData[3][1]) $CB_Options = GUICtrlCreateCombo("", 84, 171, 259, 25, $CBS_DROPDOWNLIST) GUICtrlSetOnEvent($CB_Options, "CB_OptionsChange") GUICtrlSetData($CB_Options, $ConfigData[4][1]) $1stSection = _GUIExtender_Section_Start(200, 100) ; Create section $Label1 = GUICtrlCreateLabel("Please enter the 3 digit build number:", 25, 214, 222, 20) ;GUICtrlSetState($Label1, $GUI_HIDE) $SpecificBuildNoInput = GUICtrlCreateInput("", 249, 211, 94, 24, $ES_NUMBER) GUICtrlSetLimit($SpecificBuildNoInput, 3, 3) ;GUICtrlSetState($SpecificBuildNoInput, $GUI_HIDE) $Group1 = GUICtrlCreateGroup("Build Type", 114, 244, 150, 46) $Radio1 = GUICtrlCreateRadio("Release", 130, 260, 60, 20) GUICtrlSetTip($Radio1, "Non 99.99.99 Build Number") GUICtrlSetOnEvent($Radio1, "Radio1Click") $Radio2 = GUICtrlCreateRadio("Trunk", 206, 260, 50, 20) GUICtrlSetTip($Radio2, "99.99.99 Build Number") GUICtrlSetOnEvent($Radio2, "Radio2Click") GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUICtrlSetState($Group1, $GUI_HIDE) ;GUICtrlSetState($Radio1, $GUI_HIDE) ;GUICtrlSetState($Radio2, $GUI_HIDE) _GUIExtender_Section_Action($1stSection) ; Make it dynamic _GUIExtender_Section_End() ; Close section $2ndSection = _GUIExtender_Section_Start(300, 50) ; Create section $Label2 = GUICtrlCreateLabel("Enter the Release Version Number:", 25, 313, 214, 20) ;GUICtrlSetState($Label2, $GUI_HIDE) $ReleaseNoInput = GUICtrlCreateInput("", 249, 313, 94, 24) ;GUICtrlSetState($ReleaseNoInput, $GUI_HIDE) _GUIExtender_Section_Action($2ndSection) ; Make it dynamic _GUIExtender_Section_End() ; Close section $5thSection = _GUIExtender_Section_Start(350, 75) ; Create section $Btn_OK = GUICtrlCreateButton("OK", 108, 360, 60, 31, $BS_NOTIFY) GUICtrlSetOnEvent($Btn_OK, "GetBuildOptions") $Btn_Cancel = GUICtrlCreateButton("Cancel", 196, 360, 61, 31, $BS_NOTIFY) GUICtrlSetOnEvent($Btn_Cancel, "ProcessCancel") _GUIExtender_Section_End() ; Close section _GUIExtender_Section_Extend($1stSection, False) ; Close dynamic section _GUIExtender_Section_Extend($2ndSection, False) ; Close dynamic section GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Loop = 1 While $Loop ; Wait for Build Selection Dialog to close Sleep(100) WEnd Select Case $Options = "Install the latest build" ;DetermineBuildFolder() Case $Options = "Install a specific version" ;FindSpecificBuild() Case $Options = "Browse for an installer" BrowseForInstaller() EndSelect ;UninstallProduct() ;InstallProduct() MsgBox(8256, "Installation Complete!", "The installation is complete!") Exit ; ----------------------------- Functions --------------------------- ; Browse for the installer Func BrowseForInstaller() $Installer = FileOpenDialog("Pick the installer you wish to use:", $BaseFolder & "" & $Branch, "Installers (*.msi)", 1+2) If @error Then $RtnVal = MsgBox(8228, "", "You did not chose a file. Abort the install?") If $RtnVal = 6 Then Exit ; Yes was clicked Else BrowseForInstaller() EndIf EndIf EndFunc ; Find the latest build Func DetermineBuildFolder($recurse = 0) ; $recurse will be set to 1 by FindPreviousBuild when a previous build folder is found If $recurse = 0 Then $BuildFolder = $BaseFolder & "" & $Branch ; 1st time through, point to the correct build path If $NewestDir = "" Then ; 1st time through, get the Newest Folder $NewestDir = NewestFolder($BuildFolder) If @error Then ; If NewestFolder() didn't error out, report the newest directory, otherwise, report the error. MsgBox(8240, 'Navigation Error', 'No folders were found in ' & $BuildFolder) Exit Else $BuildFolder = $BuildFolder & "" & $NewestDir & "" & $Type & "windows" ; a folder was found EndIf Else If $BuildNo = "" Then ; recurse, a Build No hasn't been found $BuildFolder = $BuildFolder & "" & $NewestDir & "" & $Type & "windows" Else ; there is a Build No to check $BuildFolder = $BuildFolder & "" & $Type & "windows" EndIf EndIf $RtnVal = FileFindFirstFile($BuildFolder & "" & $Product & "" & $Installer) ; Look for the Installer in the Product folder If Not ($RtnVal = -1) Then ; Found the Installer $BuildFolder = $BuildFolder & "" & $Product If Not ($BuildNo = "") Then $BuildFound = True Else ; See if there is an Experimental folder $RtnVal = FileFindFirstFile($BuildFolder & "Experimental" & $Product & "" & $Installer) If Not ($RtnVal = -1) Then ; Found the Installer in the Experimental Product folder $BuildFolder = $BuildFolder & "Experimental" & $Product If Not ($BuildNo = "") Then $BuildFound = True ; Found the Previous Build Else MsgBox(8240, "Missing Build!", "There was no " & $Product & " folder in " & _ $BuildFolder & " and there is no Experimental folder either. " & _ " This probably means there is no windows installer for this build." & _ @CRLF & @CRLF & "The script will now try to find the previous release.") FindPreviousBuild() ; Look for the Previous Build EndIf EndIf EndFunc ; Look for the Previous Build No Func FindPreviousBuild() ; Get the actual number part of the Build Folder Dim $aBuild = StringSplit($NewestDir, "-", 2) $BuildNo = $aBuild[1] If IsInt($BuildNo) Then MsgBox(8240, "Navigation Error!", "I should have a build number, but I do not!") EndIf $BuildNo = $BuildNo - 1 ; Previous Build No $BuildNo = $aBuild[0] & "-" & $BuildNo $BuildFolder = $BaseFolder & "" & $Branch & "" & $BuildNo $RtnVal = FileFindFirstFile($BuildFolder) If Not ($RtnVal = -1) Then ; This build number was skipped DetermineBuildFolder(1) Else $NewestDir = $BuildNo FindPreviousBuild() EndIf EndFunc ; Find the user specified build Func FindSpecificBuild() ; Full Build version example = 1.0.3r-575 (release) - 99.99.99r-575 (internal) If $BuildType = "Release" Then $BuildNo = $RelBuildNo & "-" & $BuildNo Else $BuildNo = "99.99.99r-" & $BuildNo EndIf $BuildFolder = $BaseFolder & "" & $Branch & "" & $BuildNo & "" & $Type & "windows" $RtnVal = FileFindFirstFile($BuildFolder & "" & $Product & "" & $Installer) ; Look for the Installer in the Product folder If Not ($RtnVal = -1) Then ; Found the Installer $BuildFolder = $BuildFolder & "" & $Product Else ; See if there is an Experimental folder $RtnVal = FileFindFirstFile($BuildFolder & "Experimental" & $Product & "" & $Installer) If Not ($RtnVal = -1) Then ; Found the Installer in the Experimental Product folder $BuildFolder = $BuildFolder & "Experimental" & $Product EndIf EndIf EndFunc ; Get and validate the build options provided by the user Func GetBuildOptions() ; Assign values $Branch = GUICtrlRead($CB_Branch) $Product = GUICtrlRead($CB_Product) $Type = GUICtrlRead($CB_Type) $Options = GUICtrlRead($CB_Options) ; Validate required fields If $Branch = "" Or $Product = "" Or $Type = "" Or $Options = "" Then MsgBox(8208, "Missing Selection!", "All ComboBoxes must have a value") Return EndIf ; Validate fields required for a specific build If $Options = "Install a specific version" Then $BuildNo = GUICtrlRead($SpecificBuildNoInput) If $BuildNo = "" Then MsgBox(8208, "Missing Selection!", "Please enter a Build Number!") Return ElseIf _GUICtrlButton_GetCheck($Radio1) = $BST_UNCHECKED AND _GUICtrlButton_GetCheck($Radio2) = $BST_UNCHECKED Then MsgBox(8208, "Missing Selection!", "Please select a Build Type!") Return ElseIf $BuildType = "Release" Then $RelBuildNo = GUICtrlRead($ReleaseNoInput) If $RelBuildNo = "" Then MsgBox(8208, "Missing Selection!", "Please enter a Release Build Number!") Return EndIf EndIf EndIf If $Product = "Citrix HDX RealTime Media Engine " Then $_Product = $Product ; all because the Folder name is different $Product = "Cixtrix HDX" $Installer = "Citrix HDX RealTime Media Engine.msi" ElseIf $Product = "Citrix RealTime Connector" Then $_Product = $Product ; all because the Folder name is different $Product = "Cixtrix HDX" $Installer = "HDX RealTime Connector LC.msi" EndIf GUISetState(@SW_HIDE, $Form1) $Loop = 0 ; If all of the options have been selected, exit the loop EndFunc ; Install the Product Func InstallProduct() If $BuildFound = True Then $RtnVal = MsgBox(8228, "Previous Build Found!", "A previous build was found - " & $BuildNo & ". Shall I install it?") If $RtnVal = 7 Then Exit ; No was clicked EndIf Dim $InstallString = 'MsiExec.exe /i "' & $BuildFolder & "" & $Installer & '" /passive' If $Product = "Citrix HDX" Then Dim $message = @CRLF & "Preparing to install Citrix " & $_Product Else Dim $message = @CRLF & "Preparing to install " & $Product EndIf SplashTextOn("", $message, 400, 80, -1, -1, 1) sleep(5000) SplashOff() RunWait(@ComSpec & " /c " & $InstallString, "", @SW_HIDE) EndFunc ; Find the newest folder in the build directory Func NewestFolder($Directory) $aFolders = _FileListToArray($Directory, '*', 2); Get a list of all the single level sub-folders in a specific folder If Not IsArray($aFolders) Then ; Check if we didn't find any folders, and return 0 with @error = 1 if we do not SetError(1) Return 0 EndIf _ArrayDelete($aFolders, 0) ; Remove the first entry containing the total number of entries Dim $aEPOCH[UBound($aFolders)][2] ; Create a 2d array to hold epoch time and the folder names For $a = 0 To UBound($aFolders) - 1 $aTime = FileGetTime($Directory & '' & $aFolders[$a], 1, 0) ; Get time folder was created in an array ($aTime) $aEPOCH[$a][0] = _DateDiff('s', "1970/01/01 00:00:00", $aTime[0] & '/' & $aTime[1] & '/' & $aTime[2] & ' ' & $aTime[3] & ':' & $aTime[4] & ':' & $aTime[5]) ; Convert to Epoch time $aEPOCH[$a][1] = $aFolders[$a] ; Store directory name Next _ArraySort($aEPOCH, 1) ; Sort the $aEPOCH array by EPOCH time, so index 0 contains the newest item Return $aEPOCH[0][1] ; Return the newest items directory name EndFunc ; The user clicked the Cancel button Func ProcessCancel() $RtnVal = MsgBox(8228, "Cancel Installation?", "Are you sure you want to cancel the installation?") If $RtnVal = 6 Then Exit ; Yes was clicked EndFunc Func UninstallProduct() If $Product = "Citrix HDX" Then Dim $message = @CRLF & "Preparing to uninstall " & $_Product Else Dim $message = @CRLF & "Preparing to uninstall " & $Product EndIf SplashTextOn("", $message, 400, 80, -1, -1, 1) sleep(5000) SplashOff() Select #cs Case $Product = "Citrix HDX" If $Component = "RTME" Then $UninstallString = "MsiExec.exe /passive /X{0EDD8CAB-7A46-4126-8B53-C3B3D600C0AB}" Else $UninstallString = "MsiExec.exe /passive /X{DDD10E6B-6100-4A16-BBFE-B7CEAEC2BB39}" EndIf RunWait(@ComSpec & " /c " & $UninstallString, "", @SW_HIDE) #ce Case $Product = "C3 Communicator" ;Put code here Case $Product = "Unified" ;Put code here EndSelect EndFunc ; ---------------------- Button Functions --------------------------- ; Trigger visibilty of the specific version controls Func CB_OptionsChange() Switch GUICtrlRead($CB_Options) Case "Install the latest build" _GUIExtender_Section_Extend($1stSection) ; Open dynamic section Case Else _GUIExtender_Section_Extend($1stSection, False) ; Close dynamic section EndSwitch #cs Select Case GUICtrlRead($CB_Options) = "Install the latest build" ;GUICtrlSetState($Label1, $GUI_HIDE) GUICtrlSetState($SpecificBuildNoInput, $GUI_HIDE) GUICtrlSetState($Group1, $GUI_HIDE) GUICtrlSetState($Radio1, $GUI_HIDE) GUICtrlSetState($Radio1, $GUI_UNCHECKED) GUICtrlSetState($Radio2, $GUI_HIDE) GUICtrlSetState($Radio2, $GUI_UNCHECKED) GUICtrlSetState($Label2, $GUI_HIDE) GUICtrlSetState($ReleaseNoInput, $GUI_HIDE) Case GUICtrlRead($CB_Options) = "Install a specific version" GUICtrlSetState($Label1, $GUI_SHOW) GUICtrlSetState($SpecificBuildNoInput, $GUI_SHOW) GUICtrlSetState($Group1, $GUI_SHOW) GUICtrlSetState($Radio1, $GUI_SHOW) GUICtrlSetState($Radio2, $GUI_SHOW) Case GUICtrlRead($CB_Options) = "Browse for an installer" ;GUICtrlSetState($Label1, $GUI_HIDE) GUICtrlSetState($SpecificBuildNoInput, $GUI_HIDE) ;GUICtrlSetState($Label1, $GUI_HIDE) GUICtrlSetState($SpecificBuildNoInput, $GUI_HIDE) GUICtrlSetState($Group1, $GUI_HIDE) GUICtrlSetState($Radio1, $GUI_HIDE) GUICtrlSetState($Radio1, $GUI_UNCHECKED) GUICtrlSetState($Radio2, $GUI_HIDE) GUICtrlSetState($Radio2, $GUI_UNCHECKED) GUICtrlSetState($Label2, $GUI_HIDE) GUICtrlSetState($ReleaseNoInput, $GUI_HIDE) EndSelect #ce EndFunc ; Trigger visibility of the Release Number controls Func Radio1Click() _GUIExtender_Section_Extend($2ndSection) ; Open dynamic section #cs If BitAnd(GUICtrlRead($Radio1),$GUI_CHECKED) = 1 Then $BuildType = 'Release' GUICtrlSetState($Label2, $GUI_SHOW) GUICtrlSetState($ReleaseNoInput, $GUI_SHOW) EndIf #ce EndFunc ; Trigger visibility of the Release Number controls Func Radio2Click() _GUIExtender_Section_Extend($2ndSection, False) ; Close dynamic section #cs If BitAnd(GUICtrlRead($Radio2),$GUI_CHECKED) = 1 Then $BuildType = 'Trunk' GUICtrlSetState($Label2, $GUI_HIDE) GUICtrlSetState($ReleaseNoInput, $GUI_HIDE) EndIf #ce EndFuncAnd to answer the other questions:- Yes I am a pilot, although today I would have been better served had I been a scuba diver! - The best way I have found to determine the size of the sections is to create the GUI with all the controls and then add the _GUIExtender_Section_Start lines. That way you can easily determine the start point and depth of each section. 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
robinsiebler Posted June 6, 2012 Posted June 6, 2012 Thanks! I'll give it a try. And I am a scuba diver. You should try it. There are awesome things to see, if you go to the right places.
Moderators Melba23 Posted June 6, 2012 Author Moderators Posted June 6, 2012 robinsiebler,I am a scuba diver. You should try itI have - but flying is even more awesome in my opinion. 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
robinsiebler Posted June 6, 2012 Posted June 6, 2012 No doubt! Like I said, I got to fly in an F-16 once and I will never forget it.I'm afraid I am still confused. _GUIExtender_Section_Start() only takes 2 numbers. If it was 4, I'd by fine, but I have no clue what the 2 numbers mean or how to determine them.
Moderators Melba23 Posted June 6, 2012 Author Moderators Posted June 6, 2012 robinsiebler, Just to make you jealous - I flew fighters all my active career. Now as a reservist I give air experience flights to young cadets - just as I began my flying more than 40 years ago. So the circle has closed in a very satisfactory manner. But enough about me. _GUIExtender_Section_Start() only takes 2 numbersI mentioned earlier that you need to read about the functions that you use and need to learn what the various parameters mean - have you looked at the function header within the UDF to see what those numbers are? ; #FUNCTION# ========================================================================================================= ; Name...........: _GUIExtender_Section_Start ; Description ...: Marks the start point of GUI section ; Syntax.........: _GUIExtender_Section_Start($iSection_Coord, $iSection_Size) ; Parameters ....: $iSection_Coord - Coordinates of left/top edge of section depending on orientation ; $iSection_Size - Width/Height of section So in your code the first is the distance down the GUI that the section starts and the second is the depth of the section. You will also notice that the next section starts at the sum of those 2 values for the section above. Clearer now? 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
robinsiebler Posted June 6, 2012 Posted June 6, 2012 I read it, I just didn't understand it. Your explanation helps, I think. I'll know for sure when I try it again.
Tippex Posted August 24, 2012 Posted August 24, 2012 The tab problem occurred because internal TabItems are given a ControlID by AutoIt, but do not actually exist as separate copntrols as far as Windows is concerned. The UDF now ignores them and just works with the Tab container.I have a problem using _GUIExtender UDF with GUICtrlCreateCombo controls in a Tab.actioning a section to remove a column works but was also expected to move a column of combos to take up the space, but it justs removes them too even though they aren't in the section. I have tried using _GUICtrlComboBox_Create to create the combos and _GUIExtender_UDFCtrlCheck to "register" them .... this works. However, I have to use GUICtrlCreateCombo instead because I'm using GUIGetCursorInfo() to fill in the values at the point they are being used since it makes my application appear to be more responsive than attempting to fill the combos when the application loads. I am using the latest _GUIExtender UDF and I have looked for inspiration in the example "GUIExtender_Example_Object_Tab.au3" but to no avail. The clue to my problem appears to be that I need some kind of _GUIExtender_UDFCtrlCheck function that will work for all controls not just UDF ones that I can use inside Tabs. Any ideas please?
Moderators Melba23 Posted August 24, 2012 Author Moderators Posted August 24, 2012 Tippex, Please post the code you are using - it is very hard to debug with just a brief description of the problem. 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
MrCreatoR Posted August 27, 2012 Posted August 27, 2012 (edited) This UDF does not supports more than one GUI? And also it's not working with controls created with UDF functions: expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include "GUIExtender.au3" $hGUI = GUICreate("Test", 300, 250) $iCreateGUI_Bttn = GUICtrlCreateButton('New GUI', 20, 190) _GUIExtender_Init($hGUI) _GUIExtender_Section_Start(0, 60) GUICtrlCreateGroup(" 1 - Static ", 10, 10, 280, 50) _GUIExtender_Section_Action(2, "", "", 270, 40, 15, 15) ; Normal button _GUIExtender_Section_End() _GUIExtender_Section_Start(60, 110) _GUICtrlListBox_Create($hGUI, 'test', 20, 70, 260, 50) _GUIExtender_Section_End() _GUIExtender_Section_Extend(4, False) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $iCreateGUI_Bttn $hGUI2 = GUICreate("Test", 300, 390) $iCreateGUI_Bttn = GUICtrlCreateButton('New GUI', 20, 190) _GUIExtender_Init($hGUI2) _GUIExtender_Section_Start(0, 60) GUICtrlCreateGroup(" 1 - Static ", 10, 10, 280, 50) _GUIExtender_Section_Action(2, "", "", 270, 40, 15, 15) ; Normal button _GUIExtender_Section_End() _GUIExtender_Section_Start(60, 110) GUICtrlCreateGroup(" 2 - Extendable ", 10, 70, 280, 100) _GUIExtender_Section_End() _GUIExtender_Section_Extend(4, False) GUISetState() EndSwitch _GUIExtender_Action($iMsg) ; Check for click on Action control WEnd ? And what about adding some handler to avoid the usage _GUIExtender_Action in the main loop? That way it will no matter if the code uses loop or event mode. Edited August 27, 2012 by MrCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Moderators Melba23 Posted August 28, 2012 Author Moderators Posted August 28, 2012 MrCreatoR,You are correct that the UDF will only work on 1 GUI at a time - see posts #44 and #102 above.You need to recreate the sectioned GUI each time - see the example script below. I have no plans at present to add support for multiple GUIs.But the UDF does indeed support UDF-created controls, see post #77 and the GUIExtender_UDF_Event.au3 and GUIExtender_UDF_Loop.au3 examples in the zip. The script you posted also has several problems which prevent the UDF from working as intended: - 1. You have controls located within a section but which are created outside the _GUIExtender_Section_Start/End statements for that section. The UDF is like a Tab control in this regard - it only automatically recognises controls that you create with the native GUICtrlCreate* funcions between those Start/End statements. If you create them outside those lines then the UDF does not know they exist. - 2. You did not continue creating sections up to the bottom of the GUI. Although you do not need to have a section at the very top of the GUI, once you start adding sections you need to continue to the very bottom. If not then the UDF become confused as to where sections begin and end. (For top/bottom you can read left/right if you extend in that direction)- 3. You only created 2 sections, but you used _GUIExtender_Section_Extend(4, False). Little point in doing so as there is no section 4.Here is an amended version of the script which I believe works as you intended: expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include "GUIExtender.au3" Global $hGUI, $hList, $iCreateGUI_Bttn, $hGUI2 ; Create the main GUI _Create_GUI() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hGUI Switch $aMsg[0] Case $GUI_EVENT_CLOSE Exit Case $iCreateGUI_Bttn ; Delete the main GUI GUIDelete($hGUI) ; Clear the UDF _GUIExtender_Clear() ; Create the second GUI _Create_GUI2() EndSwitch Case $hGUI2 Switch $aMsg[0] Case $GUI_EVENT_CLOSE ; Delete the second GUI GUIDelete($hGUI2) ; Clear the UDF _GUIExtender_Clear() ; Recreate the main GUI _Create_GUI() EndSwitch EndSwitch ; Check for click on Action control _GUIExtender_Action($aMsg[0]) ; Check UDF control visibility if an Action control was pressed If _GUIExtender_ActionCheck() Then ; Parameters: (Handle, Section, X-coord, Y-coord) - note coords are relative to the section, not the main GUI _GUIExtender_UDFCtrlCheck($hList, 2, 20, 10) EndIf WEnd Func _Create_GUI() $hGUI = GUICreate("Test", 300, 250) _GUIExtender_Init($hGUI) $iIndex = _GUIExtender_Section_Start(0, 60) GUICtrlCreateGroup(" 1 - Static ", 10, 10, 280, 50) _GUIExtender_Section_Action(2, "", "", 270, 40, 15, 15) ; Normal button _GUIExtender_Section_End() $iIndex = _GUIExtender_Section_Start(60, 110) _GUIExtender_Section_End() $iIndex = _GUIExtender_Section_Start(170, 90) ; Create native control within Section_Start/End $iCreateGUI_Bttn = GUICtrlCreateButton('New GUI', 20, 190) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUIExtender_Section_End() ;_GUIExtender_Section_Extend(4, False) ; <<<<<<<<<<<<<<<<<<<<< No value at all ; UDF-created control can go anywhere $hList = _GUICtrlListBox_Create($hGUI, 'test', 20, 70, 260, 50) ; <<<<<<<<<<<<<<<<<<<<<<<<< GUISetState() EndFunc ;==>_Create_GUI Func _Create_GUI2() $hGUI2 = GUICreate("Test", 300, 390) _GUIExtender_Init($hGUI2) _GUIExtender_Section_Start(0, 60) GUICtrlCreateGroup(" 1 - Static ", 10, 10, 280, 50) _GUIExtender_Section_Action(2, "", "", 270, 40, 15, 15) ; Normal button _GUIExtender_Section_End() _GUIExtender_Section_Start(60, 110) GUICtrlCreateGroup(" 2 - Extendable ", 10, 70, 280, 100) _GUIExtender_Section_End() _GUIExtender_Section_Start(170, 220) GUICtrlCreateGroup(" 3 - Static ", 10, 180, 280, 200) _GUIExtender_Section_End() GUISetState() EndFunc ;==>_Create_GUI2I take your point about adding a handler, but the _GUIExtender_Action statement is only required if you use the UDF-created action buttons in MessageLoop mode. I felt that adding a single line to an existing While...WEnd loop was no more trouble than adding a GUIRegisterMsg line (or another UDF function to do the same thing) and greatly reduced the chances of confliction with an existing message handler. It is a matter of opinion which way to go - I have explained the reasoning behind my choice. Does all that answer all your questions? 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
MrCreatoR Posted August 28, 2012 Posted August 28, 2012 (edited) You did not continue creating sections up to the bottom of the GUI. Although you do not need to have a section at the very top of the GUI, once you start adding sections you need to continue to the very bottom. If not then the UDF become confused as to where sections begin and endYou agree that this is not the best way of making UDF? it's not convenient for the end user.I felt that adding a single line to an existing While...WEnd loop was no more trouble than adding a GUIRegisterMsg line (or another UDF function to do the same thing) and greatly reduced the chances of confliction with an existing message handler.You can use subclassing to handle each extender control, no need to register native messages.P.S.Would you mind if i try to write my own extender UDF base on your idea? Edited August 28, 2012 by MrCreatoR Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Moderators Melba23 Posted August 28, 2012 Author Moderators Posted August 28, 2012 MrCreatoR,You agree that this is not the best way of making UDF?First define "best"!. It takes only 2 lines of code to add a static section which goes to the end of the GUI - I do not see that as particularly demanding for the user. You can use subclassing to handle each extender controlWhich I feel would greatly add to the complexity of the UDF code. As I explained above, I felt adding one line of code in a particular case was the best solution. And some users have had problem with my GUIFrames UDF when the subclassing does not work on their machines for some reason - I prefer to avoid such complex solutions if I can. Would you mind if i try to write my own extender UDF base on your idea?Of course not! Please feel free to use any of the code/ideas in this UDF. I look forward to seeing the result. 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
MrCreatoR Posted August 28, 2012 Posted August 28, 2012 First define "best"!I mean that it will be compatible with most of our scripts, and will not require special skills/knowledge to use the udf for complex scripts.I found this UDF very useful, but also i found few difficulties to use it with my projects (especially the part with one GUI at a time).Of course not! Please feel free to use any of the code/ideas in this UDF. I look forward to seeing the resultThanks you, credits of course will be added, but mostly i will use my UDF as a concept, it's already have the engine to adapt it as i see it for such extender UDF. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
Recommended Posts