#include <wx/addremovectrl.h>
Object used to mediate between wxAddRemoveCtrl and the control showing the list of items which can be added or removed.
This is a base class from which custom classes used with wxAddRemoveCtrl::SetAdaptor() must be derived. Object of this class are typically associated with the control showing the list of items on creation, i.e. the derived class constructor would normally take a pointer to the control which will be returned from GetItemsCtrl() later.
Public Member Functions | |
wxAddRemoveAdaptor () | |
Default and trivial constructor. More... | |
virtual | ~wxAddRemoveAdaptor () |
Trivial but virtual destructor. More... | |
virtual wxWindow * | GetItemsCtrl () const =0 |
Override to return the associated control. More... | |
virtual bool | CanAdd () const =0 |
Override to return whether a new item can be added to the control. More... | |
virtual bool | CanRemove () const =0 |
Override to return whether the currently selected item (if any) can be removed from the control. More... | |
virtual void | OnAdd ()=0 |
Called when an item should be added. More... | |
virtual void | OnRemove ()=0 |
Called when the current item should be removed. More... | |
wxAddRemoveAdaptor::wxAddRemoveAdaptor | ( | ) |
Default and trivial constructor.
|
virtual |
Trivial but virtual destructor.
|
pure virtual |
Override to return whether a new item can be added to the control.
A typical implementation would simply always return true, but it is also possible to return false if the list is "full" and can't contain any more elements.
|
pure virtual |
Override to return whether the currently selected item (if any) can be removed from the control.
The implementation should check if there is a currently selected item and possibly if the user is allowed to remove this item.
|
pure virtual |
Override to return the associated control.
The control must be a child of the associated wxAddRemoveCtrl.
|
pure virtual |
Called when an item should be added.
A typical implementation would either add a new item to the list control and start editing it in place or ask the user for the item to add first and then add it to the control returned by GetItemsCtrl().
Notice that this method can only be called if CanAdd() currently returns true.
|
pure virtual |
Called when the current item should be removed.
The implementation should remove the currently selected item from the control and update the selection.
Notice that this method can only be called if CanRemove() currently returns true.