GxVec2i GxSliderAbstract::myGetValuePos() const { bool isV = IsVertical(); GxRecti r = RectTr(isV, myGetBarRect()); double xMin = (double)(r.x); double xMax = (double)(r.x + r.w); double x = GxRemap(myValue, myBegin, myEnd, xMin, xMax); return VecTr(isV, GxInt(x), r.y + r.h/2); }
GxRecti GxSelectList::myGetListRect() const { if(myScrollbar->IsHidden()) { GxRecti r = myRect; r.Shrink(2); return r; } const int ofs = 2 - GxInt(myScrollbar->GetValue()); return GxRecti(myRect.x + 2, myRect.y + ofs, myRect.w - 20, myItems.Size() * 16); }
void GxDockBin::SetRect(const GxRecti& rect) { GxRecti r = myRect = rect; if(!myScrollbar->IsHidden()) { GxVec2i size = myLayout.GetPreferredSize(); int end = GxMax(0, size.y - myRect.h); myScrollbar->SetRange(0, end, myRect.h, 32); GxRecti bar(r); bar.x += bar.w - scrollbarW; bar.w = scrollbarW; myScrollbar->SetRect(bar); r.y -= GxInt(myScrollbar->GetValue()); r.w -= scrollbarW; } myLayout.Arrange(r); }
int GxSliderAbstract::GetIntValue() const { return GxInt(myValue); }
int GxSliderEdit::GetIntValue() const { return GxInt(myValue); }