2017-10-25 22:21:13 +00:00
|
|
|
Class KFGUI_ScrollBarV_CD extends KFGUI_ScrollBarV;
|
|
|
|
|
|
|
|
function DrawMenu()
|
|
|
|
{
|
|
|
|
local float A;
|
|
|
|
local byte i;
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bDisabled)
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetDrawColor(5, 5, 5, 0);
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (bFocused || bGrabbedScroller)
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetDrawColor(30, 30, 30, 160);
|
|
|
|
else Canvas.SetDrawColor(30, 30, 30, 160);
|
|
|
|
|
|
|
|
Owner.CurrentStyle.DrawRectBox (0.f, 0.f, CompPos[2], CompPos[3], 4);
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bDisabled)
|
2017-10-25 22:21:13 +00:00
|
|
|
return;
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bVertical)
|
2017-10-25 22:21:13 +00:00
|
|
|
i = 3;
|
|
|
|
else i = 2;
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2017-10-25 22:21:13 +00:00
|
|
|
SliderScale = FMax(PageStep * (CompPos[i] - 32.f) / (MaxRange + PageStep),CalcButtonScale);
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bGrabbedScroller)
|
2017-10-25 22:21:13 +00:00
|
|
|
{
|
|
|
|
// Track mouse.
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bVertical)
|
2017-10-25 22:21:13 +00:00
|
|
|
A = Owner.MousePosition.Y - CompPos[1] - GrabbedOffset;
|
|
|
|
else A = Owner.MousePosition.X - CompPos[0] - GrabbedOffset;
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2017-10-25 22:21:13 +00:00
|
|
|
A /= ((CompPos[i]-SliderScale) / float(MaxRange));
|
|
|
|
SetValue(A);
|
|
|
|
}
|
|
|
|
|
|
|
|
A = float(CurrentScroll) / float(MaxRange);
|
|
|
|
ButtonOffset = A*(CompPos[i]-SliderScale);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bGrabbedScroller)
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetDrawColor(90,90,90,255);
|
2020-11-28 20:12:58 +00:00
|
|
|
else if (bFocused)
|
2017-10-25 22:21:13 +00:00
|
|
|
Canvas.SetDrawColor(65,65,65,255);
|
|
|
|
else Canvas.SetDrawColor(40,40,40,255);
|
|
|
|
|
2020-11-28 20:12:58 +00:00
|
|
|
if (bVertical)
|
2017-10-25 22:21:13 +00:00
|
|
|
Owner.CurrentStyle.DrawRectBox (0.f, ButtonOffset, CompPos[2], SliderScale, 4);
|
|
|
|
else Owner.CurrentStyle.DrawRectBox (ButtonOffset, 0.f, SliderScale, CompPos[3], 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
defaultproperties
|
|
|
|
{
|
2023-05-14 02:49:12 +00:00
|
|
|
|
2017-10-25 22:21:13 +00:00
|
|
|
}
|