Commit 5bb79f8f authored by twanvl's avatar twanvl

* compatibility with wxWdigets 2.9+: Handle MOUSE_CAPTURE_LOST event

* use wxBORDER_THEME for custom controls
parent de6fc875
......@@ -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&);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment