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:
twanvl
2006-10-20 20:02:30 +00:00
parent 77d255ee8e
commit 46cf4dbb64
17 changed files with 259 additions and 25 deletions
+12 -2
View File
@@ -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)