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:
twanvl
2006-12-22 15:33:14 +00:00
parent 274cb1117f
commit a16c098eac
10 changed files with 41 additions and 35 deletions
+14
View File
@@ -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);