Opened 22 months ago

Last modified 21 months ago

#17968 new defect

Multiple wxStyledTextCtrl shortcut mis-handling

Reported by: evstevemd Owned by:
Priority: normal Milestone:
Component: wxStyledText Version: dev-latest
Keywords: Cc: mwinjilisti@…
Blocked By: Blocking:
Patch: no

Description

I have observed that when I have mutiple wxStyledTextCtrl in different places only one of them processed shortcuts and the rest does not get a chance even when they have a focus.

Here is the scenario:

Let say STCs are s1, s2 and s2.

  • If focus is with s1 Ctrl+C copies selected text from s1 - Good
  • move cursor to s2 and do Ctr+C, it copies selection from s1 - Bad
  • move cursor to s3 and do Ctr+C, it copies selection from s1 - Bad

Here is git diff for STC sample to test.

diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp
index 34ab8a8..52fb80b 100644
--- a/samples/stc/stctest.cpp
+++ b/samples/stc/stctest.cpp
@@ -824,9 +824,11 @@ public:
     MinimalEditorFrame() : wxFrame(NULL, wxID_ANY, _("Minimal Editor"))
     {
         MinimalEditor* editor = new MinimalEditor(this);
+        MinimalEditor* editor2 = new MinimalEditor(this);
         editor->SetFont(wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT));
         wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL);
         sizer->Add(editor, 1, wxEXPAND);
+        sizer->Add(editor2, 1, wxEXPAND);
         SetSizer(sizer);
         editor->SetText(
            "<xml>\n"

Just apply the patch below and then select text on an open editor. Go to menu (Window->Minima Editor) and it will open two more editors in a dialog.
Try select text in any of the two and do Ctrl+X and see that it cuts text from first editor not the current.

Change History (2)

comment:1 follow-up: Changed 22 months ago by awi

  • Patch unset
  • Status changed from new to infoneeded_new

Under which platform have you observed this issue? I briefly tested wxSTC under wxMSW and haven't seen any strange behaviour with clipboard.

comment:2 in reply to: ↑ 1 Changed 21 months ago by evstevemd

  • Cc mwinjilisti@… added
  • Status changed from infoneeded_new to new

Replying to awi:

Under which platform have you observed this issue? I briefly tested wxSTC under wxMSW and haven't seen any strange behaviour with clipboard.

Hi sorry for late reply. I tested only under OSX. Currently I don't have access to Windows nor Linux. When I do I will test with same app to see if they are affected too

Note: See TracTickets for help on using tickets.