* compatibility with wxWdigets 2.9+: Handle MOUSE_CAPTURE_LOST event

* use wxBORDER_THEME for custom controls

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1553 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-12-07 21:22:22 +00:00
parent 1ece54c899
commit 24c95b0f33
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
// ----------------------------------------------------------------------------- : SymbolControl
SymbolControl::SymbolControl(SymbolWindow* parent, int id, const SymbolP& symbol)
: wxControl(parent, id)
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME)
, SymbolViewer(symbol, true)
, parent(parent)
{
+6 -1
View File
@@ -29,7 +29,7 @@ DEFINE_EVENT_TYPE(EVENT_PART_ACTIVATE);
SymbolPartList::SymbolPartList(Window* parent, int id, SymbolPartsSelection& selection, SymbolP symbol)
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxVSCROLL)
: wxScrolledWindow(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME | wxVSCROLL)
, selection(selection)
, state_icons(9,8)
{
@@ -218,6 +218,10 @@ void SymbolPartList::onMotion(wxMouseEvent& ev) {
}
}
}
void SymbolPartList::onLoseCapture(wxMouseCaptureLostEvent&) {
// We already test for wrong release with HasCapture()
// but stupid wxwidget people decided to throw assertion failures
}
void SymbolPartList::onLeftDClick(wxMouseEvent& ev) {
// double click = activate
@@ -551,4 +555,5 @@ BEGIN_EVENT_TABLE(SymbolPartList, wxScrolledWindow)
EVT_CHAR (SymbolPartList::onChar)
EVT_PAINT (SymbolPartList::onPaint)
EVT_SIZE (SymbolPartList::onSize)
EVT_MOUSE_CAPTURE_LOST(SymbolPartList::onLoseCapture)
END_EVENT_TABLE ()
+1
View File
@@ -72,6 +72,7 @@ class SymbolPartList : public wxScrolledWindow, public SymbolView {
void onLeftDClick(wxMouseEvent& ev);
void onLeftUp (wxMouseEvent& ev);
void onMotion (wxMouseEvent& ev);
void onLoseCapture(wxMouseCaptureLostEvent&);
void onChar(wxKeyEvent& ev);
void onPaint(wxPaintEvent&);
void onSize(wxSizeEvent&);