lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Pasting between multiline edit controls


From: Greg Chicares
Subject: [lmi] Pasting between multiline edit controls
Date: Thu, 08 Oct 2015 23:49:01 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.3.0

I was elaborating a test case for group quotes, and stumbled upon this.

Pasting from one multiline edit control to another causes newlines to be
translated to semicolons--because that's what pasting from the clipboard
does in lmi--because we deliberately coded it that way--because end users
wanted to paste from spreadsheet columns into input-sequence fields, but
we didn't want to restrict it to such fields--because at that time we did
not distinguish such (input-sequence) fields.

  /// At least for now, this transformation is performed iff the paste
  /// target is a wxTextCtrl.

  void Skeleton::UponPaste(wxClipboardTextEvent& event)
  {
...
      wxTextCtrl* t = dynamic_cast<wxTextCtrl*>(event.GetEventObject());

I'd like to consider a change like
-      wxTextCtrl* t = dynamic_cast<wxTextCtrl*>(event.GetEventObject());
+      wxTextCtrl* t = 
dynamic_cast<InputSequenceEntry*>(event.GetEventObject());

But wxTextCtrl is not the base class (as I naively anticipated it to be)...

  class InputSequenceEntry: public wxPanel
NOT wxTextCtrl.....................^^^^^^^

...and for all I know this might be a better place to make a change...

        // Intercept 'Text Paste' events for all windows.
ALL WINDOWS INTERCEPTED......................^^^^^^^^^^^
        Connect
            (wxEVT_COMMAND_TEXT_PASTE
            ,wxClipboardTextEventHandler(Skeleton::UponPaste)
            );

...so we'll work more efficiently if I stick to my own specialty, and
ask for help here, noting by the way that we don't want to break this:
  void Skeleton::UponTestPasting(wxCommandEvent&)
  {
      wxTextCtrl* t = new wxTextCtrl(frame_, wxID_ANY, "Testing...");
      ^^^^^^^^^^          ^^^^^^^^^^

But let's say OXI for now and then change our minds after Oxi Day.
Or should we do it sooner (if it's easy enough) because an end user
might want to paste multiline text from one census into another?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]