I have edited a little bit the "dtree.lua" and "skins/default.lua" but my selected squarebox is not well positioned over the item.
Any idea how to change/Override this ?
Thanks
[url]http://www.youtube.com/watch?v=GdQL872E0pI[/url]
:rock: 'Then I conceal and complete at time, pictures of Fon the Saray's fashion. And you gotta read my sumarize, cause I was nominated to the Adefashion' (8)
** snip **
it's not possible ?
Or no one know ?
Show us a picture or give more detail of the problem, or show us some code..
Sorry, I think the problem is maybe because the "SetShowIcons( false )" the selector "button" in blue is not well positionned.
Is it possible to override this with the " derma.SkinHook( "Paint", "Tree", panel, w, h ) " look like the one in green in my code ?
[code]
local DlblHead = vgui.Create( "DLabel", DPnl1stA )
DlblHead:SetPos( 204, 3 )
DlblHead:SetSize( 450, 50 )
alphactrlDtree = 100
local ctrl = vgui.Create( "DTree", DPnl1stA )
ctrl:SetPos( 5, 8 )
ctrl:SetPadding( 0 )
ctrl:SetIndentSize( -2 )
ctrl:SetShowIcons( false )
ctrl:SetSize( 170, 206 + 40 )
-- ctrl.Paint = function( panel, w, h ) derma.SkinHook( "Paint", "Tree", panel, w, h ) end
function ctrl:Paint( w, h )
derma.SkinHook( "Paint", "TreeNodeButton", self, w, h )
draw.RoundedBox( 6, 0, 0, self:GetWide() , self:GetTall(), Color( 0, 0, 0, 255 ) )
draw.RoundedBox( 6, 2, 2, self:GetWide() - 4 , self:GetTall() - 4, Color( 230, 230, 230, 255 ) )
return false
end
local node2 = ctrl:AddNode( "table.Test1" )
node2.UpdateColours = function( label, skin )
label:SetTextStyleColor( Color( 255, 0, 0 ) )
end
ctrl:SetSelectedItem(node2)
TheTable = {};
TheTable.Test1 = {};
TheTable.Test2 = {};
ThisIsATable1 = { "hello", "there", "Admin" }
ThisIsATable2 = { "Mansion", "Garry", "Collide" }
table.Add( TheTable.Test1 , ThisIsATable1 )
table.Add( TheTable.Test2 , ThisIsATable2 )
local TheListOfTable = TheTable.Test1
-- Categorize them
for k, v in pairs( TheListOfTable ) do
-- node2:SetExpanded( true, true )
local cnode = node2:AddNode(v )
DlblHead.Think = function()
DlblHead:SetText( ctrl:GetSelectedItem():GetText() )
DlblHead.UpdateColours = function( label, skin )
label:SetTextStyleColor( Color( 255, 0, 0 ) )
end
end
end
DlblHead:SetFont( "TheTextHereA" )
DlblHead:SetDark( true )
DlblHead.Paint = function(me)
-- draw.RoundedBox( 4, 0, 0, me:GetWide(), me:GetTall(), Color( 40, 40,40, 20 ) )
end[/code]
[t]http://s21.postimg.org/3khi8hyp3/Dtree_Weird.gif[/t]
snip
Sorry, you need to Log In to post a reply to this thread.