Jump to content

Win10 Edit paste long text problem


Recommended Posts

#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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

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 by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by JulianDelphiki
typo
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...