Jump to content
Sign in to follow this  
RegularGuy

How do I create a wizard-like GUI

Recommended Posts

I have been trying to figure out the best way (practice) of preforming this task. I am still new to this all (auto it as well as programming) and I need some help. I'm creating a wizard that prompts the user for several peices of information and then returns an answer.

I have included this sample code of the method that I've begun using but I would like some feedback as to what I could do differently, because I know there is a better way that what I have here.

Global $GuiHeight = 400
Global $GuiWidth = 350
Global $ButtonWidth1 = 100
GLobal $NavButton = 75
Global $Centered = $GuiWidth/2-$ButtonWidth1/2
Global $NavCentered = $GuiWidth/2-$NavButton/2
GLobal $Left = 10
Global $Bottom = $GuiHeight-25-$Left
Global $Right = $GuiWidth-$NavButton-$Left

_Inception()

Func _Inception()
    Local $GuiDescription = "You're getting sleepy"
    GUICreate("",$GuiWidth,$GuiHeight)
    GUICtrlCreateLabel($GuiDescription,$Left,10)
    Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton)
    local $next = GUICtrlCreateButton("Next", $Right, $Bottom, $NavButton)
    GUICtrlCreateLabel("Level 1",$GuiWidth/2,$GuiHeight/2)

    GUISetState()

While 1
  Local $msg = GUIGetMsg()
  Switch $msg

     Case -3
        Exit

     Case $cancel
        Exit

     Case $next
        GUIDelete()
        _Inception2()

    EndSwitch
WEnd

EndFunc

Func _Inception2()
Local $GuiDescription = "Follow the White Rabbit."
GUICreate("",$GuiWidth,$GuiHeight)
GUICtrlCreateLabel($GuiDescription,$Left,10)
Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton)
Local $back = GUICtrlCreateButton("Back", $NavCentered,$Bottom,$NavButton)
local $next = GUICtrlCreateButton("Next", $Right, $Bottom, $NavButton)
GUICtrlCreateLabel("Level 2",$GuiWidth/2,$GuiHeight/2)
local $Button1 = Guictrlcreatebutton("Test 1",$Left,40,100)
local $Button2 = Guictrlcreatebutton("Test 2",$Centered,40,100)
local $Button3 = Guictrlcreatebutton("Test 3",$Right-25,40,100)

GUISetState()

While 1
  Local $msg = GUIGetMsg()
  Switch $msg

     Case -3
        Exit

     Case $cancel
        Exit

     Case $back
        GUIDelete()
        _Inception()

     Case $next
        GUIDelete()
        _Inception3()

  EndSwitch
WEnd

EndFunc

Func _Inception3()
Local $GuiDescription = "You are Fast asleep"
GUICreate("",$GuiWidth,$GuiHeight)
GUICtrlCreateLabel($GuiDescription,$Left,10)
Local $cancel = GUICtrlCreateButton("Cancel", $Left, $Bottom,$NavButton)
Local $back = GUICtrlCreateButton("Back", $NavCentered,$Bottom,$NavButton)
GUICtrlCreateLabel("Level 3",$GuiWidth/2,$GuiHeight/2)
local $Button1 = Guictrlcreatebutton("Test 1",$Left,100,100)
local $Button2 = Guictrlcreatebutton("Test 2",$Centered,70,100)
local $Button3 = Guictrlcreatebutton("Test 3",$Right-25,100,100)

GUISetState()

While 1
  Local $msg = GUIGetMsg()
  Switch $msg

     Case -3
         Exit

     Case $cancel
          Exit

     Case $back
        GUIDelete()
        _Inception2()

    EndSwitch
WEnd

EndFunc

Again, I know there is a better way.

Ideally, I liked what Valuater did in his Autoit 1-2-3 program where there was one window that changed as you hit next. I just don't know how to create something like that or, what I should even be looking for in order to study how to create that.

Thank you in advance!

EDIT> Edited code for clarity

Edited by RegularGuy

Share this post


Link to post
Share on other sites

What about something like this?

#include<WindowsConstants.au3>
Opt("GUIOnEventMode", 1)

Global $hStepGUIS[3]

$hGUI = GUICreate("MainGUI", 400, 400)
GUISetOnEvent(-3, "_Main_Exit")

$hStepGUIS[0] = GUICreate("Step1", 400, 370, 0, 0, $WS_CHILD, $WS_EX_CONTROLPARENT, $hGUI)
GUICtrlCreateButton("&Next", 10, 10, 100, 100)
GUICtrlSetOnEvent(-1, "Step1_Next")


