;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; AutoIt Version: 3.2.0.1 ;; ;; ;; ;; Template AutoIt script. ;; ;; ;; ;; AUTHOR: TheSaint ;; ;; ;; ;; SCRIPT FUNCTION: Simplify the creation of a basic dialog, by using point & click ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; FUNCTIONS ; EnterDialogCode(), FixOtherButtonValues(), GetAnswerResponse(), GetFlagValue() ; GetOtherValues($prv), GetTabs(), SaveTextForRecall(), WorkoutTabs() #region --- GuiBuilder code Start --- ; Script generated by AutoBuilder 0.7 Prototype #include #include #include Global $Button_case, $Button_err, $Button_i, $Button_prv, $Button_x Global $Checkbox_but, $Checkbox_pi, $Checkbox_sav Global $Combo_but, $Combo_def, $Combo_ico, $Combo_ot, $Edit_txt Global $Group_but, $Group_def, $Group_ico, $Group_ind, $Group_ot, $Group_ttl, $Group_txt, $Group_w Global $Input_ind, $Input_ttl, $Input_w, $Label_au, $Updown_ind, $Updown_w ; Global $Dialog, $height, $icofle, $icoI, $icoX, $inifle, $Maker, $prevfle, $Scriptname, $shell Global $user, $width ; Global $abort, $ans, $answer, $buts, $button, $buttons, $cancel, $clip, $cnt, $code, $continue, $cse Global $default, $defaults, $exit, $flag, $i, $ico, $icon, $icons, $ignore, $indent, $last, $len Global $lines, $no, $ok, $old, $ontop, $part, $pos, $prv, $query, $recall, $res, $retry, $simple, $t Global $tabs, $tbnum, $tbtxt, $text, $title, $top, $try, $txt, $type, $use, $wait, $x, $y, $yes $inifle = @ScriptDir & "\Settings.ini" $prevfle = @ScriptDir & "\Preview.au3" $Scriptname = "Dialog Maker v2.0 (updated January 2013)" WorkoutTabs() $Dialog = $WS_OVERLAPPED + $WS_CAPTION + $WS_SYSMENU + $WS_VISIBLE + $WS_CLIPSIBLINGS $width = 490 $height = 335 $Maker = GuiCreate($Scriptname, $width, $height, -1, -1, $Dialog + $WS_MINIMIZEBOX, $WS_EX_TOPMOST) $Group_but = GuiCtrlCreateGroup("Buttons", 10, 10, 135, 50) $Combo_but = GuiCtrlCreateCombo("", 20, 30, 70, 21) GUICtrlSetTip($Combo_but, "Select one or more buttons to use!") $Checkbox_but = GuiCtrlCreateCheckbox("Use", 100, 30, 40, 20) GUICtrlSetTip($Checkbox_but, "Use the selected button in the dialog!") ; $Group_ttl = GuiCtrlCreateGroup("Title", 155, 10, 255, 50) $Input_ttl = GuiCtrlCreateInput("Program Information", 165, 30, 215, 20) GUICtrlSetTip($Input_ttl, "Dialog Title to display!") $Checkbox_pi = GuiCtrlCreateCheckbox("", 385, 30, 20, 20) GUICtrlSetTip($Checkbox_pi, "Use 'Program Information' as the title!") ; $Group_ind = GuiCtrlCreateGroup("Indents", 420, 10, 60, 50) $Input_ind = GuiCtrlCreateInput($tbnum, 430, 30, 40, 21) GUICtrlSetTip($Input_ind, "Number of indents (Tabs) before each line!") $Updown_ind = GUICtrlCreateUpdown($Input_ind) GUICtrlSetLimit($Updown_ind, 99, 0) GUICtrlSetTip($Updown_ind, "Set the number of indents (Tabs) before each line!") ; $Group_txt = GuiCtrlCreateGroup("Text", 10, 70, 470, 170) $Edit_txt = GuiCtrlCreateEdit("", 20, 90, 450, 140, $ES_MULTILINE + $WS_VSCROLL + $ES_AUTOVSCROLL + $ES_WANTRETURN) GUICtrlSetTip($Edit_txt, "Text to display in the dialog!") ; $Group_def = GuiCtrlCreateGroup("Default", 10, 250, 80, 50) $Combo_def = GuiCtrlCreateCombo("", 20, 270, 60, 21) GUICtrlSetTip($Combo_def, "Select a button as the default!") ; $Group_ico = GuiCtrlCreateGroup("Icon", 100, 250, 100, 50) $Combo_ico = GuiCtrlCreateCombo("", 110, 270, 80, 21) GUICtrlSetTip($Combo_ico, "Select an icon to display in the dialog!") ; $Group_ot = GuiCtrlCreateGroup("On Top", 210, 250, 70, 50) $Combo_ot = GuiCtrlCreateCombo("", 220, 270, 50, 21) GUICtrlSetTip($Combo_ot, "Set the dialog's on top of other windows state!") ; $Group_w = GuiCtrlCreateGroup("Timeout", 290, 250, 60, 50) $Input_w = GuiCtrlCreateInput("0", 300, 270, 40, 20, $ES_NUMBER) GUICtrlSetTip($Input_w, "Timeout (if not 0) for the automatic default action to occur!") $Updown_w = GUICtrlCreateUpdown($Input_w) GUICtrlSetLimit($Updown_w, 900, 0) GUICtrlSetTip($Updown_w, "Set the timeout in seconds!") ; $Button_i = GuiCtrlCreateButton("Info", 370, 250, 50, 50, $BS_ICON) GUICtrlSetTip($Button_i, "Program Information!") $Button_x = GuiCtrlCreateButton("EXIT", 430, 250, 50, 50, $BS_ICON) GUICtrlSetTip($Button_x, "Close the program!") ; $Checkbox_sav = GuiCtrlCreateCheckbox("Save text for recall", 10, $height-27, 110, 20) ; $Button_case = GuiCtrlCreateButton("Toggle Case Of Highlighted Text", 125, $height-27, 150, 20) GUICtrlSetFont($Button_case, 7, 400, 0, "Small Fonts") GUICtrlSetTip($Button_case, "Toggle the case of the highlighted selection!") ; $Button_prv = GuiCtrlCreateButton("Dialog Preview", 285, $height-27, 90, 20) GUICtrlSetTip($Button_prv, "Preview the dialog using current selections!") ; $Button_err = GuiCtrlCreateButton("ERROR DIALOG", 385, $height-27, 95, 20) GUICtrlSetFont($Button_err, 6, 600, 0, "Small Fonts") GUICtrlSetTip($Button_err, "Export a simple error dialog!") ; ; SETTINGS $shell = @SystemDir & "\shell32.dll" $user = "User.exe" $icoX = 6 $icoI = 4 If StringLeft(@OSVersion, 5) = "WIN_9" Or @OSVersion = "WIN_ME" Then $icofle = $user Else ; WIN_NT4, WIN_2000, WIN_XP, WIN_2003 $user = "User32.dll" $icofle = $shell $icoX = 27 EndIf GUICtrlSetImage($Button_i, $user, $icoI, 1) GUICtrlSetImage($Button_x, $icofle, $icoX, 1) ; $buttons = "Ok|Cancel|Abort|Retry|Ignore|Yes|No|Try Again|Continue" GUICtrlSetData($Combo_but, $buttons, "Ok") $buts = StringSplit($buttons, "|") For $i = 1 To $buts[0] IniWrite($inifle, $buts[$i], "use", 4) Next ; $recall = IniRead($inifle, "Dialog Text", "recall", "") If $recall = "" Then $recall = 4 IniWrite($inifle, "Dialog Text", "recall", $recall) EndIf GUICtrlSetState($Checkbox_sav, $recall) If $recall = 1 Then $title = IniRead($inifle, "Dialog Text", "title", "") GUICtrlSetData($Input_ttl, $title) $text = IniRead($inifle, "Dialog Text", "text", "") $lines = StringSplit($text, "|") GUICtrlSetData($Edit_txt, "") For $i = 1 To $lines[0] - 1 GUICtrlSetData($Edit_txt, $lines[$i] & @CRLF, 1) Next GUICtrlSetData($Edit_txt, $lines[$lines[0]], 1) EndIf ; $defaults = "First|Second|Third" GUICtrlSetData($Combo_def, $defaults, "First") ; $icons = "none|Stop Sign|Question|Exclamation|Information" If $title = "Program Information" Then GUICtrlSetData($Combo_ico, $icons, "Information") Else If $recall = 1 Then $icon = IniRead($inifle, "Dialog Text", "icon", "") If $icon = "" Then $icon = "none" GUICtrlSetData($Combo_ico, $icons, $icon) Else GUICtrlSetData($Combo_ico, $icons, "none") EndIf EndIf ; $ontop = "Yes|No" GUICtrlSetData($Combo_ot, $ontop, "Yes") ; $query = IniRead($inifle, "Tab Indents", "query", "") If $query = "" Then $query = 1 IniWrite($inifle, "Tab Indents", "query", $query) IniWrite($inifle, "Tab Indents", ";default", $query) IniWrite($inifle, "Tab Indents", ";assume_yes", "2") IniWrite($inifle, "Tab Indents", ";assume_no", "3 Or greater") EndIf GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_x If $recall = 1 Then SaveTextForRecall() $ans = MsgBox(4096 + 4, "Save Selected Options As Code", "Do you want to insert or save the dialog code?") If $ans = 6 Then GetFlagValue() If $exit = 2 Then GetOtherValues("") Else $exit = 3 EndIf If $exit > 1 Then ExitLoop Case $msg = $Button_prv ; Preview the dialog using current selections GetFlagValue() If $exit = 2 Then GetOtherValues(1) ;If Not FileExists($prevfle) Then _FileCreate($prevfle) _FileCreate($prevfle) $cnt = _FileCountLines($prevfle) If $cnt > 1 Then For $i = 1 To $cnt _FileWriteToLine($prevfle, $i, "", 1) Next EndIf _FileWriteToLine($prevfle, 1, $code, 1) Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $prevfle & '"') EndIf Case $msg = $Button_i ; Program Information MsgBox(262208, "Program Information", _ "If you start this program using the switch '/StdOut', then when you exit" & @LF & _ "the program, it will prompt to enter the code into any open text editor." & @LF & @LF & _ "900 secs = 15 mins (maximum limit for timeout)." & @LF & @LF & _ "When toggling the case of highlighted text, it goes through 4 states." & @LF & _ " 1 = Titlecase, 2 = UPPERCASE, 3 = lowercase, 4 = OriGiNal caSE" & @LF & _ "Remembering that your original case usually matches one of the other" & @LF & _ "cases (unlike the example) - so sometimes the text will not change." & @LF & @LF & _ "Clicking the 'ERROR DIALOG' button, will give you the opportunity to" & @LF & _ "quickly create a simple error dialog with the basics only." & @LF & @LF & _ "© TheSaint - January 2007 (thsaint@ihug.com.au)") Case $msg = $Button_err ; Export a simple error dialog $ans = MsgBox(4096 + 3, "Save Simple Error Code", "Do you want to insert or save the dialog code?") If $ans = 6 Then $simple = 1 $exit = 2 $answer = "" $flag = 48 + 262144 GetTabs() $title = "Error Check" $text = "Some Text" $wait = 0 $code = $answer & 'MsgBox(' & $flag & ', "' & $title & '", "' & $text & '", ' & $wait & ')' ElseIf $ans = 7 Then $exit = 3 Else $simple = "" $exit = 1 EndIf If $exit > 1 Then ExitLoop Case $msg = $Button_case ; Toggle the case of the highlighted selection GUICtrlSetState($Button_case, $GUI_DISABLE) GUICtrlSetState($Edit_txt, $GUI_FOCUS) Send("^c") $txt = ClipGet() $len = StringLen($txt) If $txt <> "" Then Send("{LEFT}") Send("{RIGHT}") Send("+{LEFT " & $len & "}") $pos = WinGetCaretPos() If $x = "" Then $x = $pos[0] $y = $pos[1] Else If $x <> $pos[0] Or $y <> $pos[1] Then $txt = "" $len = "" ClipPut($txt) $x = $pos[0] $y = $pos[1] EndIf EndIf If $old = "" Or $old <> $txt Then $old = $txt $cse = 1 EndIf If $cse = 1 Then $txt = _StringProper($txt) $cse = 2 ElseIf $cse = 2 Then $txt = StringUpper($txt) $cse = 3 ElseIf $cse = 3 Then $txt = StringLower($txt) $cse = 4 ElseIf $cse = 4 Then $txt = $old $cse = 1 EndIf ClipPut($txt) Send("^v") Send("{LEFT " & $len & "}") Send("+{RIGHT " & $len & "}") $len = "" $txt = "" ClipPut($txt) EndIf GUICtrlSetState($Button_case, $GUI_ENABLE) Case $msg = $Checkbox_sav ; Save text for recalling If GUICtrlRead($Checkbox_sav) = $GUI_CHECKED Then $recall = 1 Else $recall = 4 EndIf IniWrite($inifle, "Dialog Text", "recall", $recall) Case $msg = $Checkbox_pi ; Use 'Program Information' as the title If $last = "" Then $last = GUICtrlRead($Input_ttl) $ico = GUICtrlRead($Combo_ico) EndIf If GUICtrlRead($Checkbox_pi) = $GUI_CHECKED Then $title = "Program Information" $icon = "Information" Else $title = $last $icon = $ico EndIf GUICtrlSetData($Input_ttl, $title) GUICtrlSetData($Combo_ico, $icon) Case $msg = $Checkbox_but ; Enable/disable a button If GUICtrlRead($Checkbox_but) = $GUI_CHECKED Then $use = 1 Else $use = 4 EndIf $button = GUICtrlRead($Combo_but) IniWrite($inifle, $button, "use", $use) FixOtherButtonValues() Case $msg = $Combo_ot ; Make On Top Case $msg = $Combo_ico ; Assign an icon Case $msg = $Combo_def ; Set the default Case $msg = $Combo_but ; Select a button $button = GUICtrlRead($Combo_but) $use = IniRead($inifle, $button, "use", "") GUICtrlSetState($Checkbox_but, $use) Case $msg = $Updown_w ; Set the timeout delay Case $msg = $Updown_ind ; Set the number of indents (Tabs) before each line Case Else ;;; EndSelect WEnd GUIDelete($Maker) If $exit = 2 Then EnterDialogCode() Exit #endregion --- GuiBuilder generated code End --- Func EnterDialogCode() If StringInStr($CmdLineRaw, "/StdOut") Then ;$tabs = GUICtrlRead($Input_ind) If $simple <> 1 Then ConsoleWrite("#region --- Dialog Maker code Begin ---" & @LF) ConsoleWrite(StringReplace($code, @crlf, @lf)) If $simple <> 1 Then If $tabs > 0 Then ConsoleWrite(@lf & $indent & "#endregion --- Dialog Maker code End ---" & @LF) Else ConsoleWrite(@lf & "#endregion --- Dialog Maker code End ---" & @LF) EndIf EndIf If $answer <> "" Then GetAnswerResponse() ConsoleWrite($res) EndIf Else If $answer = "" Then ClipPut($code) Else GetAnswerResponse() ClipPut($code & @CRLF & $res) EndIf SplashTextOn("Done", @CRLF & "Code copied to clipboard!", 200, 100) Sleep(1500) SplashOff() EndIf EndFunc ;=> EnterDialogCode Func FixOtherButtonValues() $button = GUICtrlRead($Combo_but) If $button = "Ok" Then IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Retry", "use", 4) IniWrite($inifle, "Ignore", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "Cancel" Then IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Ignore", "use", 4) ElseIf $button = "Abort" Then IniWrite($inifle, "Retry", "use", 1) IniWrite($inifle, "Ignore", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Cancel", "use", 4) IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "Retry" Then IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "Ignore" Then IniWrite($inifle, "Retry", "use", 1) IniWrite($inifle, "Abort", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Cancel", "use", 4) IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "Yes" Then IniWrite($inifle, "No", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Retry", "use", 4) IniWrite($inifle, "Ignore", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "No" Then IniWrite($inifle, "Yes", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Retry", "use", 4) IniWrite($inifle, "Ignore", "use", 4) IniWrite($inifle, "Try Again", "use", 4) IniWrite($inifle, "Continue", "use", 4) ElseIf $button = "Try Again" Then IniWrite($inifle, "Cancel", "use", 1) IniWrite($inifle, "Continue", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Retry", "use", 4) IniWrite($inifle, "Ignore", "use", 4) IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) ElseIf $button = "Continue" Then IniWrite($inifle, "Cancel", "use", 1) IniWrite($inifle, "Try Again", "use", 1) ; IniWrite($inifle, "Ok", "use", 4) IniWrite($inifle, "Abort", "use", 4) IniWrite($inifle, "Retry", "use", 4) IniWrite($inifle, "Ignore", "use", 4) IniWrite($inifle, "Yes", "use", 4) IniWrite($inifle, "No", "use", 4) EndIf EndFunc ;=> FixOtherButtonValues Func GetAnswerResponse() ;MsgBox(262144, "$flag", $type) If $type = 1 Then ; OK & Cancel $res = "If $ans = 1 Then|ElseIf $ans = 2 Then" ElseIf $type = 2 Then ; Abort, Retry, Ignore $res = "If $ans = 3 Then|ElseIf $ans = 4 Then|ElseIf $ans = 5 Then" ElseIf $type = 3 Then ; Yes, No, Cancel $res = "If $ans = 6 Then|ElseIf $ans = 7 Then|ElseIf $ans = 2 Then" ElseIf $type = 4 Then ; Yes & No $res = "If $ans = 6 Then|ElseIf $ans = 7 Then" ElseIf $type = 5 Then ; Retry & Cancel $res = "If $ans = 4 Then|ElseIf $ans = 2 Then" ElseIf $type = 6 Then ; Cancel, Try Again, Continue $res = "If $ans = 2 Then|ElseIf $ans = 10 Then|ElseIf $ans = 11 Then" EndIf $res = $res & "|EndIf" $part = StringSplit($res, "|") $res = $part[1] For $i = 2 To $part[0] $res = $res & @CRLF & $part[$i] Next If $tabs > 0 Then $res = StringReplace($res, @CRLF, @CRLF & $indent) $res = $indent & $res EndIf EndFunc ;=> GetAnswerResponse Func GetFlagValue() $exit = 0 $answer = "" $ok = IniRead($inifle, "Ok", "use", "") $cancel = IniRead($inifle, "Cancel", "use", "") $abort = IniRead($inifle, "Abort", "use", "") $retry = IniRead($inifle, "Retry", "use", "") $ignore = IniRead($inifle, "Ignore", "use", "") $yes = IniRead($inifle, "Yes", "use", "") $no = IniRead($inifle, "No", "use", "") $try = IniRead($inifle, "Try Again", "use", "") $continue = IniRead($inifle, "Continue", "use", "") If ($ok = 1 Or $ok = 4) And $cancel = 4 And $abort = 4 And $retry = 4 And $ignore = 4 And $yes = 4 _ And $no = 4 And $try = 4 And $continue = 4 Then ; OK only $flag = 0 ElseIf $ok = 1 And $cancel = 1 And $abort = 4 And $retry = 4 And $ignore = 4 And $yes = 4 _ And $no = 4 And $try = 4 And $continue = 4 Then ; OK & Cancel $flag = 1 ElseIf $ok = 4 And $cancel = 4 And $abort = 1 And $retry = 1 And $ignore = 1 And $yes = 4 _ And $no = 4 And $try = 4 And $continue = 4 Then ; Abort, Retry, Ignore $flag = 2 ElseIf $ok = 4 And $cancel = 1 And $abort = 4 And $retry = 4 And $ignore = 4 And $yes = 1 _ And $no = 1 And $try = 4 And $continue = 4 Then ; Yes, No, Cancel $flag = 3 ElseIf $ok = 4 And $cancel = 4 And $abort = 4 And $retry = 4 And $ignore = 4 And $yes = 1 _ And $no = 1 And $try = 4 And $continue = 4 Then ; Yes & No $flag = 4 ElseIf $ok = 4 And $cancel = 1 And $abort = 4 And $retry = 1 And $ignore = 4 And $yes = 4 _ And $no = 4 And $try = 4 And $continue = 4 Then ; Retry & Cancel $flag = 5 ElseIf $ok = 4 And $cancel = 1 And $abort = 4 And $retry = 4 And $ignore = 4 And $yes = 4 _ And $no = 4 And $try = 1 And $continue = 1 Then ; Cancel, Try Again, Continue $flag = 6 Else MsgBox(4096, "Button Error", "One or more of the selected button settings are" _ & @LF & "incompatible with each other!") $exit = 1 EndIf ; If $flag <> 0 Then $answer = "$ans = " ; $type = $flag ; If $exit <> 1 Then $default = GUICtrlRead($Combo_def) If $default = "First" Or $default = "" Then $flag = $flag ElseIf $default = "Second" And $flag <> 0 Then $flag = $flag + 256 ElseIf $default = "Third" And $flag <> 0 And $flag <> 1 And $flag <> 4 And $flag <> 5 Then $flag = $flag + 512 Else MsgBox(4096, "Button Error", "The Default button setting is incorrect for the" _ & @LF & "number of buttons being used!") $exit = 1 EndIf EndIf ; If $exit <> 1 Then $icon = GUICtrlRead($Combo_ico) If $icon = "none" Then $flag = $flag ElseIf $icon = "Stop Sign" Then $flag = $flag + 16 ElseIf $icon = "Question" Then $flag = $flag + 32 ElseIf $icon = "Exclamation" Then $flag = $flag + 48 ElseIf $icon = "Information" Then $flag = $flag + 64 EndIf ; $top = GUICtrlRead($Combo_ot) If $top = "No" Or $top = "" Then $flag = $flag ElseIf $top = "Yes" Then $flag = $flag + 262144 EndIf ; $exit = 2 EndIf EndFunc ;=> GetFlagValue Func GetOtherValues($prv) GetTabs() $title = GUICtrlRead($Input_ttl) $text = GUICtrlRead($Edit_txt) $text = StringReplace($text, '"', '" & ' & "'" & '"' & "'" & ' & "') If StringInStr($text, @CRLF) Then $lines = StringSplit($text, @CRLF, 1) $text = "|" & $lines[1] If $lines[0] > 1 Then For $i = 2 To $lines[0] $text = $text & '" & @LF & "|' & $lines[$i] Next EndIf $text = StringReplace($text, '& "|" &', '&') $text = StringReplace($text, '& "" &', '&') ;MsgBox(262144, "Text", $text) EndIf $wait = GUICtrlRead($Input_w) $code = $answer & 'MsgBox(' & $flag & ', "' & $title & '", "' & $text & '", ' & $wait & ')' $code = StringReplace($code, '"|', "_" & @CRLF & @TAB & '"') If $tabs > 0 Then $code = StringReplace($code, @TAB, $indent & @TAB) If $query = 1 And $prv = "" Then $ans = MsgBox(262436, "Indent Query", _ "Do you want to apply the TAB" & @LF & _ "Indents to the first line also?", 0) If $ans = 6 Then $code = $indent & $code EndIf ElseIf $query = 2 Then $code = $indent & $code EndIf EndIf EndFunc ;=> GetOtherValues Func GetTabs() $indent = "" $tabs = GUICtrlRead($Input_ind) If $tabs > 0 Then For $t = 1 To $tabs If $indent = "" Then $indent = @TAB Else $indent = $indent & @TAB EndIf Next Else $indent = "" EndIf EndFunc ;=> GetTabs Func SaveTextForRecall() $icon = GUICtrlRead($Combo_ico) IniWrite($inifle, "Dialog Text", "icon", $icon) ; $title = GUICtrlRead($Input_ttl) IniWrite($inifle, "Dialog Text", "title", $title) ; $text = GUICtrlRead($Edit_txt) If StringInStr($text, @CRLF) Then $lines = StringSplit($text, @CRLF) $text = $lines[1] If $lines[0] > 1 Then For $i = 2 To $lines[0] $text = $text & "|" & $lines[$i] Next EndIf EndIf $text = StringReplace($text, "||", "|") IniWrite($inifle, "Dialog Text", "text", $text) EndFunc ;=> SaveTextForRecall Func WorkoutTabs() $clip = ClipGet() $tbnum = 0 If StringInStr($CmdLineRaw, "/StdOut") Then Send("+{HOME}") Send("^c") $tbtxt = ClipGet() If StringInStr($tbtxt, @TAB) > 0 Then While 1 $tbnum = $tbnum + 1 $tbtxt = StringReplace($tbtxt, @TAB, "", 1) If StringInStr($tbtxt, @TAB) < 1 Then ExitLoop WEnd ;MsgBox(262144, "Number Of Tabs", $tbnum) EndIf Send("{HOME}") ClipPut($clip) EndIf EndFunc ;=> WorkoutTabs