Can inputboxes (e.g. $string=inputbox(etc.)) be mutlined? If so, how do I make them?
If not, what would be the best input method for a user to enter a multilined string without the use of a GUI edit box?
Thanks
Posted 28 December 2008 - 07:52 PM
Posted 28 December 2008 - 07:56 PM
just create a GUI with an editmultilined string without the use of a GUI edit box?
Posted 28 December 2008 - 08:00 PM
Edited by Pain, 28 December 2008 - 08:01 PM.
Posted 28 December 2008 - 08:04 PM
#Include <EditConstants.au3> GuiCreate("GUI",400,400) GuiCtrlCreateEdit("Edit",5,5,390,390,$ES_MULTILINE) GuiSetState() While 1 Sleep(250) WEnd
Posted 28 December 2008 - 08:04 PM
Posted 28 December 2008 - 08:07 PM
Doesn't suit my purpose, because the user has to input a custom set of lines that aren't copied from the clipboardClipGet
Edited by aommaster, 28 December 2008 - 08:08 PM.
Posted 28 December 2008 - 08:10 PM
Hi Firefox!@aommaster
#Include <EditConstants.au3> GuiCreate("GUI",400,400) GuiCtrlCreateEdit("Edit",5,5,390,390,$ES_MULTILINE) GuiSetState() While 1 Sleep(250) WEnd
Cheers, FireFox.
Posted 28 December 2008 - 08:14 PM
I have several scripts that prompt the user to enter data into a certain app - then either the user puts it into the clipboard or the script gets it from the edit control. It comes in handy if the info needs to retain formatting.Doesn't suit my purpose, because the user has to input a custom set of lines that aren't copied from the clipboard
Posted 28 December 2008 - 08:17 PM
Yeah.. reason I wanted to avoid a GUI window is because this script is already running from a GUI, and because I'm not too comfortable with GUI coding just yes (I can only do the basic things such as define a control and make it do stuff, as well as read and write to it), I'm afraid that creating a child window would be a one way ticket to disaster...but like you said - it might not work for your needs. You just really limited the options when you said no GUI :-)
Posted 28 December 2008 - 08:36 PM
$sText = '' For $i = 0 To 5000 $sText &= Chr(Random(65, 90, 1)) Next MsgBox(0, '', _MLInputBox("Testbox", "Test", $sText, 0, 800, -1, -1) & @error) InputBox("t", "") ;=============================================================================== ; ; Function Name: _MLInputBox( ; Description:: Multiline Inputbox ; Parameter(s): same as Inputbox, but without Psswordchar ; Requirement(s): ; Return Value(s): same as InputBox ; Author(s): Oscar, Prog@ndy ; ;=============================================================================== ; Func _MLInputBox($title, $prompt, $Default = "", $width = 0, $height = 0, $left = Default, $top = Default, $timeOut = 0, $hWnd = 0) Local $OnEventMode = Opt('GUIOnEventMode', 0) Local $text = "" If $width < 400 Then $width = 400 If $height < 330 Then $height = 330 Local $widthAddition = $width-400 Local $heightAddition = $height-330 Local $error = 0 Local $hGui = GUICreate($title, $width, $height, $left, $top, 0x00C00000+0x00080000,0,$hWnd) If @error Then $error = 3 Else GUICtrlCreateLabel($prompt, 5, 5, 390, 90) If @error Then $error = 3 Local $Edit = GUICtrlCreateEdit($Default, 5, 105, 390+$widthAddition, 190+$heightAddition) If @error Then $error = 3 Local $hOK = GUICtrlCreateButton('&OK', 70, 300+$heightAddition, 80, 25) If @error Then $error = 3 Local $htime = GUICtrlCreateLabel('', 170, 305+$heightAddition, 50, 20) If @error Then $error = 3 Local $hCancel = GUICtrlCreateButton('&Cancel', 230, 300+$heightAddition, 80, 25) If @error Then $error = 3 GUISetState(@SW_SHOW, $hGui) If @error Then $error = 3 Local $timer = TimerInit(), $s1, $s2, $msg Do $msg = GUIGetMsg(1) If $msg[1] = $hGui Then Switch $msg[0] Case 0xFFFFFFFD, $hCancel ; 0xFFFFFFFD = $GUI_EVENT_CLOSE $error = 1 ExitLoop Case $hOK ExitLoop EndSwitch EndIf If $timeOut > 0 And TimerDiff($timer) >= $timeOut Then $error = 2 $s1 = Round(($timeOut - TimerDiff($timer)) / 1000) If $timeOut And $s1 <> $s2 Then GUICtrlSetData($htime, $s1 & "s") $s2 = $s1 EndIf Until $error If Not $error Then $text = GUICtrlRead($Edit) GUIDelete($hGui) Opt('GUIOnEventMode', $OnEventMode) EndIf SetError($error) Return $text EndFunc ;==>_MLInputBox
Edited by ProgAndy, 28 December 2008 - 08:37 PM.
Posted 28 December 2008 - 08:41 PM
0 members, 0 guests, 0 anonymous users