List Info

Thread: DB: Copy/Cut/Paste messes up control IDs and event handlers.




DB: Copy/Cut/Paste messes up control IDs and event handlers.
user name
2006-08-21 18:39:46

Complete loss of event handlers, duplicate event handlers, or messed up event handlers. A
few problems related to cut/copy/paste objects within db:

Whenever you cut and paste an object (or parent object with all its children), the ID for the
controls gets reset. That is, I may have had a button with an id such as ID_SAVE_STATE.
Once I cut that button and paste it (either exactly where it was or as a child of some other
control), the id goes back to ID_BUTTON. This messes up whatever event handler I may
have had for the control. When I rename the id (to what it used to be), db creates
duplicate event handlers (for those controls that had event handlers of course).

Using a notebook control as an example. Once created (using a series wxWizardPage
panels), if you copy and paste an entire page, db goes haywire. This is one case where I
expect the id to be reset (it shouldn't when he control is "Cut" but it should when using
"Copy" - the logic for the paste should depend on the nth instance of the paste action).
Some ids are reset others aren't. What is worse is that the existing event handlers (from
the page I copied from) are renamed to the new page class. That is, I may have an existing
page "CFirstPage"; with all its controls, event handlers and whatnot. If I copy this page and
paste as a child of the notebook (effectively adding a new page), and rename the new class
to "CSecondPage", all event handlers that existed for CFirstPage are renamed to
CSecondPage. The first page just lost all of its event handlers.

I know this is confusing but it should be simple to reproduce. Is this expected behavior
and I'm doing something stupid or is it indeed a problem?

Thanks!

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )