Sign in to follow this  
Followers 0
lokster

Multi InputBox

13 posts in this topic

#1 ·  Posted (edited)

This functions displays a dialog with multiple input boxes and returns array with the entered values. Based on _RadioOptionBox() by Piano_Man

Posted Image

;===============================================================================
;
; Description:      Multiple InputBox
; Syntax:           _InputBoxM($title, $message,  $label0, $input0,..., $label10='',$input10='')
; Parameter(s):     $title: the title of the window
;                    $message: the message shown inside the window
;                    $label0: the text to be shown for the first label
;                    $edit0: the default text to be shown in the firs input box
;                    ...
;                    $label10: the text to be shown for the eleventh label
;                    $edit10: the default text to be shown in the eleventh input box
; Requirement(s):   None
; Return Value(s):  Returns array of strings entered in the GuiInputs
;                   Returns -1 on Cancel
;                   Returns -2 on error
; Author(s):        lokster
; Note(s):          based on _RadioOptionBox() by Piano_Man
;
;===============================================================================
Func _InputBoxM($title, $message, _
        $label_0, $input_0, _
        $label_1= '', $input_1= '', _
        $label_2= '', $input_2 = '', _
        $label_3= '', $input_3 = '', _
        $label_4= '', $input_4 = '', _
        $label_5= '', $input_5 = '', _
        $label_6= '', $input_6 = '', _
        $label_7= '', $input_7 = '', _
        $label_8= '', $input_8 = '', _
        $label_9= '', $input_9 = '', _
        $label_10= '', $input_10 = '' _
    )
    
    
    If Mod(@NumParams - 2,2)<>0 Then
        MsgBox(0x10,"Error","Incorrect number of parameters!")
        Return -2
    EndIf
    
    Local $width = 300
    Local $i_UBound = (@NumParams - 2)/2
    Local $input[$i_UBound]
    Local $label[$i_UBound]
    Local $result[$i_UBound]
    If $title = '' then Return -2
    If $message = '' then Return -2
    If $label_0 = '' then Return -2
        
    $guiOnEvent = Opt('GUIOnEventMode', 0)
    
    $optionGui = GuiCreate($title, $width, 100 + ((@NumParams - 2)/2) * 45, -1, -1, $DS_SETFOREGROUND)
    
    GuiCtrlCreateLabel($message, 5, 5, $width - 10, 30, $SS_CENTER)
    
    For $i_Index = 0 To $i_UBound - 1
        
        $label[$i_Index] = GUICtrlCreateLabel(Eval("label_" & String($i_Index)), 5, 40+ $i_Index * 45, 285)
        $input[$i_Index] = GUICtrlCreateInput(Eval("input_" & String($i_Index)), 5, 40+ $i_Index * 45+20, 285)
    Next
    
    $ok = GuiCtrlCreateButton('OK', $width / 2 - 90, ($i_UBound) * 45 + 45, 80, 25)
    $cancel = GuiCtrlCreateButton('Cancel', $width / 2 + 10, ($i_UBound) * 45 + 45, 80, 25)
    
    GuiSetState()
    
    While 1
        Switch GuiGetMsg()
            Case $GUI_EVENT_CLOSE
                $result = -1
                ExitLoop
            Case $cancel
                $result = -1
                ExitLoop
            Case $ok
                For $a = 0 to $i_UBound - 1
                        $result[$a]=GUICtrlRead($input[$a])
                Next
                ExitLoop
        EndSwitch
    WEnd
    
    GuiDelete()
    Opt('GUIOnEventMode', $guiOnEvent)
    Return $result
EndFuncoÝ÷ ØLZ^jëh×6#include <GUIConstants.au3>
#include <Array.au3>
$pass = _InputBoxM('Multiple input', 'Enter the values', 'X value', '1', 'Y value', '2', 'Z value', '3')

_ArrayDisplay($pass)
Edited by lokster

Share this post


Link to post
Share on other sites



Dude I couldnt definately use this.. I just don't understand how to make this work?

Would definately make this code look better.

