When overriding the Paint function of DPropertySheet how do I control how the tabs are painted?
How do I access the paint function for each tab?
[lua]
for _, x in pairs( dpropertysheet.Items ) do
if !x.Tab then continue end
x.Tab.Paint = function( self, w, h )
draw.RoundedBox( 0, 0, 0, w, h, color_black )
end
end
[/lua]
[lua]for k, v in pairs( dtabsheet.Items ) do
v.Tab.Paint = function( s, w, h)
local a_panel = dtabsheet:GetActiveTab():GetPanel()
if v.Tab:GetPanel() == a_panel then
draw.RoundedBox( 0, 5, h-7, w-14, 1, RSKIN['Colors']['Shade'])
end
end
end[/lua]
This is how i do it. Taken straight from one of my addons. (only paints the selected tab)
Sweet, Cheers!
Sorry, you need to Log In to post a reply to this thread.