$hStepGUIS[1] = GUICreate("Step2", 400, 370, 0, 0, $WS_CHILD, $WS_EX_CONTROLPARENT, $hGUI)
GUICtrlCreateButton("&Next", 200, 10, 100, 100)
GUICtrlSetOnEvent(-1, "Step2_Next")

$hStepGUIS[2] = GUICreate("Step3", 400, 370, 0, 0, $WS_CHILD, $WS_EX_CONTROLPARENT, $hGUI)
GUICtrlCreateButton("&Back To Start", 200, 200, 100, 100)
GUICtrlSetOnEvent(-1, "Step3_Next")


SwitchToStep(0)
GUISetState(@SW_SHOW, $hGUI)

While 1
    Sleep(100)
WEnd


Func Step1_Next()
    MsgBox(0, "", "Step1 Finished")
    SwitchToStep(1)
EndFunc

Func Step2_Next()
    MsgBox(0, "", "Step 2 stopped")
    SwitchToStep(2)
EndFunc

Func Step3_Next()
    MsgBox(0, "", "Go to beginning now")
    SwitchToStep(0)
EndFunc


Func SwitchToStep($step)
    Local $max = UBound($hStepGUIS) - 1
    If $step < 0 Or $step > $max Then Return SetError(1, 0, 0)
    For $i = 0 To $max
        If $i = $step Then
            GUISetState(@SW_SHOW, $hStepGUIS[$i])
            GUISwitch($hStepGUIS[$i])
        Else
            GUISetState(@SW_HIDE, $hStepGUIS[$i])
        EndIf
    Next
    Return 1
EndFunc

Func _Main_Exit()
    Exit
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Thank you for the post, sorry I didn't respond sooner. This is great for moving forward, could you please demonstrate how you would move backwards? ex. move from step 3 back to step two.

Also, would you recommend this for a wizard that has like 50 different GUI's (or at least different input pages)? That is about the amount that I am looking at creating

Share this post


Link to post
Share on other sites

Are you sure an 'installer like application' is the best route to take? Even Windows doesn't have that amount of pages to install the operating system.


UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_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: 22/04/2018

Share this post


Link to post
Share on other sites

Thank you for the post, sorry I didn't respond sooner. This is great for moving forward, could you please demonstrate how you would move backwards? ex. move from step 3 back to step two.

Also, would you recommend this for a wizard that has like 50 different GUI's (or at least different input pages)? That is about the amount that I am looking at creating

I showed only the next-Button, the Back-Button will be implemented the same way. Using SwitchToStep you can jump to any step you want.

For a 50-Page GUI, I would recommend an additional TreeView on the left side where you can manually jump to the pages

PS: An example of what I mean from monodevelop: http://monodevelop.com/@api/deki/files/189/=OptionsDialogReorg.png

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

The easiest way is to create a parent Gui and a bunch of child gui's, which in this case you just Hide and show them when moving to the next Child therefore you can just show Them again if you need to Go back The treeview idea was a good one, but instead of all that code Just use

For the "next" Buttons

Guisetstate($ChildGui1, @sw_hide) 
Guisetstate($ChildGui2, @sw_Show)

And for The "Back Buttons"

Guisetstate($ChildGui1, @sw_Show) 
Guisetstate($ChildGui2, @sw_Hide)

This way you don't need to use all that code, plus its easier to understand.

Edited by ac1dm4nner

[u]My dream is to have a dream...[/u]

Share this post


Link to post
Share on other sites

ac1dm4nner,

There is an "Edit" button on your posts - start using it please. :oops:

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

The easiest way is to create a parent Gui and a bunch of child gui's, which in this case you just Hide and show them when moving to the next Child therefore you can just show Them again if you need to Go back The treeview idea was a good one, but instead of all that code Just use

For the "next" Buttons

Guisetstate($ChildGui1, @sw_hide)
Guisetstate($ChildGui2, @sw_Show)

And for The "Back Buttons"

Guisetstate($ChildGui1, @sw_Show)
Guisetstate($ChildGui2, @sw_Hide)

This way you don't need to use all that code, plus its easier to understand.

That is exactly what my code is doing. I just manage the child GUIs in an array and use a function to switch between them.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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  

  • Similar Content

    • By secman
      Hi,
      I have an issue with a script being used for a Toddler group register. 
      I list the kids, with their carer and additional carer in ComboLists so a number of carers can be registered per kid. 
      When page down to a second page of kids, the carers are correctly displayed but when I roll the mouse over the combo boxes it reverts to those on the first page.
      I am using the following style codes with the combo boxes - BitOR($CBS_DROPDOWN, $CBS_SIMPLE) and they are only holding 2 or 3 entries.
      Here is the code for the pagedisplay function which is called for each line of the registration page (10 lines, currently 55 kid records)) 
      Func PageDisp($L)
      ;Clears display once all records displayed
          If $L > $KidsFound Then
              $Label2[$L] = GUICtrlCreateLabel(" ", 75, $v, 280, 29)
              $Label352[$L] = GUICtrlCreateLabel("", 1040, $v, 100, 29)
              $Label152[$L] = GUICtrlCreateLabel("", 380, $v, 220, 29)
              $Label252[$L] = GUICtrlCreateLabel("",  650, $v, 220, 29);
              Return
          Endif
          $Kid2d = $Kid1d[$L] ; sets value to find additional carers
      If $Kid1a[$L] <> "" then
          $Label2[$L] = GUICtrlCreateLabel("(" & $L & ")" & $Kid1a[$L] & " " & $Kid1b[$L] , 75, $v, 280, 29)
          GUICtrlSetFont(-1, 14, 400, 0, "Segoe UI")
              If $Kid1e[$L] <> "" then
                  $Combo[$L] = GUICtrlCreateCombo("(" & $L & ")"  & $Kid1e[$L], 380, $v, 220, 29, BitOR($CBS_DROPDOWN, $CBS_SIMPLE ))
                  GUICtrlSetData(-1, $Kid1e[$L] & "|" & $Kid1f[$L], $Kid1e[$L])
                  GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI")
                  GUICtrlSetBkColor(-1, 0xFFFFFF)
                  $Label352[$L] = GUICtrlCreateLabel($Kid1c[$L], 1040, $v, 100, 29)
                  if $Kid1f[$L] <> "" then
                      FindCarer($Kid2d) ;finds additional carers 
                      $Combo2[$L] = GUICtrlCreateCombo("(" & $L & ")" & "",  650, $v, 220, 29, BitOR($CBS_DROPDOWN,$CBS_SIMPLE ))
                      GUICtrlSetData(-1, $Combo2List[$L], "")
                      GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI")
                      GUICtrlSetBkColor(-1, 0xFFFFFF)
                      If StringRight($Kid1e[$L],3) = "[L]" Then
                          $Label152[$L] = GUICtrlCreateLabel("", 380, $v, 220, 29)
                          $Label252[$L] = GUICtrlCreateLabel("Leader",  650, $v, 220, 29);
                          GUICtrlSetColor(-1, 0x0000FF)
                      Endif
                  Else
                      $Label252[$L] = GUICtrlCreateLabel("(" & $L & ")" & " No Additional Carers",  650, $v, 220, 29);
                  EndIf
              EndIf
              GUICtrlSetFont(-1, 12, 400, 0, "Segoe UI")
              GUICtrlSetBkColor(-1, 0xFFFFFF)
              CheckReg()
              If $Kid1c[$L] = "Registered" Then
                  $Label52[$L] = GUICtrlCreateLabel($Kid1c[$L], 1040, $v, 100, 29)
                  $Label152[$L] =GUICtrlCreateLabel ($Kid1f[$L],  650, $v, 220, 29);
                  GUICtrlSetFont(-1, 14, 400, 0, "Segoe UI")
                  GUICtrlSetBkColor(-1, 0xFFFFFF)
                  If StringRight($Kid1e[$L],3) = "[L]" Then
                      $Label252[$L] = GUICtrlCreateLabel("", 380, $v, 220, 29)
                      $Label152[$L] = GUICtrlCreateLabel("Leader",  650, $v, 220, 29);
                      GUICtrlSetColor(-1, 0x0000FF)
                  Endif
              Endif
          Endif
      EndFunc
      I hope someone can point me in the right direction as I can't see how this is happening
      Many thanks 
    • By Fenzik
      Hello,
      i searched the forum for something near, but with no success...
      I have Combobox control with $CBS_DROPDOWNLIST style with some items (for example (one, two, nine).
      When i want to select the item, using keyboard, the items are selected only on First letter base (for example when i type "on", Nine is selected).
      Is there some trick to force the combobox with $CBS_DROPDOWNLIST style to accept more than the First letter during selecting the items from the list?
      Mi wanted result is the same as for example - when you type "fir" on the desktop, Firefox is automatically selected.
      Thank you so much.
      Fenzik
    • By t0nZ
      Often I need to create a panel to monitor a lot of things (users, files, items etc) so I use this piece of code to create a dynamic grid of buttons.
      The number of buttons is variable, and it's related to the size of the gui. 
      Every "button" is a set of three with a real button stacked on the top of two labels, imagine reading a .CSV file or an array or a database and displaying all the things using the labels (Text and COLOR too) and clickin' on the relative button you can call further info on the item or call a particular function.
      So you can decide the number of the buttons, the width of the buttons, and also the distance  between buttons.
      It's quick and dirty, simple  and very improvable (I know..) so fell free to play with the code.
       
      ;TEST ;GOL-Grill ;Grill test/template ; (c) 2019 NSC ; V.0.5 #Region ;************ Includes ************ #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <ProgressConstants.au3> #include <_GOLLOG.au3>; NSC first UDF #EndRegion ;************ Includes ************ Dim $agButton[1] Global $ButtonU, $rProgress, $form1, $labeltot, $ntotButtonS Global $guiwidth = 850, $guiheight = 500, $buttonW = 150 ; SMALL GUI / BIG BUTTONS ;Global $guiwidth = 1500, $guiheight = 1000, $buttonW = 45 ; BIG GUI / SMALL BUTTONS <- try it ! Global $ver = "V.0.5" Gollog(">>>>> START") Dim $aResult[11] = [10, "a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] Gui() Gollog("start analyzing...") Monitor() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CLOSEClicked() Exit Case $ButtonU Monitor() Case Else For $i = 1 To $ntotButtonS If $nMsg = $agButton[$i] Then $Bhit = GUICtrlRead($agButton[$i]) infoB($Bhit) EndIf Next EndSwitch WEnd Func Gui() $form1 = GUICreate("Test Griglia " & $ver & " (c) NSC 2019", $guiwidth, $guiheight, 90, 10) $ButtonU = GUICtrlCreateButton("Update", 2, 2, 170, 50) $labeltot = GUICtrlCreateLabel("Total found", 5, 55) $Gollogedit = GUICtrlCreateEdit("", 2, $guiheight - 255, 180, 250, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER)) $rProgress = GUICtrlCreateProgress($guiwidth - 18, 5, 16, $guiheight - 7, BitOR($PBS_SMOOTH, $PBS_VERTICAL, $WS_BORDER)) GUICtrlSetColor(-1, 0x00FF00) GUICtrlSetBkColor(-1, 0x000000) GUISetState(@SW_SHOW) EndFunc ;==>Gui Func Monitor() GUIDelete($form1) Gui() $leftSTART = 186 ;left align $topSTART = 5 ;start from top $lineDOWN = 53 ; line distance $extraHSTEP = 5 ; extra line distance $buttonSEMIH = 15 ; height of one of the 3 vertical impiled semibuttons $separatorSEMIH = 2 ;vertical distance between 3 semibuttons $buttonDistance = 7 ;horizontal distance between buttons $separatorW = 2 ;aux horizontal distance ;---------- derived measures $rightLIMIT = $guiwidth - 123 ; right limit befor Carriage Return $leftINCREMENT = $buttonDistance + $buttonW ; horizontal increment button after button $leftSTEP = $leftSTART ;incremental horizontal $topSTEP = $topSTART ;incremental vertical $foundB = $aResult[0] GUICtrlSetData($labeltot, "Found n°" & $foundB) $ntotButtonS = 0 $nomorebuttons = 0 For $i = 1 To $foundB Local $itemFound = $aResult[$i] ;\TA1000 Gollog($itemFound) GUICtrlCreateGroup('', $leftSTEP, $topSTEP - 3, $buttonW + 3, 50) ;______first-----------------------------_______line___________________UNO________11111_____\\\\\\\\\\------------ Local $textbutton = "button n°" & $i _ArrayAdd($agButton, GUICtrlCreateButton($textbutton, $leftSTEP + $separatorSEMIH, $topSTEP + $extraHSTEP, $buttonW, $buttonSEMIH, $BS_flat)) GUICtrlSetBkColor(-1, 0xccffcc) ;green, sort of GUICtrlSetFont(-1, 7, -1, -1, 'verdana') GUICtrlSetColor(-1, 0x000000) ;___second__________line___________________DUE ________222222-------------------------------------------------------------------- Local $textLINE2 = $itemFound GUICtrlCreateLabel($textLINE2, $leftSTEP + $separatorW, $topSTEP + $buttonSEMIH + $separatorSEMIH, $buttonW, $buttonSEMIH, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetBkColor(-1, 0xD2D7A8) GUICtrlSetFont(-1, 7, -1, -1, 'verdana') GUICtrlSetColor(-1, 0x000000) ; __third______line________tre___________________________________________________________333333-3333333-333333333-333333-33333-33333-3333-------------------------------- Local $textLINE3 = "line3" GUICtrlCreateLabel($textLINE3, $leftSTEP + $separatorW, $topSTEP + $buttonSEMIH + $buttonSEMIH + $separatorSEMIH, $buttonW, $buttonSEMIH, BitOR($SS_CENTER, $SS_CENTERIMAGE)) ; NSC modify GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetFont(-1, 7, -1, -1, 'verdana') GUICtrlSetColor(-1, 0x000000) $ntotButtonS += 1 GUICtrlSetData($rProgress, (100 * $ntotButtonS / $foundB)) If $leftSTEP + $buttonW < $rightLIMIT Then ; $leftSTEP += $leftINCREMENT ;53 Else $leftSTEP = $leftSTART $topSTEP += $lineDOWN If $topSTEP >= $guiheight - 50 Then $nomorebuttons = 1 Gollog("displayed " & $ntotButtonS & " buttons") Gollog("NO more buttons !") EndIf EndIf Sleep(300) ; REMOVE is only for demo Next While $nomorebuttons = 0 ; draw empty buttons (nice to do) $ntotButtonS += 1 _ArrayAdd($agButton, GUICtrlCreateButton("B-" & $ntotButtonS, $leftSTEP + $separatorSEMIH, $topSTEP + $extraHSTEP, $buttonW, $buttonSEMIH, $BS_flat)) If $leftSTEP + $buttonW < $rightLIMIT Then ; $leftSTEP += $leftINCREMENT Else $leftSTEP = $leftSTART $topSTEP += $lineDOWN If $topSTEP >= $guiheight - 50 Then $nomorebuttons = 1 Gollog("displayed " & $ntotButtonS & " buttons") Gollog("NO more buttons !") EndIf EndIf WEnd GUISetState(@SW_SHOW) EndFunc ;==>Monitor Func infoB($Bhit) ; this function act on the pressed button, it's an example so assign the task you need. gollog("infoB -> " & $Bhit) EndFunc ;==>infoB Func CLOSEClicked() MsgBox(64, "exit", "program exiting", 1) Gollog("<---STOP") Exit EndFunc ;==>CLOSEClicked You will need also the Include from this post for the LOG (Gollog) instructions, but you can also just remove the gollog and the EDIT box.
      Look at the screenshot, It's from an APP made using this code.

    • By therks
      I'm trying to implement a scrolling list of controls. I have it sort of working using the GUIScrollBars_Ex UDF by @Melba23 found here. I also want to be able to tab through the controls, which I have accomplished by adding $WS_EX_CONTROLPARENT to the child GUI. The problem is that with that style applied, the scrollbar doesn't act like a scrollbar, instead it acts as a title bar to the child GUI letting you drag the it around (and you can even "maximize" it by double clicking).
      Any ideas?
      #include <GUIConstants.au3> #include "GUIScrollbars_Ex.au3" $iButtonCount = 30 $hParent = GUICreate('Example', 300, 230) $hChild = GUICreate('', 300, 200, 0, 0, BitOR($WS_CHILD, $WS_TABSTOP), $WS_EX_CONTROLPARENT, $hParent) For $i = 0 To $iButtonCount GUICtrlCreateButton('Button in list', 0, $i*30, 300, 30) Next GUISwitch($hParent) GUICtrlCreateButton('More Buttons', 0, 200, 150, 30) GUICtrlCreateButton('More Buttons', 150, 200, 150, 30) GUISetState(@SW_SHOW, $hParent) GUISetState(@SW_SHOW, $hChild) _GUIScrollbars_Generate($hChild, 100, $iButtonCount * 30+20) While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd  
    • By Saravanan2213
      Hi everyone,
      i just need your help. i have script for cleaning browsing history and other unwanted file but the problem is i don't want to see the GUI i have attached below. It should not show anything on the screen. is it possible to do it in autoit. thanks in advance.
       
      So for i have tried flag
      Run("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", "", @SW_HIDE)
      @SW_DISABLE
       
      Looking forward your help.........

×
×
  • Create New...