mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
Layout() always called when editor/viewer control changes size
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@145 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
#include <data/stylesheet.hpp>
|
||||
#include <wx/dcbuffer.h>
|
||||
|
||||
// ----------------------------------------------------------------------------- : Events
|
||||
|
||||
DEFINE_EVENT_TYPE(EVENT_SIZE_CHANGE);
|
||||
|
||||
// ----------------------------------------------------------------------------- : CardViewer
|
||||
|
||||
CardViewer::CardViewer(Window* parent, int id, long style)
|
||||
@@ -30,6 +34,16 @@ void CardViewer::onChange() {
|
||||
up_to_date = false;
|
||||
}
|
||||
|
||||
void CardViewer::onChangeSize() {
|
||||
wxSize ws = GetSize(), cs = GetClientSize();
|
||||
wxSize desired_cs = (wxSize)getRotation().getExternalSize() + ws - cs;
|
||||
if (desired_cs != cs) {
|
||||
wxCommandEvent ev(EVENT_SIZE_CHANGE, GetId());
|
||||
ProcessEvent(ev);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
DECLARE_DYNAMIC_ARG(bool, inOnPaint);
|
||||
IMPLEMENT_DYNAMIC_ARG(bool, inOnPaint, false);
|
||||
|
||||
Reference in New Issue
Block a user