mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
* 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:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -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&);
|
||||
|
||||
Reference in New Issue
Block a user