mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Implemented NewSetWindow, added events to GalleryList
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@48 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -8,6 +8,11 @@
|
||||
|
||||
#include <gui/control/gallery_list.hpp>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
DEFINE_EVENT_TYPE(EVENT_GALLERY_SELECT);
|
||||
DEFINE_EVENT_TYPE(EVENT_GALLERY_ACTIVATE);
|
||||
|
||||
// ----------------------------------------------------------------------------- : GalleryList
|
||||
|
||||
const int MARGIN = 2; // margin around items
|
||||
@@ -77,12 +82,12 @@ void GalleryList::onLeftDown(wxMouseEvent& ev) {
|
||||
if (item != selection && item < itemCount()) {
|
||||
selection = item;
|
||||
update();
|
||||
sendEvent(EVENT_GALLERY_SELECT);
|
||||
}
|
||||
}
|
||||
|
||||
void GalleryList::onLeftDClick(wxMouseEvent& ev) {
|
||||
// activate an item
|
||||
// TODO
|
||||
sendEvent(EVENT_GALLERY_ACTIVATE);
|
||||
}
|
||||
|
||||
void GalleryList::onKeyDown(wxKeyEvent& ev) {
|
||||
@@ -160,6 +165,11 @@ void GalleryList::OnDraw(DC& dc) {
|
||||
}
|
||||
}
|
||||
|
||||
void GalleryList::sendEvent(WXTYPE type) {
|
||||
wxCommandEvent ev(type, GetId());
|
||||
ProcessEvent(ev);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Event table
|
||||
|
||||
BEGIN_EVENT_TABLE(GalleryList, wxScrolledWindow)
|
||||
|
||||
Reference in New Issue
Block a user