This class implements the list view of the map editor groups. More...
Public Member Functions | |
GroupsListViewT (GroupsToolbarT *Parent, ChildFrameT *ChildFrame, wxWindowID ID) | |
bool | DeleteAllItems () |
long | InsertItem (long index, const wxString &label, int imageIndex) |
void | SetClientData (unsigned long item, GroupT *CD) |
ArrayT< GroupT * > | GetSelectedGroups () const |
This class implements the list view of the map editor groups.
It derives from wxListView (rather than using a wxListView instance in the user code directly), so that we can (more easily) deal with mouse events (which are reported in window space) and size events. (wxDataViewListCtrl might have been a better choice than wxListView, but can only be done post-wx2.8.x.)
It also extends the wxListView base class by "client data" for each item, special-cased to our needs as pointers to GroupT. Nearly all GroupsToolbarT code could have been implemented without keeping this explicit client data (the item numbers into m_MapDoc.GetGroups() would have been sufficient), except for one place in GroupsToolbarT::NotifySubjectChanged_Groups(), where the m_MapDoc.GetGroups() have already been changed but we must still learn which groups were selected before the change.