mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
55 lines
853 B
C++
55 lines
853 B
C++
#include "LayDes.h"
|
|
|
|
void PropertyPane::Layout()
|
|
{
|
|
sb.SetTotal(y);
|
|
sb.SetPage(GetSize().cy);
|
|
}
|
|
|
|
void PropertyPane::Clear()
|
|
{
|
|
y = 0;
|
|
sb.Set(0, 0, 0);
|
|
while(pane.GetFirstChild())
|
|
pane.GetFirstChild()->Remove();
|
|
}
|
|
|
|
void PropertyPane::Add(ItemProperty& c)
|
|
{
|
|
pane.Add(c);
|
|
int cy = c.GetHeight();
|
|
c.HSizePos().TopPos(y, cy);
|
|
y += cy;
|
|
pane.TopPos(0, y);
|
|
Layout();
|
|
}
|
|
|
|
void PropertyPane::Scroll()
|
|
{
|
|
pane.TopPos(-sb, y);
|
|
}
|
|
|
|
void PropertyPane::ChildGotFocus()
|
|
{
|
|
Ctrl *f = GetFocusCtrl();
|
|
for(Ctrl *q = pane.GetFirstChild(); q; q = q->GetNext())
|
|
if(q->HasChildDeep(f)) {
|
|
Rect r = q->GetRect();
|
|
sb.ScrollInto(r.top, r.Height());
|
|
break;
|
|
}
|
|
}
|
|
|
|
void PropertyPane::AfterCreate()
|
|
{
|
|
Ctrl::Add(pane.HSizePos());
|
|
}
|
|
|
|
PropertyPane::PropertyPane()
|
|
{
|
|
Clear();
|
|
SetFrame(sb);
|
|
sb.AutoHide();
|
|
sb.WhenScroll = THISBACK(Scroll);
|
|
Color(SColorFace);
|
|
}
|