JulianDelphiki Posted February 24, 2021 Posted February 24, 2021 Hello, I have problem on Windows 10 pasting text from clipboard longer than the actual length of single line edit control: GUICtrlCreateEdit('', 89, 21, 786, 21, $ES_AUTOHSCROLL) On Windows 7 it works ok. Any idea?
Danp2 Posted February 24, 2021 Posted February 24, 2021 1 hour ago, JulianDelphiki said: Any idea? Nope. Post a short script that we can run to test / observe the issue. Latest Webdriver UDF Release Webdriver Wiki FAQs
Dan_555 Posted February 24, 2021 Posted February 24, 2021 You probably want the #include <GuiEdit.au3> _GUICtrlEdit_SetLimitText ( $hWnd, $iLimit ) Some of my script sourcecode
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() GUICreate("My GUI edit", 200, 50) ; will create a dialog box that when displayed is centered Local $idMyedit = GUICtrlCreateEdit('', 10, 10, 170, 21, 128); $ES_AUTOHSCROLL GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 25 minutes ago, Dan_555 said: You probably want the #include <GuiEdit.au3> _GUICtrlEdit_SetLimitText ( $hWnd, $iLimit ) The text can be only slightly longer than edit width. The default almost 30000 is suffcient enough.
Moderators Melba23 Posted February 24, 2021 Moderators Posted February 24, 2021 JulianDelphiki, I use Win 10 and I can paste lines well over the width of that edit control without problem. What exactly goes wrong when you try? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 I just run this in scite now on win 7: #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() GUICreate("My GUI edit", 200, 50) ; will create a dialog box that when displayed is centered GUICtrlCreateEdit('', 10, 10, 170, 21, 128); $ES_AUTOHSCROLL GUICtrlCreateInput('', 10, 30, 170, 21) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Examples I have long text in clipboard and I can paste it in Input, but cant paste it in edit. Got just blinking cursor. I think it has to do something with styles. Im using ES_AUTHSCROLL on edit to remove the scroll bar from it.
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 Its weird I coundt paste anything in it for a while, but the exast same code works now. I wll try to find a way to reproduce it better.
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 I HAVE IT. I cant past MULTILINE clipboard text into Edit. Why?
Moderators Melba23 Posted February 24, 2021 Moderators Posted February 24, 2021 (edited) JulianDelphiki, Quote I cant past MULTILINE clipboard text into Edi Aha, all becomes clear. It is because you are removing the $ES_MULTILINE style with your code - normally it is forced but you are overriding the style with your "128" magic number. So you need to add that style to the creation code and you should be able to paste multiple lines. M23 P.S. I recommend the Setting Styles tutorial in the Wiki to understand how styles are applied - or not. Edited February 24, 2021 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 Doing this: GUICtrlCreateEdit('', 10, 10, 170, 21, BitOr(128, 4)); $ES_AUTOHSCROLL + $ES_MULTILNE GUICtrlCreateInput('', 10, 30, 170, 21) Wil make even the input control broken for multiline paste..
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 So simply sad I cant paste multiline text into single line control?
Moderators Melba23 Posted February 24, 2021 Moderators Posted February 24, 2021 JulianDelphiki, You do give up easily! Try this: #include <GUIConstantsEx.au3> #include <GuiScrollBars.au3> Example() Func Example() GUICreate("My GUI edit", 200, 70) $cEdit = GUICtrlCreateEdit('', 10, 10, 170, 21) ; Create a standard edit control with ALL the normal styles _GUIScrollBars_ShowScrollBar(GUICtrlGetHandle($cEdit), $SB_BOTH, False) ; Hide the scrollbars GUICtrlCreateInput('', 10, 30, 170, 21) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() EndFunc ;==>Example How is that? M23 P.S. When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 I have to find a way to make one line from mulitiline. Your solution is nice but the line breaks are persistent and the text basicly "scrolls" over over line.
Moderators Melba23 Posted February 24, 2021 Moderators Posted February 24, 2021 JulianDelphiki, You are now becoming annoying as you continually change your requirements. Why did you not state this at the start - then we would not have wasted so much time. If you wish to convert the multiline clip to single line you need to remove the EOL markers (@CR, @LF or @CRLF). I suggest you use StringReplace to do this. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JulianDelphiki Posted February 24, 2021 Author Posted February 24, 2021 Sorry for that but thank you anyway. I really apreciate it. I think the core of the problem is solved.
JulianDelphiki Posted February 25, 2021 Author Posted February 25, 2021 (edited) if $code = $EN_MAXTEXT then; multiline clip exceed notification $clip_buff = ClipGet() if $clip_buff <> '' then GUICtrlSetData($id, GUICtrlRead($id) & StringReplace(StringReplace($clip_buff, @CRLF, ' '), @CR, ' ')) endif endif I came up with solution to hook $EN_MAXTEXT notification(inside registered message handler) generated after trying to paste multiline clip into single line edit and simply append clip data with replaced newlines. Edited February 25, 2021 by JulianDelphiki typo
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