Sign in to follow this  
Followers 0
apex52

How can I create a simple installer

4 posts in this topic

How can I create a simple gui box with a button which when pressed changes the gui without launching an entirely new one, like if I wanted to add a new button or change what the original button said. Similar to the way a installer works when navigating through the menu's. Thanks.

Share this post


Link to post
Share on other sites



What have you coded so far?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

How about something like this? A little technical for someone who is new to AutoIt, but you get the point.

#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>

Example()

Func Example()
    Local $aArray[11] = [10], $hGUI, $iBack, $iHeight = 500, $iIndex = 0, $iNext, $iTab, $iWidth = 500

    $hGUI = GUICreate("", $iWidth, $iHeight)

    $iBack = GUICtrlCreateButton("Back", $iWidth - 180, $iHeight - 30, 85, 25)
    $iNext = GUICtrlCreateButton("Next", $iWidth - 90, $iHeight - 30, 85, 25)

    $iTab = GUICtrlCreateTab(-99, -99, 0, 0) ; Create a Tab group.
    For $i = 1 To $aArray[0]
        GUICtrlCreateTabItem($i)
        GUICtrlCreateLabel('Page ' & $i, 10, 10)
    Next
    GUICtrlCreateTabItem("") ; Close the Tab group.

    _Toggle_EnableOrDisable($iBack, 0) ; Disable the back button.

    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop

            Case $iBack
                If $iIndex = ($aArray[0] - 1) Then ; Enabled the next button if the index is currently at the maximum number of tabs minus 1.
                    _Toggle_EnableOrDisable($iNext, 1) ; Enable the next button.
                EndIf

                $iIndex -= 1 ; Decrease the item index.
                If $iIndex <= 0 Then ; Disable the back button if the index is less than the number of tab items.
                    $iIndex = 0
                    _Toggle_EnableOrDisable($iBack, 0) ; Disable the back button.
                EndIf
                GUICtrlSendMsg($iTab, $TCM_SETCURFOCUS, $iIndex, 0)

            Case $iNext
                $iIndex += 1 ; Increase the item index.
                If $iIndex = 1 Then
                    _Toggle_EnableOrDisable($iBack, 1) ; Enable the back button if the index is equal to 1.
                EndIf

                If $iIndex >= ($aArray[0] - 1) Then ; Disable the next button if the index is greater than the number of tab items minus 1.
                    $iIndex = ($aArray[0] - 1)
                    _Toggle_EnableOrDisable($iNext, 0) ; Disable the next button.
                EndIf
                GUICtrlSendMsg($iTab, $TCM_SETCURFOCUS, $iIndex, 0)

        EndSwitch
    WEnd
EndFunc   ;==>Example

Func _Toggle_EnableOrDisable($iControlID, $iOverride = -1) ; By guinness.
    Local $aState[2] = [$GUI_ENABLE, $GUI_DISABLE]
    If $iOverride > -1 Then
        $iOverride = Number(Not $iOverride)
    Else
        $iOverride = Number(BitAND(GUICtrlGetState($iControlID), $aState[0]) = $aState[0])
    EndIf
    GUICtrlSetState($iControlID, $aState[$iOverride])
EndFunc   ;==>_Toggle_EnableOrDisable

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0