fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
a8034e9
v2.1.1a
1local PANEL =class . create ( "SliderPanel" , "Label" ) 2 3PANEL : ACCESSOR ( "TextFormat" , "m_strTextFormat" , "%d" ) 4 5function PANEL : SliderPanel () 6self : super () -- Initialize our baseclass 7self : SetFocusable ( true ) 8self : SetDrawPanel ( true ) 9self : SetBGColor ( color ( 215 , 215 , 215 )) 10self : SetHeight ( 48 ) 11 12self : TextMargin ( 0 , 4 , 0 , 0 ) 13self : SetTextAlignmentX ( "center" ) 14self : SetTextAlignmentY ( "top" ) 15self : SetTextColor ( color_darkgrey ) 16self : DockPadding ( 2 , 18 , 2 , 2 ) 17 18self . m_pSlider =self : Add ( "Slider" ) 19self . m_pSlider : Dock ( DOCK_TOP ) 20 21self : InheritMethods ( self . m_pSlider ) -- Inherit all slider functions 22 23self . m_pSlider . OnValueChanged =function ( this , value ) 24self : SetText ( string . format ( self . m_strTextFormat , value )) 25self : OnValueChanged ( value ) 26end 27end 28 29function PANEL : Skin () 30self : super ( "Skin" ) 31gui . skinHook ( "Init" , "SubPanel" , self ) 32end 33 34function PANEL : PerformLayout () 35end 36 37function PANEL : OnValueChanged ( value ) 38-- Override 39end