I just add a parameter to the constructor to choose which situation I want and save the parameter as a member of the class. In the appropriate event handlers I just check the saved parameter and do the appropriate action.

I also have windows that I use for adding or editing an item and this works well for me.

I hope that helps.

Cheers,
  Malcolm Smith

On Jul 10, 2006, at 12:35 PM, Tomas Camin wrote:

Hi all,

I've got a window full of controls (itemwindow) that I would like to use in 2 different situations, one for editing and one for adding. The only difference between the 2 windows is the open event and the action event in one pushbutton.

What I did is to subclass the itemwindow (edititemwindow and additemwindow) to have a custom open event, but what is the best way to handle the diffectent action events in the pushbutton? I though to subclass the button as well (editpbitemwindow and addpbitemwindow), but in this way I had the code spread in 4 different classes (2 for the edit part and 2 for the add).

Thanks,
Tomas

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to