Sign in to follow this  
Followers 0
wander

Combo Box Question

12 posts in this topic

Hello. I have create an language select menu, i want when the user selects Spanish, the spanish GUI to show up, when the English is selected the English GUI to show up.

This is what i've done so far

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>


$Form = GUICreate("Choose Your Language", 440, 96, 293, 204)
GUISetBkColor(0x747474)
$Language = GUICtrlCreateCombo("", 288, 32, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "English|Spanish")
$Label1 = GUICtrlCreateLabel("Choose Your Language//Seleccione lenguaje", 0, 32, 263, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
$Continue = GUICtrlCreateButton("Continue", 168, 64, 83, 25, 0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Continue
    EndSwitch
WEnd

Help me please.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Use Switch GUICtrlRead($Language) to determine what to do for which selection has been selected

Edited by snowmaker

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

How i don't understand sry?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>


$Form = GUICreate("Choose Your Language", 440, 96, 293, 204)
GUISetBkColor(0x747474)
$Language = GUICtrlCreateCombo("", 288, 32, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "English|Spanish")
$Label1 = GUICtrlCreateLabel("Choose Your Language//Seleccione lenguaje", 0, 32, 263, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
$Continue = GUICtrlCreateButton("Continue", 168, 64, 83, 25, 0)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Continue
            
        Case $nMsg = $Language
            $lg = GUICtrlRead ($Language)
            Select
                Case $lg = "English"
                    GUICtrlSetData($Continue,"Continue")
                    GUICtrlSetData($Label1,"Choose Your Language//Seleccione lenguaje")
                    WinSetTitle($Form,"","Choose Your Language")
                Case $lg = "Spanish"
                    GUICtrlSetData($Continue,"Continuar")
                    GUICtrlSetData($Label1,"Seleccione lenguaje//Choose Your Language")
                    WinSetTitle($Form,"","Elija su idioma")
            EndSelect
    EndSelect
WEnd

something like this

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Thank you guys, you realy helped me. Can you tell me how can i make it: When i select the English Language, the form appears, but the language selection form is still there, how can i make it to close after i choose?

Share this post


Link to post
Share on other sites

Thank you guys, you realy helped me. Can you tell me how can i make it: When i select the English Language, the form appears, but the language selection form is still there, how can i make it to close after i choose?

Define 'make it close'

posible solutions if i understand

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Continue
            
        Case $nMsg = $Language
            $lg = GUICtrlRead ($Language)
            Select
                Case $lg = "English"
                    GUICtrlSetData($Continue,"Continue")
                    GUICtrlSetData($Label1,"Choose Your Language")
                    GUICtrlSetState($Language,$GUI_HIDE)
                    WinSetTitle($Form,"","Choose Your Language")
                Case $lg = "Spanish"
                    GUICtrlSetData($Continue,"Continuar")
                    GUICtrlSetData($Label1,"Seleccione lenguaje")
                    GUICtrlSetState($Language,$GUI_HIDE)
                    WinSetTitle($Form,"","Elija su idioma")
            EndSelect
    EndSelect
WEnd

or GUICtrlSetState($Language,$GUI_DISABLE)


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

The Language form is not closing (exiting) after i press Continu/Continuar

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
Global Const $Ini = @ScriptDir & "\Settings.ini"
Global Const $dir = IniReadSection($ini, "Directory")
Local $SavePath
$Form = GUICreate("Choose Your Language", 440, 96, 293, 204)
GUISetBkColor(0x747474)
$Language = GUICtrlCreateCombo("", 288, 32, 145, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "English|Spanish")
$Continue = GUICtrlCreateButton("Continue", 168, 64, 83, 25, 0)
$Label1 = GUICtrlCreateLabel("Choose Your Language//Seleccione lenguaje", 0, 32, 263, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Continue
            $check = GuiCtrlRead($Continue)
            Select
                Case $check = "Continue"
                    English()
                Case $check = "Continuar"
                    Spanish()
            EndSelect       
        Case $nMsg = $Language
            $lg = GUICtrlRead ($Language)
            Select
                Case $lg = "English"
                    GUICtrlSetData($Continue,"Continue")
                    GUICtrlSetData($Label1,"Choose Your Language")
                    GUICtrlSetState($Language,$GUI_HIDE)
                    WinSetTitle($Form,"","Choose Your Language")
                Case $lg = "Spanish"
                    GUICtrlSetData($Continue,"Continuar")
                    GUICtrlSetData($Label1,"Seleccione lenguaje")
                    GUICtrlSetState($Language,$GUI_HIDE)
                    WinSetTitle($Form,"","Elija su idioma")
            EndSelect
    EndSelect
WEnd



Func English()
$FormEnglish = GUICreate("Vitality Aion Launcher by Crowen", 798, 624, 190, 120)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\My Documents\Моите получени файлове\Launcher Background.JPG", 0, 0, 796, 620, 0)
If FileExists ($ini) Then
$SavePath = GUICtrlCreateInput(IniRead($Ini, "Vitality Aion Directory", "Directory", ""), 8, 552, 201, 21)
Else
$SavePath = GUICtrlCreateInput("", 8, 552, 201, 21)
EndIf   
$Browser = GUICtrlCreateButton("...", 248, 552, 43, 17, 0)
GUICtrlSetBkColor(-1, 0x808080)
GUICtrlSetCursor (-1, 0)
$Vote = GUICtrlCreateButton("Vote", 528, 520, 75, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$WebPage = GUICtrlCreateButton("Web Page", 528, 544, 75, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Forum = GUICtrlCreateButton("Forum", 528, 568, 75, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Launch = GUICtrlCreateButton("Launch Vitality Aion", 272, 584, 155, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Verdana")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0xBEBEBE)
GUICtrlSetCursor (-1, 0)
$Pic2 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\Desktop\selectdir - eng.jpg", 8, 528, 292, 20, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Vote
            VoteEng()           
        Case $WebPage
        WebPage()
        Case $Forum
        Forum()
        Case $Launch
        Launch()
    Case $Browser
            $get = FileSelectFolder('Please select a directory', @DesktopDir, 5, GUICtrlRead($SavePath), $Form)
            If Not @error Then
                GUICtrlSetData($SavePath, $get)
                IniWrite($Ini, "Vitality Aion Directory", "Directory", GUICtrlRead($SavePath))
            EndIf
    EndSwitch
WEnd
EndFunc
Func Launch()
EndFunc
    



Func Spanish()
$FormSpain = GUICreate("Vitality Aion Launcher por Crowen", 800, 622, 190, 120)
$Pic1 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\My Documents\Моите получени файлове\Launcher Background.JPG", 0, 0, 796, 620)
GUICtrlCreateInput("", 8, 552, 201, 21)
$Browser = GUICtrlCreateButton("...", 248, 552, 43, 17, 0)
GUICtrlSetBkColor(-1, 0x808080)
$Vote = GUICtrlCreateButton("Vota", 512, 520, 91, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$WebPage = GUICtrlCreateButton("Pagina oficial", 512, 544, 91, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Forum = GUICtrlCreateButton("Foro", 512, 568, 91, 25, 0)
GUICtrlSetFont(-1, 8, 800, 2, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Launch = GUICtrlCreateButton("Jugar Vitality Aion", 272, 584, 155, 25, 0)
GUICtrlSetFont(-1, 10, 800, 0, "Verdana")
GUICtrlSetColor(-1, 0x00FFFF)
GUICtrlSetBkColor(-1, 0xBEBEBE)
$Pic2 = GUICtrlCreatePic("C:\Documents and Settings\Administrator\Desktop\selectdir - spanish.jpg", 8, 528, 292, 20, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

EndFunc

Share this post


Link to post
Share on other sites

i see now what you need :)

While 1
    $nMsg = GUIGetMsg()
    Select
        Case $nMsg = $GUI_EVENT_CLOSE
            Exit
        Case $nMsg = $Continue
            $check = GuiCtrlRead($Continue)
            Select
                Case $check = "Continue"
                    GUIDelete($Form)
                    English()
                Case $check = "Continuar"
                    GUIDelete($Form)
                    Spanish()
            EndSelect       
        Case $nMsg = $Language
            $lg = GUICtrlRead ($Language)
            Select
                Case $lg = "English"
                    GUICtrlSetData($Continue,"Continue")
                    GUICtrlSetData($Label1,"Choose Your Language")
                    WinSetTitle($Form,"","Choose Your Language")
                Case $lg = "Spanish"
                    GUICtrlSetData($Continue,"Continuar")
                    GUICtrlSetData($Label1,"Seleccione lenguaje")
                    WinSetTitle($Form,"","Elija su idioma")
            EndSelect
    EndSelect
WEnd

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Thank man you realy helped me. One final question. I have a vote GUI. I want to make SOMEthing like this

Vote ( button, when you have clicked it, the button becomes grey, and you can vote again after 12 hours, below the button it () it will say you can vote again after 12hours,11hours etc)

can you help me ?

Edited by wander

Share this post


Link to post
Share on other sites

youl need _Timer_Diff for that

Example

#include <Timers.au3>
If IniRead("test.ini", "test1", "time", "NotFound") = "" Then
    IniWrite("test.ini", "test1", "time", _Timer_Init())
EndIf

HotKeySet("{ESC}", "_Quit")
$starttime = IniRead("test.ini", "test1", "time", "NotFound")

While 1
    $d = StringSplit(_Timer_Diff($starttime),".")
    ToolTip(StringLeft($d[1],StringLen($d[1])-3))
    If _Timer_Diff($starttime) > 12*1000 Then ;for 12h its          If _Timer_Diff($starttime) > 12*60*60*1000
        IniWrite("test.ini", "test1", "time", _Timer_Init())
        $starttime = IniRead("test.ini", "test1", "time", "NotFound")
    EndIf
WEnd

Func _Quit()
    Exit
EndFunc   ;==>_Quit

test.ini

[test1]

time=


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

i am big noob in autoit how can i apply it to this script, so the buttons to activate only per 12 hours ?

Func VoteEng()
$VoteForm = GUICreate("Vitality Aion Launcher - Voting Addon by Crowen", 422, 584, 193, 122)
GUISetIcon("D:\003.ico")
FileInstall("C:\Documents and Settings\Administrator\My Documents\Reciver Files\votingaddon.bmp", @TempDir & "\votingaddon.bmp")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\Top Of Games.gif", @TempDir & "\Top Of Games.gif")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\XtremeTop100.jpg", @TempDir & "\XtremeTop100.jpg")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\Aion Top List.bmp", @TempDir & "\Aion Top List.bmp")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\Aion Top 200.gif", @TempDir & "\Aion Top 200.gif")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\Aion Top.bmp", @TempDir & "\Aion Top.bmp")
FileInstall("C:\Documents and Settings\Administrator\Desktop\Vit Aion Vote Addon\Vote Pics\MMO Top 250.bmp", @TempDir & "\MMO Top 250.bmp")
$Pic1 = GUICtrlCreatePic(@TempDir & "\votingaddon.bmp", 0, 0, 420, 580, 0)
$Pic2 = GUICtrlCreatePic(@TempDir & "\Top Of Games.gif", 152, 256, 100, 44, 0)
$Pic3 = GUICtrlCreatePic(@TempDir & "\XtremeTop100.jpg", 24, 256, 100, 44, 0)
$Pic4 = GUICtrlCreatePic(@TempDir & "\Aion Top List.bmp", 24, 392, 100, 44, 0)
$Pic5 = GUICtrlCreatePic(@TempDir & "\Aion Top 200.gif", 152, 392, 100, 44, 0)
$Pic6 = GUICtrlCreatePic(@TempDir & "\Aion Top.bmp", 280, 392, 100, 44, 0)
$Pic7 = GUICtrlCreatePic(@TempDir & "\MMO Top 250.bmp", 280, 256, 100, 44, 0)
$Button1 = GUICtrlCreateButton("Vote", 40, 328, 75, 25, 0)
GUICtrlSetBkColor(-1, 0xB4B4B4)
GUICtrlSetCursor (-1, 0)
$Button2 = GUICtrlCreateButton("Vote", 168, 464, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Button3 = GUICtrlCreateButton("Vote", 296, 328, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Button4 = GUICtrlCreateButton("Vote", 40, 464, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Button5 = GUICtrlCreateButton("Vote", 168, 328, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
$Button6 = GUICtrlCreateButton("Vote", 296, 464, 75, 25, 0)
GUICtrlSetBkColor(-1, 0x878787)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    Case $Button1
        Xtreme()    
    Case $Button2
        AionTop200()
    Case $Button3
        MMOTop()
    Case $Button4
        AionTopList()
    Case $Button5
        TopOfGames()
    Case $Button6
        AionTop()
    EndSwitch
WEnd
EndFunc

Share this post


Link to post
Share on other sites

>_< nobody can help me

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