CtrkCore: Chameleon now synced after parameter changes

git-svn-id: svn://ultimatepp.org/upp/trunk@3763 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-08-15 13:25:39 +00:00
parent 915edd0234
commit e58842ca75
4 changed files with 614 additions and 583 deletions

View file

@ -548,6 +548,7 @@ bool Ctrl::IsOcxChild()
Ctrl::Ctrl() {
GuiLock __;
ChSync();
LLOG("Ctrl::Ctrl");
GuiPlatformConstruct();
destroying = false;
@ -709,6 +710,7 @@ Size Ctrl::Csize;
void InitRichTextZoom()
{
SetRichTextStdScreenZoom(Ctrl::HorzLayoutZoom(96), 600);
ChInvalidate();
}
void Ctrl::Csizeinit()
@ -729,13 +731,15 @@ void Ctrl::SetZoomSize(Size sz, Size bsz)
{
GuiLock __;
Csize = sz;
Dsize = bsz;
Dsize = bsz;
ChInvalidate();
}
void Ctrl::NoLayoutZoom()
{
GuiLock __;
Csize = Dsize = Size(1, 1);
ChInvalidate();
}
void Ctrl::GetZoomRatio(Size& m, Size& d)
@ -910,6 +914,16 @@ void Ctrl::ChSync()
ChFinish();
}
void Ctrl::SyncCh()
{
static Font prevfont;
Font std = GetStdFont();
if(prevfont != std || ChIsInvalidated()) {
ChSync();
prevfont = std;
}
}
void Ctrl::Xmlize(XmlIO xml)
{
Value v = GetData();

View file

@ -496,6 +496,7 @@ private:
void RemoveChild0(Ctrl *q);
static void SyncCh();
static void ChSync();
static int FindMoveCtrl(const VectorMap<Ctrl *, MoveCtrl>& m, Ctrl *x);

File diff suppressed because it is too large Load diff

View file

@ -35,6 +35,9 @@ void ChInflateMargins(Rect& r, const Value& look);
void InflateMargins(Size& sz, const Rect& m);
void ChInflateMargins(Size& sz, const Value& look);
void ChInvalidate();
bool ChIsInvalidated();
template <class T>
struct ChStyle {
byte status;
@ -42,7 +45,7 @@ struct ChStyle {
T *standard;
const T& Standard() const { return *standard; }
T& Write() const { T& x = *(T *)this; x.status = 2; return x; }
T& Write() const { T& x = *(T *)this; x.status = 2; ChInvalidate(); return x; }
void Assign(const T& src) { *(T *)this = src; }
ChStyle() { status = 0; registered = 0; standard = NULL; }