diff --git a/bazaar/ExpandFrame/ExpandFrame.cpp b/bazaar/ExpandFrame/ExpandFrame.cpp index dba642648..a952039f1 100644 --- a/bazaar/ExpandFrame/ExpandFrame.cpp +++ b/bazaar/ExpandFrame/ExpandFrame.cpp @@ -37,13 +37,18 @@ void ExpandFrame::ImgButton::Paint(Draw &w) { if (p->hasarrow) w.DrawImage(sz.cx - isz.cx + dx - 5, (sz.cy - isz.cy) / 2 + dy, img); - w.DrawText(4, 1, p->GetTitle()); + w.DrawText(4, 1, p->GetTitle(), st->font); } else { if (p->hasarrow) - w.DrawImage((sz.cx - isz.cx) / 2, sz.cy - isz.cy + dy - 5, img); - w.DrawText(p->TitleSz() - 1, 4, 2700, p->GetTitle()); + w.DrawImage((sz.cx - isz.cx) / 2, 5, img); + if (p->type == RIGHT) + w.DrawText(p->TitleSz() - 1, 4 + isz.cy + 5, 2700, p->GetTitle(), st->font); + else { + const WString &s = p->GetTitle(); + w.DrawText(1, 4 + GetTextSize(s, st->font).cx + isz.cy + 5, 900, s, st->font); + } } } } diff --git a/bazaar/ExpandFrame/ExpandFrame.h b/bazaar/ExpandFrame/ExpandFrame.h index 11a4591d1..b91a68dc2 100644 --- a/bazaar/ExpandFrame/ExpandFrame.h +++ b/bazaar/ExpandFrame/ExpandFrame.h @@ -78,7 +78,6 @@ public: ExpandFrame& Right(Ctrl& c, int size = -1) { return Set(c, (size < 0) ? c.GetMinSize().cx : HorzLayoutZoom(size), RIGHT); } ExpandFrame& Bottom(Ctrl& c, int size = -1) { return Set(c, (size < 0) ? c.GetMinSize().cy : VertLayoutZoom(size), BOTTOM); } ExpandFrame& SetStyle(const Style *_style) { style = _style; SetChildPos(); UpdateButton(); RefreshParentLayout(); return *this; } - ExpandFrame& IgnoreFocus(bool ignore = true) { ignorefocus = ignore; if (!childfocus) Refresh(); } ExpandFrame& Expand(bool _expand = true); @@ -124,6 +123,8 @@ public: ExpandFrame & AddExpander(Ctrl &c, bool expand, int size = -1); ExpanderCtrl & SetStyle(const ExpandFrame::Style &s) { style = &s; return *this; } + + ExpandFrame & Get(int i) { return exp[i]; } ExpanderCtrl & Horz(bool v = true); ExpanderCtrl & Vert(bool v = true) { return Horz(!v); } diff --git a/bazaar/ExpandFrame/ExpanderCtrl.cpp b/bazaar/ExpandFrame/ExpanderCtrl.cpp index 6846035ff..233bf9cdd 100644 --- a/bazaar/ExpandFrame/ExpanderCtrl.cpp +++ b/bazaar/ExpandFrame/ExpanderCtrl.cpp @@ -37,9 +37,17 @@ ExpandFrame & ExpanderCtrl::AddExpander(Ctrl &c, bool expand, int size) ExpanderCtrl & ExpanderCtrl::Horz(bool v) { - ASSERT(!GetCount()); // Don't call unless empty! + if (v == horz) return *this; + horz = v; scroll.Horz(v); + if (horz) + for (int i = 0; i < exp.GetCount(); i++) + exp[i].Left(*exp[i].GetLastChild()); + else + for (int i = 0; i < exp.GetCount(); i++) + exp[i].Top(*exp[i].GetLastChild()); + Repos(); return *this; }