fork/m-overlay
git clone https://git.julia.blue/fork/m-overlay
7d480fc
v2.1.2
1local PANEL =class . create ( "CheckBox" , "Button" ) 2 3PANEL : ACCESSOR ( "Toggled" , "m_bToggled" , false ) 4 5function PANEL : CheckBox () 6-- Initialize our baseclass 7self : super () 8self : TextMargin ( 28 , 0 , 0 , 0 ) 9self : SetTextAlignmentX ( "left" ) 10end 11 12function PANEL : SetToggled ( b , force ) 13if self . m_bToggled ~= b or force then 14self . m_bToggled =b 15self : OnToggle ( b ) 16end 17end 18 19function PANEL : Paint ( w , h ) 20gui . skinHook ( "Paint" , "CheckBox" , self , w , h ) 21self : PaintLabel ( w , h ) 22end 23 24function PANEL : OnClick () 25self : SetToggled ( not self : GetToggled ()) 26end 27 28function PANEL : OnToggle ( on ) 29-- Override 30end