Difference between revisions of "DesktopSlider"
From Xojo Documentation
(Created page with "N/A") |
|||
Line 1: | Line 1: | ||
− | + | {{ClassBox | |
+ | | super=[[DesktopUIControl]] | ||
+ | | platform=all | ||
+ | | scope=global | ||
+ | | newinversion=2021r3 | ||
+ | }} | ||
+ | {{Description | ||
+ | | text=The slider control used by desktop applications. As the user moves the slider, the Value property changes. To create a vertical slider, make the height greater than the width. | ||
+ | }} | ||
+ | |||
+ | <dynamicTable id="Events" super="DesktopUIControl" class="eventTable" title="Events" columns="3"> | ||
+ | {{Event | name=ValueChanged | description=ValueChanged()
The slider’s value has changed. }} | ||
+ | </dynamicTable> | ||
+ | |||
+ | |||
+ | <dynamicTable id="Properties" super="DesktopUIControl" class="propertyTable" title="Properties" columns="3"> | ||
+ | {{Property | name=AllowLiveScrolling |description=( Boolean) If True, a ValueChanged event occurs as the user drags the thumbnail in the slider.}} | ||
+ | {{Property | name=LineStep | type=Integer | platform=all | description=( Integer) On Windows and Linux, LineStep is the amount a slider moves when the slider has the focus and the user uses the arrow keys }} | ||
+ | {{Property | name=MaximumValue | description=( Integer) The maximum value of the slider. The default is 100. }} | ||
+ | {{Property | name=MinimumValue | description=( Integer) The minimum value of the slider. The default is 0. }} | ||
+ | {{Property | name=PageStep | type=Integer | platform=all | description=( Integer) The amount the value changes when the user clicks in the Slider track. }} | ||
+ | {{Property | name=TickMarkStyle | description=( Slider} The style of tick mark to be displayed. }} | ||
+ | {{Property | name=Value | type=Integer | platform=all | description=( Integer) The current value of the slider. }} | ||
+ | </dynamicTable> | ||
+ | |||
+ | |||
+ | <dynamicTable id="Methods" super="DesktopUIControl" class="methodTable" title="Methods" columns="3"> | ||
+ | </dynamicTable> | ||
+ | |||
+ | <dynamicTable id="Enumerations" class="methodTable" title="Enumerations" columns="3"> | ||
+ | {{Enum | name=TickMarkStyles | description=Specifies the type of tick mark for the slider.}} | ||
+ | </dynamicTable> | ||
+ | |||
+ | == Notes == | ||
+ | Sliders default to a height of 23 pixels so they use the normal size on all platforms. | ||
+ | |||
+ | on macOS vertical sliders no longer appear automatically when the height is greater than the width. To enable a vertical slider, put this code in the [[DesktopControl.Opening|Opening]] event handler for the Slider: | ||
+ | |||
+ | <rbcode> | ||
+ | Declare Sub setVertical Lib "Cocoa" Selector "setVertical:" (windowRef As Integer, id As Boolean) | ||
+ | setVertical(Me.Handle, True) | ||
+ | </rbcode> | ||
+ | |||
+ | == Sample Code == | ||
+ | Changing the maximum value of a '''DesktopSlider''' at runtime: | ||
+ | |||
+ | <rbcode> | ||
+ | Slider1.MaximumValue = 200 | ||
+ | </rbcode> | ||
+ | |||
+ | Setting the text of TextField1 to the value of the slider when the user scrolls. | ||
+ | |||
+ | <rbcode> | ||
+ | Sub ValueChanged() | ||
+ | TextField1.Value = Slider1.Value.ToString | ||
+ | End Sub | ||
+ | </rbcode> | ||
+ | |||
+ | ==See Also== | ||
+ | [[DesktopUIControl]] class; [[DesktopScrollbar]] control | ||
+ | |||
+ | [[Category:Desktop]] | ||
+ | [[Category:Desktop Controls]] |
Latest revision as of 20:21, 23 July 2021
Class (inherits from DesktopUIControl)
New in 2021r3
The slider control used by desktop applications. As the user moves the slider, the Value property changes. To create a vertical slider, make the height greater than the width.
Properties | |||||||||||||||||||||||||||||||
|
Methods | ||||||||
|
Enumerations | |
|
Notes
Sliders default to a height of 23 pixels so they use the normal size on all platforms.
on macOS vertical sliders no longer appear automatically when the height is greater than the width. To enable a vertical slider, put this code in the Opening event handler for the Slider:
Declare Sub setVertical Lib "Cocoa" Selector "setVertical:" (windowRef As Integer, id As Boolean)
setVertical(Me.Handle, True)
setVertical(Me.Handle, True)
Sample Code
Changing the maximum value of a DesktopSlider at runtime:
Slider1.MaximumValue = 200
Setting the text of TextField1 to the value of the slider when the user scrolls.
See Also
DesktopUIControl class; DesktopScrollbar control