Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<display version="1.0.0">
<display version="2.0.0">
<name>Spinner Slider Scrollbar</name>
<widget type="scrollbar" version="2.0.0">
<name>Scrollbar</name>
Expand Down Expand Up @@ -45,7 +45,6 @@
<width>110</width>
<height>220</height>
<horizontal>false</horizontal>
<scale_format>#.##</scale_format>
</widget>
<widget type="label" version="2.0.0">
<name>Label_3</name>
Expand All @@ -70,18 +69,16 @@
</widget>
<widget type="label" version="2.0.0">
<name>Label_5</name>
<text>The value can be adjusted both with
the mouse and, when the widget is in
focus, using the arrow keys and
page up/down keys.
<text>The value can be adjusted both with the mouse and, when the widget is in focus, using the arrow keys and page up/down keys.
Up/Down arrow keys and Page Up/Down keys will change the value by 1 step size
Ctrl + Up/Down arrow keys will change the value by 5 x step size
Ctrl + Left/Right arrow keys to make changes at 10 x step szie

The "increment" property of the widget
determines the step size when using
the keyboard.</text>
<x>143</x>
<y>191</y>
<width>238</width>
<height>189</height>
The "increment" property of the widget determines the step size when using the keyboard.</text>
<x>141</x>
<y>160</y>
<width>579</width>
<height>250</height>
</widget>
<widget type="scaledslider" version="2.0.0">
<name>Scaled Slider_1</name>
Expand All @@ -90,7 +87,6 @@ the keyboard.</text>
<y>429</y>
<width>419</width>
<height>61</height>
<scale_format>#.##</scale_format>
<limits_from_pv>false</limits_from_pv>
</widget>
</display>
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,50 @@ else if(focused){
}
break;
//incrementing by keyboard
//isShiftDown(), isControlDown(), isAltDown(), and isMetaDown()
case LEFT:
if(event.isControlDown()) {
spinner.getValueFactory().increment(10);
}
break;
case RIGHT:
if(event.isControlDown()) {
spinner.getValueFactory().decrement(10);
}
break;
case UP:
if (!active) {
if(event.isControlDown()) {
spinner.getValueFactory().increment(5);
}
else {
spinner.getValueFactory().increment(1);
}
}
break;
case PAGE_UP:
if (!active)
spinner.getValueFactory().increment(1);
if (!active) {
spinner.getValueFactory().increment(1);
}
break;
case DOWN:
if (!active) {
if(event.isControlDown()) {
spinner.getValueFactory().decrement(5);
}
else {
spinner.getValueFactory().decrement(1);
}
}
break;
case PAGE_DOWN:
if (!active)
spinner.getValueFactory().decrement(1);
if (!active) {
spinner.getValueFactory().decrement(1);
}
break;
case CONTROL:
setActive(false);
break;
default:
// Any other key results in active state
setActive(true);
Expand Down Expand Up @@ -608,3 +642,4 @@ private void setActive(final boolean active)
updateChanges();
}
}