// SNAPDOWN(position, lineStep);
if(position < 0) position = 0;
- if(position >= range)
+ if(position >= range)
position = range - 1;
if(thumb)
property bool snap { property_category $"Behavior" set { sbStyle.snap = value; } get { return sbStyle.snap; } };
property int range
{
- property_category $"Behavior"
+ property_category $"Behavior"
set
{
total = value + seen - 1;
// Improve this, needs to be done in 2 so updates commented out for seen
property int seen
{
- property_category $"Behavior"
+ property_category $"Behavior"
set
{
if(this)
};
property int total
{
- property_category $"Behavior"
+ property_category $"Behavior"
set
{
if(this)
bool NotifyPushed(Button button, int x, int y, Modifiers mods)
{
action = down;
- Action(action, 0, (Key)mods);
+ Action(action, 0, Key { modifiers = mods });
timer.Start();
return true;
}
bool NotifyPushed(Button button, int x, int y, Modifiers mods)
{
- action = up;
- Action(action, 0, (Key)mods);
+ action = up;
+ Action(action, 0, Key { modifiers = mods });
timer.Start();
return true;
}
}
position = y - thumbClick.y + thumb.position.y;
if(height)
- position = (position - SB_HEIGHT) * (range - 1) / height;
+ position = (int)((int64)(position - SB_HEIGHT) * (range - 1) / height);
if(guiApp.textMode)
{
SNAPUP(position, textCellH);
}
position = x - thumbClick.x + thumb.position.x;
if(height)
- position = (position - upBtn.size.w) * (range - 1) / height;
+ position = (int)((int64)(position - upBtn.size.w) * (range - 1) / height);
if(guiApp.textMode)
{
SNAPUP(position, textCellW);
if(sbStyle.snap)
SNAPDOWN(position, lineStep);
if(position == 0)
- Action(setPosition, position, (Key)mods);
+ Action(setPosition, position, Key { modifiers = mods });
else
- Action(setPosition, position, (Key)mods);
+ Action(setPosition, position, Key { modifiers = mods });
}
}
return true;
bool draggingThumb;
Point pos, thumbClick;
bool inside;
-
+
void OnRedraw(Surface surface)
{
int sbWidth = SB_WIDTH;
thumbSize = seen * size / total;
}
else
- thumbSize = 0;
+ thumbSize = 0;
if(sbStyle.vertical)
{
else
action = pageDown;
- Action(action, 0, (Key)mods);
+ Action(action, 0, Key { modifiers = mods });
timer.Start();
Update(null);
{
case left:
case up: Action(up, 0, key); break;
- case right:
- case down:
- Action(down, 0, key);
+ case right:
+ case down:
+ Action(down, 0, key);
break;
case pageUp: Action(pageUp, 0, key); break;
case pageDown: Action(pageDown, 0, key); break;