mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
Remove erase background event handlers, in favor of SetBackgroundStyle.
This commit is contained in:
@@ -42,12 +42,12 @@ public:
|
||||
{}
|
||||
};
|
||||
|
||||
class MessageCtrl : public wxPanel {
|
||||
class MessageCtrl : public wxControl {
|
||||
public:
|
||||
MessageCtrl(wxWindow* parent, int id)
|
||||
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME | wxVSCROLL)
|
||||
: wxControl(parent, id, wxDefaultPosition, wxDefaultSize, wxBORDER_THEME | wxWANTS_CHARS | wxVSCROLL)
|
||||
{
|
||||
SetBackgroundStyle(wxBG_STYLE_CUSTOM);
|
||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
// icons
|
||||
static_assert(MESSAGE_TYPE_MAX == 7);
|
||||
icons[MESSAGE_NONE] = wxBitmap();
|
||||
@@ -102,6 +102,10 @@ public:
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool AcceptsFocus() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
@@ -225,7 +229,6 @@ private:
|
||||
|
||||
// --------------------------------------------------- : Drawing
|
||||
|
||||
void onEraseBackground(wxEraseEvent&) {}
|
||||
void onPaint(wxPaintEvent& ev) {
|
||||
wxAutoBufferedPaintDC dc(this);
|
||||
PrepareDC(dc);
|
||||
@@ -382,7 +385,6 @@ BEGIN_EVENT_TABLE(MessageCtrl,wxScrolledWindow)
|
||||
EVT_KILL_FOCUS(MessageCtrl::onFocus)
|
||||
EVT_SCROLLWIN(MessageCtrl::onScroll)
|
||||
EVT_MOUSEWHEEL(MessageCtrl::onMouseWheel)
|
||||
EVT_ERASE_BACKGROUND(MessageCtrl::onEraseBackground)
|
||||
EVT_SIZE(MessageCtrl::onSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ void StylePanel::selectCard(const CardP& card) {
|
||||
// ----------------------------------------------------------------------------- : Clipboard
|
||||
|
||||
// determine what control to use for clipboard actions
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
#define CUT_COPY_PASTE(op,return) \
|
||||
if (!isInitialized()) return false; \
|
||||
int id = focused_control(this); \
|
||||
if (id == ID_EDITOR) { return editor->op(); } \
|
||||
else { return false; }
|
||||
|
||||
|
||||
@@ -48,7 +48,10 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
||||
, number_of_recent_sets(0)
|
||||
{
|
||||
SetIcon(load_resource_icon(_("app")));
|
||||
|
||||
|
||||
// avoid flicker
|
||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
|
||||
// initialize menu bar
|
||||
auto menuBar = new wxMenuBar();
|
||||
auto menuFile = new wxMenu();
|
||||
@@ -899,5 +902,4 @@ BEGIN_EVENT_TABLE(SetWindow, wxFrame)
|
||||
EVT_CARD_SELECT (wxID_ANY, SetWindow::onCardSelect)
|
||||
EVT_CARD_ACTIVATE (wxID_ANY, SetWindow::onCardActivate)
|
||||
EVT_SIZE_CHANGE (wxID_ANY, SetWindow::onSizeChange)
|
||||
EVT_ERASE_BACKGROUND( SetWindow::onEraseBackground)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
@@ -172,6 +172,5 @@ private:
|
||||
void onIdle (wxIdleEvent&);
|
||||
|
||||
void onSizeChange (wxCommandEvent&);
|
||||
void onEraseBackground (wxEraseEvent&) {} // reduce flicker
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user