#117 Paste sometimes produces duplicate controls

closed
2015-12-30
2007-09-18
Roel van Os
No

When pasting a control into an empty slot, wxGlade sometimes pastes the control twice (in the same slot).

Steps to reproduce:
- start wxGlade with an empty project
- create a new frame
- add a slot to the main boxsizer that was automatically created
- add a label to the first slot
- click on the label in the design frame (not in the application tree), and copy it using CTRL-C
- click the second slot, and paste the label using CTRL-V

Result: the label is pasted twice.

Workaround: the same does not occur when you paste using the context menu of the slot.

Note that -- at least in my case -- the first label retains its editing handlers (the blue squares) when you click on the second slot.

Version info:
- KUbuntu Feisty, running under KDE
- Python 2.5.1
- wxPython 2.6.3.2
- wxGlade: http://wxglade.sourceforge.net/hg/wxGlade/file/59cfa4bcad62

I've traced the problem to the following: the EVT_KEY_DOWN event is raised twice when you press CTRL-V. One of the events is bound on line 46 of edit_sizers/edit_sizers.py, the other on line 487 of edit_windows.py. I don't yet understand enough of wxGlade's internals to fix this.

Discussion

  • Roel van Os

    Roel van Os - 2007-09-18

    Logged In: YES
    user_id=1523350
    Originator: YES

    The same problem occurs with wxPython 2.8.1.1 (other versions unchanged).

     
  • Alberto Griggio

    Alberto Griggio - 2007-09-19

    Logged In: YES
    user_id=375945
    Originator: NO

    Thanks, it should be fixed now

    Alberto

     
  • Roel van Os

    Roel van Os - 2007-09-19

    Logged In: YES
    user_id=1523350
    Originator: YES

    That change indeed solves the problem of the double paste, however now delete does not always work.

    Steps to reproduce:
    - start wxGlade with an empty project
    - add a frame
    - add a label to the main sizer's only slot

    When you then press delete, the label is not deleted. The label is selected when it is inserted (the blue boxes appear), however the delete key does nothing. To make the delete key work, you have to select the sizer's handle, then select the label again.

     
  • Alberto Griggio

    Alberto Griggio - 2007-09-22

    Logged In: YES
    user_id=375945
    Originator: NO

    Now also delete should work...

    Thanks!
    Alberto

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks