AustrianOak Posted July 9, 2008 Posted July 9, 2008 (edited) GUICtrlCreateInput("", 25, 25, 40, 40, $ES_MULTILINE) thats what i did in an attempt to make my input multiline but when i press enter nothing happens? Edited July 9, 2008 by nowagain
NELyon Posted July 9, 2008 Posted July 9, 2008 GUICtrlCreateInput("", 25, 25, 40, 40, $ES_MULTILINE) thats what i did in an attempt to make my input multiline but when i press enter nothing happens? Why not just use an Edit control, which is multiline anyway?
Marcuzzo18 Posted July 9, 2008 Posted July 9, 2008 (edited) this should work muttley $Edit = GUICtrlCreateEdit("", 135, 141, 241, 196, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) Edited July 9, 2008 by Marcuzzo18 [font="Century Gothic"]quisnam est quantum stultus , balatro vel balatro quisnam insistovolubilis in solum rideo risi risum----------------------------------------------------------------------------------------------------------------------------Portable Command Line Tool[/font]
AustrianOak Posted July 9, 2008 Author Posted July 9, 2008 (edited) it gives me an error point to $ES_AUTOVSCROLL saying variable used without being declared... Edited July 9, 2008 by nowagain
AustrianOak Posted July 9, 2008 Author Posted July 9, 2008 does anyone know why its giving me this error. im pretty sure i included the right files...
AustrianOak Posted July 10, 2008 Author Posted July 10, 2008 bump. is this only possible with an input control...?
JFee Posted July 10, 2008 Posted July 10, 2008 #include <EditConstants.au3> #include <GUIConstantsEx.au3> GUICreate("blah", 100, 100) GUICtrlCreateEdit("", 10, 10, 80, 80, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUISetState() Sleep(3000) ... that works fine for me Regards,Josh
AustrianOak Posted July 10, 2008 Author Posted July 10, 2008 Maybe I badly missaid what I wanted. My fault. I actually want it to "expand" whenever I press enter so it gets larger. Is this still possible?
rasim Posted July 10, 2008 Posted July 10, 2008 nowagainThis?#include <GuiEdit.au3> Global $LineCount = 1 $hGUI = GUICreate("Test", 300, 200) $input = GUICtrlCreateEdit("", 50, 50, 200, 20, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 ExitLoop Case $input EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) ConsoleWrite("Enter pressed" & @LF) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) EndIf WEnd
AustrianOak Posted July 10, 2008 Author Posted July 10, 2008 Precisely. thank you so much rasim. Not to be greedy, but is there a way I can do this horizontally too? muttley
AustrianOak Posted July 10, 2008 Author Posted July 10, 2008 I tried this code so when I backspaced onto the previously line the edit would return to a smaller size than before. Well, its returning to a smaller size but its like 3 pixels high and isn't the right size. Can someone help me with this code #include <GuiEdit.au3> Global $LineCount = 1 $hGUI = GUICreate("Test", 300, 200) $input = GUICtrlCreateEdit("", 50, 50, 200, 20, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 ExitLoop Case $input EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) ConsoleWrite("Enter pressed" & @LF) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) ElseIf _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) < $LineCount Then $sPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $sPos[0], $sPos[1], $sPos[2], $sPos[3] - 15) EndIf WEnd
rasim Posted July 11, 2008 Posted July 11, 2008 nowagain I tried this code so when I backspaced onto the previously line the edit would return to a smaller size than before. Well, its returning to a smaller size but its like 3 pixels high and isn't the right size.Try this: #include <GuiEdit.au3> Global $LineCount = 1, $LineLen = 0 $hGUI = GUICreate("Test", 300, 200) $input = GUICtrlCreateEdit("", 50, 50, 200, 20, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 ExitLoop EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) ElseIf _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) < $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] - 15) EndIf WEnd
rasim Posted July 11, 2008 Posted July 11, 2008 nowagain Not to be greedy, but is there a way I can do this horizontally too?Example: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> Global $LineCount = 1, $LineLen = 0 $hGUI = GUICreate("Test", 300, 200) $input = GUICtrlCreateEdit("", 50, 50, 50, 20, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 ExitLoop EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) ElseIf _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) < $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] - 15) EndIf WEnd Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) Switch $iIDFrom Case $input Switch $iCode Case $EN_UPDATE Local $iLen = _GUICtrlEdit_LineLength($input) Local $aInputPos = ControlGetPos($hGUI, "", $input) If ($aInputPos[2] / $iLen) < 6.5 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] + 10, $aInputPos[3]) ElseIf ($aInputPos[2] / $iLen) > 30 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] - 10, $aInputPos[3]) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
AustrianOak Posted July 12, 2008 Author Posted July 12, 2008 this is great. i could have never done this. btw: every time i press enter it shrinks the width of the input and eventually to like 5 pixels? is it supposed to be like that? muttley
rasim Posted July 12, 2008 Posted July 12, 2008 Hmm... expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> Global $LineCount = 1, $LineLen = 0, $MaxLen = 0 $hGUI = GUICreate("Test", 300, 200) $input = GUICtrlCreateEdit("", 50, 50, 50, 20, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case -3 ExitLoop EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) ElseIf _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) < $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] - 15) EndIf WEnd Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) Switch $iIDFrom Case $input Switch $iCode Case $EN_UPDATE Local $iLen = _GUICtrlEdit_LineLength($input) If $iLen > $MaxLen Then $MaxLen = $iLen Local $aInputPos = ControlGetPos($hGUI, "", $input) If ($aInputPos[2] / $MaxLen) < 6.5 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] + 10, $aInputPos[3]) ElseIf ($aInputPos[2] / $MaxLen) > 100 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] - 10, $aInputPos[3]) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
AustrianOak Posted August 3, 2008 Author Posted August 3, 2008 hi rasim, can you check out this code for me? it is supposed to create a multiline edit for every edit control but when i try to simulate in this example what ive seen in yours and it doesn't work. can you help? expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiEdit.au3> #include <WindowsConstants.au3> Global $LineCount = 1, $LineLen = 0, $MaxLen = 0 Global $lastdragIP = -1 Dim $hInput_GUI[50], $Input[50] $hGUI = GUICreate("Test", 300, 200) $button = GUICtrlCreateButton("", 50, 50, 50, 20) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button If $lastdragIP < 49 Then $lastdragIP += 1 createNextdragIP($lastdragIP) EndIf EndSwitch If _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) > $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] + 15) ElseIf _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) < $LineCount Then $LineCount = _GUICtrlEdit_GetLineCount(GUICtrlGetHandle($input)) $aPos = ControlGetPos($hGUI, "", $input) GUICtrlSetPos($input, $aPos[0], $aPos[1], $aPos[2], $aPos[3] - 15) EndIf WEnd Func createNextdragIP($nw) $start = WinGetPos($hgui) $hInput_GUI[$nw] = GUICreate("", 120, 22, 100, 100, $WS_POPUP, $WS_EX_TOOLWINDOW) $Input[$nw] = GUICtrlCreateEdit("", 0, 0, 120, 22, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN)) GUISetState() EndFunc Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $iIDFrom = BitAND($wParam, 0xFFFF) Local $iCode = BitShift($wParam, 16) Switch $iIDFrom Case $input Switch $iCode Case $EN_UPDATE Local $iLen = _GUICtrlEdit_LineLength($input) If $iLen > $MaxLen Then $MaxLen = $iLen Local $aInputPos = ControlGetPos($hGUI, "", $input) If ($aInputPos[2] / $MaxLen) < 6.5 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] + 10, $aInputPos[3]) ElseIf ($aInputPos[2] / $MaxLen) > 100 Then GUICtrlSetPos($input, $aInputPos[0], $aInputPos[1], $aInputPos[2] - 10, $aInputPos[3]) EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
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