m
Move page script moved page UIOBJECT Slider to WoW:UIOBJECT Slider without leaving a redirect
(New page: == Class Hierarchy, API, And Derivatives == For class hierarchy and method listing. See main listing here, Widget API Slider. == Notes == It is very difficult to fin...) |
m (Move page script moved page UIOBJECT Slider to WoW:UIOBJECT Slider without leaving a redirect) |
||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
{{widget}} | |||
== Class Hierarchy, API, And Derivatives == | == Class Hierarchy, API, And Derivatives == | ||
For class hierarchy and method listing | For class hierarchy and method listing, see main listing here: [[Widget_API#Slider|Widget API Slider]]. | ||
== Construction == | == Construction == | ||
local MySlider = CreateFrame("Slider", "MySliderGlobalName", ParentFrame, "OptionsSliderTemplate") | |||
local MySlider = CreateFrame( | |||
== Width, Height, Orientation, And Position == | == Width, Height, Orientation, And Position == | ||
Width and height are handled the same as any other widget: | |||
MySlider:SetWidth(20) | MySlider:SetWidth(20) | ||
MySlider:SetHeight(100) | MySlider:SetHeight(100) | ||
To set your slider to a vertical orientation: | |||
MySlider:SetOrientation('VERTICAL') | MySlider:SetOrientation('VERTICAL') | ||
Or | Or for a horizontal slider: | ||
MySlider:SetOrientation('HORIZONTAL') | MySlider:SetOrientation('HORIZONTAL') | ||
== Special Global Objects Created By Template During Initialization == | == Special Global Objects Created By Template During Initialization == | ||
Some special objects | Some special objects are created when using the "OptionsSliderTemplate" template during initialization (CreateFrame). You can | ||
access these objects using the LUA '''getglobal''' function | access these objects using the LUA '''getglobal''' function, as outlined below: | ||
MySlider.tooltipText = 'This is the Tooltip hint' --Creates a tooltip on mouseover. | |||
getglobal(MySlider:GetName() .. 'Low'):SetText('1'); --Sets the left-side slider text (default is "Low"). | |||
MySlider.tooltipText = 'This is the Tooltip hint' | getglobal(MySlider:GetName() .. 'High'):SetText('100'); --Sets the right-side slider text (default is "High"). | ||
getglobal(MySlider:GetName() .. 'Low'):SetText('1'); | getglobal(MySlider:GetName() .. 'Text'):SetText('5'); --Sets the "title" text (top-centre of slider). | ||
getglobal(MySlider:GetName() .. 'High'):SetText('100'); | |||
getglobal(MySlider:GetName() .. 'Text'):SetText('5'); | These are useful shortcuts in lieu of having to manually define font strings. | ||
== Conclusion == | == Conclusion == | ||
After all that you can show your slider using: | After all that you can show your slider using: | ||
MySlider:Show() | MySlider:Show() | ||
[[Category:Widgets]] | |||