Achilles Posted June 20, 2007 Posted June 20, 2007 (edited) expandcollapse popup;=============================================================================== ; ; Description: Returns a value based on which of radio buttons is selected ; Syntax: _RadioOptionBox($title, $message, $width = 300, $guiOnEvent = False, $rad_0, $rad_1, $rad_2 = '', ..., $rad_10 = '') ; Parameter(s): $title: the title of the window ; $message: the message shown inside the window ; $guiOnEvent: if GuiOnEventMode is active set this to True in order to restore GuiEventMode (Has to be declared) ; $rad0: the text to be shown for the first radio button ; $rad1: the text to be shown for the second radio button ; ... ; $rad10: the text to be shown for the eleventh radio button ; Requirement(s): #include <GUIConstants.au3> ; Return Value(s): Returns -1 if any of the required parameters is left blank ; Returns 0 if Exit or Cancel was clicked ; Returns 0 if the first radio button is selected ; Returns 1 if the second radio button is selected ; ... ; 10 if the eleventh radio button is selected ; Author(s): Piano_Man ; Note(s): Rad one is the default ; ;=============================================================================== Func _RadioOptionBox($title, $message, $rad_0, $rad_1, $rad_2 = '', $rad_3 = '', $rad_4 = '', $rad_5 = '', $rad_6 = '', $rad_7 = '', $rad_8 = '', $rad_9 = '', $rad_10 = '') Local $width = 300 Local $i_UBound = @NumParams - 3 Local $rad[$i_UBound] If $title = '' then Return -2 If $message = '' then Return -2 If $rad_0 = '' then Return -2 If $rad_1 = '' then Return -2 $guiOnEvent = Opt('GUIOnEventMode', 0) $optionGui = GuiCreate($title, $width, 100 + (@NumParams - 3) * 25, -1, -1, $DS_SETFOREGROUND) GuiSetFont(13, 400, '', 'Timer New Roman') GuiCtrlCreateLabel($message, 5, 5, $width - 10, 25, $SS_CENTER) For $i_Index = 0 To $i_UBound - 1 $rad[$i_Index] = GuiCtrlCreateRadio(Eval("rad_" & String($i_Index)), 15, $i_Index * 25 + 30, 270, 25) Next $cancel = GuiCtrlCreateButton('Cancel', $width / 2 - 90, ($i_UBound) * 25 + 40, 80, 25) $ok = GuiCtrlCreateButton('Ok', $width / 2 + 10, ($i_UBound) * 25 + 40, 80, 25) GuiSetState() While 1 Switch GuiGetMsg() Case $GUI_EVENT_CLOSE $return = -1 ExitLoop Case $cancel $return = -1 ExitLoop Case $ok For $a = 0 to $i_UBound If GuiCtrlRead($rad[$a]) = $GUI_CHECKED then $return = $a ExitLoop 2 EndIf Next EndSwitch WEnd GuiDelete() If $guiOnEvent then ConsoleWrite(Opt('GUIOnEventMode', 1)) Return $return EndFuncoÝ÷ Ø·é'£!jܨºØbB-ßÛjÇ¡ûax ëk «y«^¬§^o Úâ¥i«nN&¦Ê'²ajy,¶b}Äv+Gz··öƧ{¦¦WºÚ"µÍÚ[ÛYH ÑÕRPÛÛÝ[Ë]LÉÝÂÌÍÜÜÈHÔY[ÓÜ[ÛÞ ÌÎNÑÚÝÜ ÌÎNË ÌÎNÕÚ]ÛÝ[[ÝHZÙHÈÛÚÈÜÉÌÎNËYK ÌÎNÕ[YIÌÎNË ÌÎNÕÉÌÎNË ÌÎNÔÙYIÌÎNË ÌÎNÒÝÉÌÎNË ÌÎNÕÉÌÎNË ÌÎNÕÛÜÜÉÌÎNË ÌÎNÉÌÌÎÉÌÌÎÉÌÌÎÉÌÎNÊBÙØÞ ÌÎNÕHÝ[ ÌÎNË ÌÍÜÜÊ Edited June 20, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Valuater Posted June 20, 2007 Posted June 20, 2007 you use this Opt('GUIOnEventMode', 0) then this If $guiOnEvent then Opt('GUIOnEventMode', 1) that won't work... but this might $guiOnEvent = Opt('GUIOnEventMode', 0) then If $guiOnEvent then Opt('GUIOnEventMode', 1) 8)
Achilles Posted June 20, 2007 Author Posted June 20, 2007 you use thisOpt('GUIOnEventMode', 0)then thisIf $guiOnEvent then Opt('GUIOnEventMode', 1)that won't work... but this might$guiOnEvent = Opt('GUIOnEventMode', 0)thenIf $guiOnEvent then Opt('GUIOnEventMode', 1)8)The "Opt('GUIOnEventMode', 0)" just makes sure that GuiEventMode is off, that doesn't matter if it's on or off already...The later "If $optGuiEvent..." just turns GuiEVentMode back on if the user specifies that GuiEventMode is true (that's done in the parameters) My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Gif Posted June 20, 2007 Posted June 20, 2007 And my autoit tags aren't working add them youself with using this [autoit][/autoit] the button is not working yet the tags do
Achilles Posted June 20, 2007 Author Posted June 20, 2007 add them youself with using this [autoit][/autoit] the button is not working yet the tags doOk, that worked... thanks My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now