Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Win32::GUI::Richedit strange results for deselecting a selection

by Athanasius (Archbishop)
on Feb 07, 2013 at 14:37 UTC ( [id://1017669]=note: print w/replies, xml ) Need Help??


in reply to Win32::GUI::Richedit strange results for deselecting a selection

I suspect that Anonymous Monk’s reply is the best advice. However, if you need to persevere with Win32::GUI, the following strategy might provide an acceptable workaround:

  • Create an additional read-only text box to display the text selected in the RichEdit control (by calling $re->GetSelText()).
  • Update this on every MouseUp event.
  • Also provide a “Cancel” button to allow the user to set the RichEdit control text selection to the empty string.
  • When the “Cancel” button is pressed, blank-out the read-only text box and reset the RichEdit control.
  • Implement the “Copy Selected Text” button as originally intended.

The advantage is that the user can see the current selection, so knows when it’s necessary to press the “Cancel” button. The main disadvantage is the provision of an extra widget.

I haven’t attempted to implement this idea. Just a thought, and I hope it helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Win32::GUI::Richedit strange results for deselecting a selection
by Anonymous Monk on Feb 07, 2013 at 15:15 UTC

    the following strategy might provide an acceptable workaround

    Or patch Richedit.xs so selchange works :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1017669]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-19 04:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found