mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Moved spec_sort to separate file, added more advanced options;
Split 'sort' script function into 'sort_text' and 'sort_list'; Double clicking card in stats panel switches to cards panel git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@587 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -33,6 +33,7 @@ DECLARE_TYPEOF_COLLECTION(CardListBase*);
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
DEFINE_EVENT_TYPE(EVENT_CARD_SELECT);
|
||||
DEFINE_EVENT_TYPE(EVENT_CARD_ACTIVATE);
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardListBase
|
||||
|
||||
@@ -352,11 +353,18 @@ void CardListBase::onContextMenu(wxContextMenuEvent&) {
|
||||
}
|
||||
}
|
||||
|
||||
void CardListBase::onItemActivate(wxListEvent& ev) {
|
||||
selectItemPos(ev.GetIndex(), false);
|
||||
CardSelectEvent event(getCard(), EVENT_CARD_ACTIVATE);
|
||||
ProcessEvent(event);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardListBase : Event table
|
||||
|
||||
BEGIN_EVENT_TABLE(CardListBase, ItemList)
|
||||
EVT_LIST_COL_RIGHT_CLICK (wxID_ANY, CardListBase::onColumnRightClick)
|
||||
EVT_LIST_COL_END_DRAG (wxID_ANY, CardListBase::onColumnResize)
|
||||
EVT_LIST_ITEM_ACTIVATED (wxID_ANY, CardListBase::onItemActivate)
|
||||
EVT_CHAR ( CardListBase::onChar)
|
||||
EVT_MOTION ( CardListBase::onDrag)
|
||||
EVT_MENU (ID_SELECT_COLUMNS, CardListBase::onSelectColumns)
|
||||
|
||||
@@ -19,17 +19,25 @@ DECLARE_POINTER_TYPE(Field);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
DECLARE_EVENT_TYPE(EVENT_CARD_SELECT, <not used>)
|
||||
/// Handle CardSelectEvents
|
||||
DECLARE_EVENT_TYPE(EVENT_CARD_SELECT, <not used>)
|
||||
DECLARE_EVENT_TYPE(EVENT_CARD_ACTIVATE, <not used>)
|
||||
|
||||
/// Handle EVENT_CARD_SELECT events
|
||||
#define EVT_CARD_SELECT(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_SELECT, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
(void (wxEvtHandler::*)(CardSelectEvent&)) (&handler), (wxObject*) NULL),
|
||||
|
||||
/// Handle EVENT_CARD_ACTIVATE events
|
||||
#define EVT_CARD_ACTIVATE(id, handler) \
|
||||
DECLARE_EVENT_TABLE_ENTRY(EVENT_CARD_ACTIVATE, id, -1, \
|
||||
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) \
|
||||
(void (wxEvtHandler::*)(CardSelectEvent&)) (&handler), (wxObject*) NULL),
|
||||
|
||||
/// The event of selecting a card
|
||||
struct CardSelectEvent : public wxCommandEvent {
|
||||
inline CardSelectEvent(const CardP& card)
|
||||
: wxCommandEvent(EVENT_CARD_SELECT), card(card)
|
||||
inline CardSelectEvent(const CardP& card, int type = EVENT_CARD_SELECT)
|
||||
: wxCommandEvent(type), card(card)
|
||||
{}
|
||||
|
||||
CardP card; ///< The selected card
|
||||
@@ -122,11 +130,12 @@ class CardListBase : public ItemList, public SetView {
|
||||
// --------------------------------------------------- : Window events
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
void onColumnRightClick(wxListEvent& ev);
|
||||
void onColumnResize (wxListEvent& ev);
|
||||
void onSelectColumns (wxCommandEvent& ev);
|
||||
void onChar (wxKeyEvent& ev);
|
||||
void onDrag (wxMouseEvent& ev);
|
||||
void onColumnRightClick(wxListEvent&);
|
||||
void onColumnResize (wxListEvent&);
|
||||
void onItemActivate (wxListEvent&);
|
||||
void onSelectColumns (wxCommandEvent&);
|
||||
void onChar (wxKeyEvent&);
|
||||
void onDrag (wxMouseEvent&);
|
||||
void onContextMenu (wxContextMenuEvent&);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user