Func CreateLogin()
;-----Create DellServ Login------
MsgBox(0,"Alert&#ÌÎÉ][ÝË   ][ÝÔXÙH[[Ý[ÙÙÚ[[É][ÝÊBÌÍÑ[Ù6W&F&÷ÒçWD&÷gV÷C´FVÆÅ6W'bW6W"BgV÷C²ÂgV÷CµÆV6RVçFW"W6W"ÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì¤)%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí±±MÉÙ1½¥¸ÅÕ½;, "Dellservid", $DellServUseridbox)
$DellServPassbox =[]Þ
    ][ÝÑ[ÙÜÝÛÜ   ][ÝË  ][ÝÔXÙH[ÜÝÛÜ ][ÝËgV÷C²gV÷C²ÂgV÷C²¢gV÷C²¤æw&FRb33c´fÆUôÆö6FöâÂgV÷C´FVÆÅ6W'dÆöv¸ÅÕ½Ðì°ÅÕ½Ðí±±ÍÉÙÁÍÌÅÕ½Ðì°ÀÌØí±±MÉÙAÍͽà¤(ÀÌØí±±MÉÙ  ebox   = InputBox("DellServ Badge Id", "Enter Badge Number&q[ÝË   ][ÝÉ][ÝÊB[UÜ]J ÌÍÑ[WÓØØ][Û  ][ÝÑ[ÙÙÚ[][ÝËgV÷C´FVÆÇ6W'f&FvRgV÷C²Âb33c´FVÆÅ6W'd&FvV&÷¤×6t&÷#c##ÂgV÷C´w&VÐÌÌìÅÕ½Ðì°ÅÕ½Ðí±±MÉØ1½¥¸MÙÌÌìÅÕ½Ðì°Ì¤((ì´´´´µ
ÉÑ
¥ÑÉ¥àogin------
MsgBox(0,"Alert!","Please Enter your Citrix LÙÚ[[É][ÝÊBÌÍÐÚ]^ÙÞH[]Þ
    ][ÝÐÚ]^ÙÚ[][ÝË   V÷CµÆV6RVçFW"W6W"æÖRgV÷C²ÂgV÷C²gV÷C²¤æw&FRb33c´fÆUôÆö6Fö°ÅÕ½Ðí
¥ÑÉ¥á1½¥¸ÅÕ½Ðì°ÅÕ½Ðí
¥ÑÉ¥áÕÍÈÅÕ½Ðì°ÀÌØí
¥ÑÉ¥áÕÍɽà¤(À6;Citrixpassbox = InputBox("Citrix Login", "Please enter PasÝÛÜ ][ÝË  ][ÝÉ][ÝË    ][ÝÊ][ÝÊB[UÜ]J ÌÍÑ[WÓØØ][Û  ][Ý´6G&ÆövâgV÷C²ÂgV÷C´6G&72gV÷C²Âb33c´6G&76&÷¤×6t&÷#c#Àà°ÅÕ½ÐíÉÐÌÌìÅÕ½Ðì°ÅÕ½Ðí
¥ÑÉ¥à1½¥¸MÙÌÌìÅÕ½Ðì°Ì¤((ì´´´´µ
Éte Dell Connect Login------
MsgBox(0,"Alert!","Please En[Ý[ÛÛXÝÙÚ[[É][ÝÊBÌÍÔÑÕÙÞH[]Þ
    ][ÝÑÆÂ6öææV7BÆövâgV÷C²ÂgV÷CµÆV6RVçFW"W6W"æÖRgV÷C²ÂgV÷C²gV÷C²¤¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí±±
½¹¹ÐÅÕ½Ðì°ÅÕ½Ðí±±
½¹¹ÑUÍÈuot;, $SDCUserbox)
$SDCPassbox = InputBox("Dell Connect Logi][ÝË ][ÝÔXÙH[ÜÝÛÜ ][ÝË  ][ÝÉ][ÝË    ][ÝÊ][ÝÊB[U&FRb33c´fÆUôÆö6FöâÂgV÷C´FVÆÄ6öææV7BgV÷C²ÂgV÷C´FVÆÄ6öææV7E72gVÐì°ÀÌØíM
AÍͽà¤)5Í ½à ÈØÈÈÀà°ÅÕ½ÐíÉÐÌÌìÅÕ½Ðì°ÅÕ½Ðí±°
½¹¹t Login Saved!",3)

;-----Create Etime Login-----
MsgBox(0,"A ÌÌÎÉ][ÝË  ][ÝÔXÙH[[Ý][YHÙÚ[[É][ÝÊBÌÍÑ][YU6W&&÷ÒçWD&÷gV÷C´WFÖRÆövâgV÷C²ÂgV÷CµÆV6RVçFW"W6W"æÖRgV÷ì°ÅÕ½ÐìÅÕ½Ðì¤)%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½ÐíÑ¥µÅÕ½Ðì°ÅÕ½ÐíÑ¥eUser", $EtimeUserbox)
$EtimePassbox = InputBox("Etime ÙÚ[][ÝË ][ÝÔXÙH[ÜÝÛÜ ][ÝË  ][ÝÉ][ÝË    ][ÝÊ][ÝÊBæw&FRb33c´fÆUôÆö6FöâÂgV÷C´WFÖRgV÷C²ÂgV÷C´WFÖU72gV÷C²Âb3ØíÑ¥µAÍͽà¤)5Í  ½à ÈØÈÈÀà°ÅÕ½ÐíÉÐÌÌìÅÕ½Ðì°ÅÕ½ÐíÑ¥µ1½¥¸MÙ!",3)

EndFunc ;==>Create Login

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Dude I couldnt definately use this.. I just don't understand how to make this work?

Would definately make this code look better.

Like this I think

==========================================================

$pass = _InputBoxM("Alert!","Please Enter your DellServ Login Info","DellServ User ID","","DellServ Password", "","DellServ Badge Id", "")

IniWrite($File_Location, "DellServLogin", "Dellservid", $pass[0])

IniWrite($File_Location, "DellServLogin", "Dellservpass", $pass[1])

IniWrite($File_Location, "DellServLogin", "Dellservbadge", $pass[2])

=============================================================

@lokster: Good function.

The input form needs to be a tad higher because the buttons are a bit cramped at the bottom. (XP)

Maybe you could add a custom icon too.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

When I hit cancel on the InputBox, program crashes with the error below. When I comment out "$result = -1" on Cancel and Close, the program does not crash, just continues. Now this wouldn't be a problem, except when I hit Cancel on Set Resolution, it still says the Resolution has been set. I want it to not do that if Cancel is hit. But it just continues the code instead.

CODE
: ==> Subscript used with non-Array variable.:

IniWrite($File_Location, "DellServLogin", "Dellservid", $mDellservpass[0])

IniWrite($File_Location, "DellServLogin", "Dellservid", $mDellservpass^ ERROR

When I hit OK, it works just like it should.

Any ideas?

Func _InputBoxM($title, $message, _
        $label_0, &#036Ú[]Ì ÌÍÛX[ÌOH    ÌÎNÉÌÎNË  ÌÍÚ[]ÌOH    ÌÎNÉÌÎNËÂb33c¶Æ&VÅó#Òb33²b33²Âb33c¶çWEó"Òb33²b33²Âð¢b3ÌØí±±|ÌôÌäìÌäì°ÀÌØí¥¹ÁÕÑ|ÌôÌäìÌäì°|(ÀÌØí±±|Ð '', $input_4 = '', _
        $label_5= '&#39Ë   ÌÍÚ[]ÍHH    ÌÎNÉÌÎNË    ÌÍÛX[ÍH ÌÎNÉÌÎNË  ÌÍÚ[WEóbÒb33²b33²Âð¢b33c¶Æ&VÅósÒb33²b33²Âb33c¶çWEórÒb3äìÌäì°|(ÀÌØí±±|àôÌäìÌäì°ÀÌØí¥¹ÁÕÑ|àôÌäìÌäì°|        $label_9= '', $input_9 = '', _
        &#ÍÛX[ÌLH    ÌÎNÉÌÎNË  ÌÍÚ[]ÌLH    ÌÎNÉÌÎNÈÂ
BbÖöBçVÕ&×2Ò"Ã"fÇC²fwC³FVà¢×6t&÷ÂgV÷C´W'&÷"gV÷C°ÅÕ½Ðí%¹½ÉÉйյȽÁɵÑÉÌÌÌìÅÕ½Ðì¤(IÑÕɸ´È(¹f
    
    Local $width = 300
    Local $i_UBound = (@NumParams -KÌØØ[ ÌÍÚ[]ÉÌÍÚWÕPÝ[BØØ[   ÌÍÛX[ÉÌÍÚWÕP÷VæEТÆö6Âb33c·&W7VÇE²b33c¶õT&÷VæEТbb33c·FFÆRÒb33²b33Ñ¡¸IÑÕɸ´È(%ÀÌØíµÍÍôÌäìÌäìÑ¡¸IÑÕɸ´È(6;label_0 = '' then Return -2
        
    $guiOnEvent = Opt(&ÌÎNÑÕRSÛ][[ÙIÌÎNË
B   ÌÍÛÜ[ÛÝZHHÝZPÜX]J   ÌÍÝ]Âb33c·vGF²çVÕ&×2Ò"ó"¢CRÂÓÂÓÂb33c´E5õ4UDdõ$Tu$õ9¤((Õ¥
Ñɱ
ÉÑ1° ÀÌØíµÍÍ°Ô°Ô°ÀÌØíÝ¥Ñ ´ÄÀ°ÌÀ°#036;SS_CENTER)
    
    For $i_Index = 0 To $i_UBound - 1
        ÌÍÛX[ÉÌÍÚWÒ[^HHÕRPÝÜX]SX[
][
    ][ÝÛX[gV÷C²fײ7G&ærb33c¶ôæFWÂRÂC²b33c¶ôæFW¢CRÂ#R¢ÀÌØí¥¹ÁÕÑlÀÌØí¥}%¹átôU%
Ñɱ
ÉÑ%¹ÁÕСٰ ÅÕ½Ðí¥¹ÁÕÑ|ÅÕ½Ðìp; String($i_Index)), 5, 40+ $i_Index * 45+20, 285)
    Next
        ÌÍÛÚÈHÝZPÝÜX]P]Û   ÌÎNÓÒÉÌÎNË  ÌÍÝÚYÈHL
    Ì3c¶õT&÷VæB¢CR²CRÂÂ#R¢b33c¶6æ6VÂÒwV7G&Ä7&VFT'WGFöâb33
¹°Ìäì°ÀÌØíÝ¥Ñ ¼È¬ÄÀ° ÀÌØí¥}U    ½Õ¹¤¨ÐÔ¬ÐÔ°àÀ°ÈÔ¤(    GuiSetState()
    
    While 1
        Switch GuiGetMsg()
            CÙH    ÌÍÑÕRWÑUSÐÓÔÑBÉÌÍÜÝ[HLBBBBQ^]ÛÜ66Rb33c¶6æ6VÀ¢²b33c·&W7VÇBÒÓ¢á¥Ñ1½½À(
ÍÀÌØí½¬(½ÈÀÌØíôÀѼ36;i_UBound - 1
                        $result[$a]=GUICtrlRead(&ÌÍÚ[]ÉÌÍØWJB^^]ÛÜæE7vF6¢tVæ@¢¢wVFVÆWFR¢÷Bb33´uTöäWfVçDÖöFRb33²Âb3ÌØíÕ¥=¹Ù¹Ð¤(IÑÕɸÀÌØíÉÍÕ±Ð)¹Õ¹()Õ¹
ÉÑ1½¥¸ ¤(ì´´´´µ
Éate DellServ Login------
;~ MsgBox(0,"Alert!","Please En[Ý[ÙÙÚ[[É][ÝÊBß  ÌÍÑ[ÙÙYÞH[]Þ
    V÷C´FVÆÅ6W'bW6W"BgV÷C²ÂgV÷CµÆV6RVçFW"W6W"BgV÷C²ÂgV÷C²gV÷C²íø%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí±±MÉÙ1½¥¸ÅÕ½Ðì°ÅÕ½Ðí±±ÍÉÙ¥", $DellServUseridbox)
;~ $DellServPassbox = InputBox("[ÙÜÝÛÜ ][ÝË  ][ÝÔXÙH[ÜÝÛÜ ][ÝË  ][ÝÉ][ÝË    ]÷C²¢gV÷C²£·âæw&FRb33c´fÆUôÆö6FöâÂgV÷C´FVÆÅ6W'dÆövâgV÷C²ÂgVÐí±±ÍÉÙÁÍÌÅÕ½Ðì°ÀÌØí±±MÉÙAÍͽà¤(íøÀÌØí±±MÉÙ    ½àônputBox("DellServ Badge Id", "Enter Badge Number", &quoÉ][ÝÊBß[UÜ]J  ÌÍÑ[WÓØØ][Û  ][ÝÑ[ÙÙÚ[][ÝË    ][ÝFVÆÇ6W'f&FvRgV÷C²Âb33c´FVÆÅ6W'd&FvV&÷£·â×6t&÷#c##ÂgV÷C´w&VBb3ÌìÅÕ½Ðì°ÅÕ½Ðí±±MÉØ1½¥¸MÙÌÌìÅÕ½Ðì°Ì¤((ÀÌØíµ±±ÍÉÙÁÍÌô}%putBoxM("DellServ Login","Please Enter your DellServ Login IÉ][ÝË   ][ÝÑ[ÙÙQ    ][ÝË  ][ÝÉ][ÝË    ][ÝÑ[ÙÜÝÛÜ   V÷C²ÂgV÷C²gV÷C²ÂgV÷C´FVÆÅ6W'b&FvRBgV÷C²ÂgV÷C²gV÷C² ¤æw&FRÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí±±MÉÙ1½¥¸ÅÕ½Ðì°ÅÕ½Ðí±±ÍÉÙ¥ÅÕ½Ðì°ÀÌ;mDellservpass[0])
IniWrite($File_Location, "DellServLogin",   ][ÝÑ[ÙÜÉ][ÝË ÌÍÛQ[ÙÜÖÌWJB[]J   ÌÍÑ[WÓØØ]öâÂgV÷C´FVÆÅ6W'dÆövâgV÷C²ÂgV÷C´FVÆÇ6W'f&FvRgV÷C²Âb33c¶ÔFVÆÇ6W'gÍÍlÉt¤(((ì´´´´µ
ÉÑ
¥ÑÉ¥à1½¥¸´´´´´´(íø5Í   ½à À°ÅÕ½Ðí±ÉÐÌÌìÅÕ½Ðì"Please Enter your Citrix Login Info")
;~ $Citrixuserbox = I]Þ
    ][ÝÐÚ]^ÙÚ[][ÝË   ][ÝÔXÙH[Ù[YI][ÝË  ][ÝgV÷C²£·âæw&FRb33c´fÆUôÆö6FöâÂgV÷C´6G&ÆövâgV÷C²ÂgV÷C´6G¥áÕÍÈÅÕ½Ðì°ÀÌØí
¥ÑÉ¥áÕÍɽà¤(íøÀÌØí
¥ÑÉ¥áÁÍͽàô%¹ÁÕÑ ½à ÅÕ½Ðíitrix Login", "Please enter Password", "","*&][ÝÊBß[UÜ]J ÌÍÑ[WÓØØ][Û  ][ÝÐÚ]^ÙÚ[][ÝË   ][ÝÐÚ]72gV÷C²Âb33c´6G&76&÷£·â×6t&÷#c##ÂgV÷C´w&VBb333²gV÷C²ÂgÕ½Ðí
¥ÑÉ¥à1½¥¸MÙÌÌìÅÕ½Ðì°Ì¤((ÀÌØíµ
¥ÑÉ¥áÁÍÌô}%¹ÁÕÑ    ½á4 ÅÕ½Ðíitrix Login","Please Enter your Citrix Login Info","PleÙH[Ù[YI][ÝË  ][ÝÉ][ÝË    ][ÝÔXÙH[ÜÝÛÜ ][ÝË  V÷C²gV÷C² ¤æw&FRb33c´fÆUôÆö6FöâÂgV÷C´6G&ÆövâgV÷C²ÂgV÷C´6ÑÉ¥áÕÍÈÅÕ½Ðì°ÀÌØíµ
¥ÑÉ¥áÁÍÍlÁt¤)%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí
trixLogin", "Citrixpass", $mCitrixpass[1])


;-----CreaH[ÛÛXÝÙÚ[KKKKKBßÙÐÞ
    ][ÝÐ[ ÌÌÎÉ][ÝË  ][ÝÔXÙHVçFW"÷W"FVÆÂ6öææV7BÆövâæfògV÷C²£·âb33cµ4D5W6W&&÷ÒçWD&÷g½Ðí±°
½¹¹Ð1½¥¸ÅÕ½Ðì°ÅÕ½ÐíA±Í¹ÑÈUÍÈ9µÅÕ½Ðì°ÅÕ½ÐìÅÕ½;)
;~ IniWrite($File_Location, "DellConnect", "DellConnXÝÙ][ÝË ÌÍÔÑÕÙÞ
Bß ÌÍÔÑÔÜØÞH[]Þ
    ][ÝÑ[öææV7BÆövâgV÷C²ÂgV÷CµÆV6RVçFW"77v÷&BgV÷C²ÂgV÷C²gV÷C²ÂgV÷C²¢ÅÕ½Ðì¤(íø%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½Ðí±±
½¹¹ÐÅÕ½Ðì°ÅÕ½Ðí±±onnectPass", $SDCPassbox)
;~ MsgBox(262208,"Great!"   ][ÝÑ[ÛÛXÝÙÚ[Ø]Y ÌÌÎÉ][ÝËÊBÌÍÛTÑÜÜÈHÒ[]ÞJ    V÷C´FVÆÂ6öææV7BÆövâgV÷C²ÂgV÷CµÆV6RVçFW"÷W"FVÆÂ6öææV7BÆövâæ¼ÅÕ½Ðì°ÅÕ½ÐíA±Í¹ÑÈUÍÈ9µÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíA±Í¹ÑÈassword", "")

IniWrite($File_Location, "DellConneÝ   ][ÝË  ][ÝÑ[ÛÛXÝÙ][ÝË  ÌÍÛTÑÜÜÖÌJB[UÜ]J   ÌÍÑ[UôÆö6FöâÂgV÷C´FVÆÄ6öææV7BgV÷C²ÂgV÷C´FVÆÄ6öææV7E72gV÷C²Âb33c¶Õ4DÁÍÍlÅt¤((ì´´´´µ
ÉÑÑ¥µ1½¥¸´´´´´(íø5Í ½à À°ÅÕ½Ðí±ÉÐÌÌìÅÕ½Ðì°quot;Please Enter your Etime Login Info")
;~ $EtimeUserbox = InpuÞ
    ][ÝÑ][YHÙÚ[][ÝË   ][ÝÔXÙH[Ù[YI][ÝË  ][ÝÉ][C²£·âæw&FRb33c´fÆUôÆö6FöâÂgV÷C´WFÖRgV÷C²ÂgV÷C´WFÖUW6W"gV÷ì°ÀÌØíÑ¥µUÍɽà¤(íøÀÌØíÑ¥µAÍͽàô%¹ÁÕÑ    ½à ÅÕ½ÐíÑ¥µ1½¥¸Åot;, "Please enter Password", "","*")
;~ IniW]J   ÌÍÑ[WÓØØ][Û  ][ÝÑ][YI][ÝË    ][ÝÑ][YTÜÉ][ÝË    ÌÍÑ]ÖU76&÷£·â×6t&÷#c##ÂgV÷C´w&VBb333²gV÷C²ÂgV÷C´WFÖRÆövâ6fVBÌÌìÅÕ½Ðì°Ì¤((ÀÌØíµÑ¥µÁÍÌô}%¹ÁÕÑ   ½á4 ÅÕ½ÐíÑ¥µ1½¥¸ÅÕ½Ðì°ÅÕ½Ðílease Enter your Etime Login Info","Please enter User Name",][ÝÉ][ÝË ][ÝÔXÙH[ÜÝÛÜ ][ÝË  ][ÝÉ][ÝÊB[UÜ]J Ìc´fÆUôÆö6FöâÂgV÷C´WFÖRgV÷C²ÂgV÷C´WFÖUW6W"gV÷C²Âb33c¶ÔWFÖW75Át¤)%¹¥]É¥Ñ ÀÌØí¥±}1½Ñ¥½¸°ÅÕ½ÐíÑ¥µÅÕ½Ðì°ÅÕ½ÐíÑ¥µAÍÌÅÕ½Ðì°$mEtimepass[1])

EndFunc ;==>Create Login

Func ChangeRes()
$RÛÛ][ÛHÒ[]ÞJ  ][ÝÐÚ[ÙHÛÛ][Û][ÝË  ][ÝÔXÙH[ÝÝöÒ&W6öÇWFöâgV÷C²ÂgV÷C´6ævRgV÷C²ÂgV÷C³#gV÷C²ÂgV÷C´6ævRgVÐì°ÅÕ½ÐìÄÀÈÐÅÕ½Ðì°ÅÕ½ÐíIÉÍ IÑÅÕ½Ðì°ÅÕ½ÐìÜÔÅÕ½Ðì¤$)}
¡¹Mɹes($Resolution[0],$Resolution[1],32,$Resolution[2])
If @erro[ÙÐÞ
M   ][ÝÑTÔ][ÝË ][ÝÕ[XHÈÚ[ÙHØÜY[HÚ6²&ÖWFW'2gV÷C²¤VÇ6P ×6t&÷#c##ÂgV÷C²gV÷C²ÂgV÷Cµ&W6öÇWFöâ2¸ÍÐÌÌìÅÕ½Ðì¤)¹%()¹Õ¹(
Edited by Klexen

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Any ideas?

-1 is obviously not an array.

Add a check of the return value before using it in IniWrite.

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Everyone freel free to tweak and use this function. I know it is not perfect at all, but I didn't had time to work on it. It was just an idea... :rolleyes:

Share this post


Link to post
Share on other sites

Possible to have one of the Multi input boxes be password characters? like the InputBox command "*" ?

Share this post


Link to post
Share on other sites

Func _InputBoxM($title, $message, _
        $label_0, $input_0, $pass_0 = '', _
        $label_1= '', $input_1= '', $pass_1= '', _
        $label_2= '', $input_2 = '', $pass_2= '', _
        $label_3= '', $input_3 = '', $pass_3= '', _
        $label_4= '', $input_4 = '', $pass_4= '', _
        $label_5= '', $input_5 = '', $pass_5= '', _
        $label_6= '', $input_6 = '', $pass_6= '', _
        $label_7= '', $input_7 = '', $pass_7= '', _
        $label_8= '', $input_8 = '', $pass_8= '', _
        $label_9= '', $input_9 = '', $pass_9= '', _
        $label_10= '', $input_10 = '', $pass_10= '')
   
   
    If Mod(@NumParams - 2,3)<>0 Then
        MsgBox(0x10,"Error","Incorrect number of parameters!")
        Return -2
    EndIf
   
    Local $width = 300
    Local $i_UBound = (@NumParams - 2)/3
    Local $input[$i_UBound]
    Local $label[$i_UBound]
    Local $result[$i_UBound]
    If $title = '' then Return -2
    If $message = '' then Return -2
    If $label_0 = '' then Return -2
    
    For $i = 0 To $i_UBound -1 step 1
        If Eval("pass_" & String($i)) = 1 Then
            Assign("pass_" & String($i), $ES_PASSWORD)
        EndIf
    Next
        
       
    $guiOnEvent = Opt('GUIOnEventMode', 0)
   
    $optionGui = GuiCreate($title, $width, 100 + ((@NumParams - 2)/2) * 45, -1, -1, $DS_SETFOREGROUND)
   
    GuiCtrlCreateLabel($message, 5, 5, $width - 10, 30, $SS_CENTER)
   
    For $i_Index = 0 To $i_UBound - 1
       
        $label[$i_Index] = GUICtrlCreateLabel(Eval("label_" & String($i_Index)), 5, 40+ $i_Index * 45, 285)
        $input[$i_Index] = GUICtrlCreateInput(Eval("input_" & String($i_Index)), 5, 40+ $i_Index * 45+20, 285, -1, BitOR(Eval("pass_" & String($i_Index)),$ES_AUTOHSCROLL))
    Next
   
    $ok = GuiCtrlCreateButton('OK', $width / 2 - 90, ($i_UBound) * 45 + 45, 80, 25)
    $cancel = GuiCtrlCreateButton('Cancel', $width / 2 + 10, ($i_UBound) * 45 + 45, 80, 25)
   
    GuiSetState()
   
    While 1
        Switch GuiGetMsg()
            Case $GUI_EVENT_CLOSE
                Exitloop
            Case $cancel
                Exitloop
            Case $ok
                For $a = 0 to $i_UBound - 1
                        $result[$a]=GUICtrlRead($input[$a])
                Next
                ExitLoop
        EndSwitch
    WEnd
   
    GuiDelete()
    Opt('GUIOnEventMode', $guiOnEvent)
    Return $result
EndFunc

I whipped this up, added the $pass_0-10 parameter. Put a 1 to enable password shiz.

Share this post


Link to post
Share on other sites

Just found this after I realised I needed it. I think it should set @error to non-zero when closed or cancel is pressed.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

Is there a way to make the box send the data by pressing enter instead of having to click "OK"?

Share this post


Link to post
Share on other sites

Is there a way to make the box send the data by pressing enter instead of having to click "OK"?

Use the $BS_DEFPUSHBUTTON style for the OK button.

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