Dema Panels DCollapsibleCategory not showing up as a collaspible menu
19 replies, posted
I resized everything so that that all the panels fit within eachother, but I'm still getting this problem with the DCollapsibleCategory:
[URL=http://img23.imageshack.us/i/2011082000001.jpg/][IMG]http://img23.imageshack.us/img23/6577/2011082000001.th.jpg[/IMG][/URL]
[URL=http://img577.imageshack.us/i/2011082000004a.jpg/][IMG]http://img577.imageshack.us/img577/8736/2011082000004a.th.jpg[/IMG][/URL]
Here's the rest of the derma:
[URL=http://img543.imageshack.us/i/2011082000002.jpg/][IMG]http://img543.imageshack.us/img543/8912/2011082000002.th.jpg[/IMG][/URL]
[URL=http://img840.imageshack.us/i/2011082000003.jpg/][IMG]http://img840.imageshack.us/img840/7103/2011082000003.th.jpg[/IMG][/URL]
Edit: Sorry about that, here's the code:
[lua]include( 'shared.lua' )
// Clientside only stuff goes here
function ShowTeamMenu()
local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
DermaPanel:SetPos( 80,80 ) -- Position on the players screen
DermaPanel:SetSize( 800, 600 ) -- Size of the frame
DermaPanel:SetTitle( "Main Menu" ) -- Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) -- Draggable by mouse?
DermaPanel:ShowCloseButton( true ) -- Show the close button?
DermaPanel:MakePopup() -- Show the frame
local TestingPanel = vgui.Create( "DPanel", DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 750, 50 )
TestingPanel.Paint = function() -- Paint function
surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) -- Draw the rect
surface.DrawText( "Message of the Day: Zyler Rocks!" )
end
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 25, 110 )
PropertySheet:SetSize( 750, 315 )
local Welcome = vgui.Create( "DLabel" )
Welcome:SetText( "A" )
Welcome:SetColor(Color(191,255,0,255))
Welcome:SizeToContents()
local Character = vgui.Create( "DLabel" )
Character:SetText( "B" )
Character:SetColor(Color(191,255,0,255))
Character:SizeToContents()
local Props = vgui.Create( "DPanel" )
Props:SetSize( 740, 305 )
Props.paint = function()
surface.SetDrawColor(Color(191,255,0,255))
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
surface.DrawText( "Pick props to spawn" )
end
local food = {}
food[1] = "models/props_junk/garbage_milkcarton002a.mdl"
food[2] = "models/props_junk/PopCan01a.mdl"
food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl"
food[4] = "models/props_junk/watermelon01.mdl"
food[5] = "models/props_junk/garbage_metalcan001a.mdl"
food[6] = "models/props_lab/box01a.mdl"
food[7] = "models/props_lab/box01b.mdl"
local Proplist1 = vgui.Create("DCollapsibleCategory", Props)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 730, 50 ) -- Keep the second number at 50
Proplist1:SetLabel( "Proplist1" )
Proplist1menu = vgui.Create("DModelSelect", Proplist1 )
Proplist1menu:SetSize( 650, 40 )
Proplist1menu:SetSpacing( 5 )
Proplist1menu:EnableHorizontal( true )
Proplist1menu:EnableVerticalScrollbar( false )
Proplist1menu:SetPadding( 4 )
for k,v in pairs(food) do
local icon = vgui.Create( "SpawnIcon", Proplist1menu )
icon:SetModel( v )
Proplist1menu:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v)
end
end
PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" )
PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" )
PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" )
end
usermessage.Hook( "call_vgui", ShowTeamMenu )
[/lua]
To be more clear my problem is that the DCollapsibleCategory on the third tab does not come up as a Collapsible menu. It just shows up as another plane with the prop list on it.
Post your code. And describe the problem better, if you can.
Sorry guys, updated the OP
Proplist1menu:SetSize( 650, 40 )
The height is a way too small, you are probably just scaling the panels wrong, just saying.
All panel contents will be clipped.
I had it bigger before and it was exactly the same. I just made it smaller to show off my problem.
BUMP! I'm still having this problem, the DModelSelect isn't the issue, I've had it with loads of different sizes with the same problem.
BUMP! Does anyone know how to solve this?
Do I need to provide more info?
Why don't you just redo it..
[QUOTE=zzaacckk;31931974]Why don't you just redo it..[/QUOTE]
Redo it how? The code is code, If I type it again exactly the same it won't change it. Do you mean I change my method and have the menus in a different order? That wouldn't work if I still can't have a prop menu within a collapsible menu.
If it's really not possible I'll change it, but before I do so I want to be sure. I'm going to try putting another plane within the collapsible menu and then the prop menu in that. I'll edit in my results.
EDIT: [URL=http://imageshack.us/photo/my-images/16/2011082500002.jpg/][IMG]http://img16.imageshack.us/img16/4401/2011082500002.jpg[/IMG][/URL]
Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]
Here's what I did (cl_init.lua):
[lua]Character:SizeToContents()
local Props = vgui.Create( "DPanel" )
Props:SetSize( 740, 305 )
Props.paint = function()
surface.SetDrawColor(Color(191,255,0,255))
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
surface.DrawText( "Pick props to spawn" )
end
local food = {}
food[1] = "models/props_junk/garbage_milkcarton002a.mdl"
food[2] = "models/props_junk/PopCan01a.mdl"
food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl"
food[4] = "models/props_junk/watermelon01.mdl"
food[5] = "models/props_junk/garbage_metalcan001a.mdl"
food[6] = "models/props_lab/box01a.mdl"
food[7] = "models/props_lab/box01b.mdl"
local Proplist1 = vgui.Create("DCollapsibleCategory", Props)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 730, 50 ) -- Keep the second number at 50
Proplist1:SetLabel( "Proplist1" )
local Proplistback = vgui.Create( "DPanel", Proplist1 )
Props:SetSize( 720, 300 )
local Proplist1menu = vgui.Create("DModelSelect", Proplistback )
Proplist1menu:SetSize( 650, 200 )
Proplist1menu:SetSpacing( 5 )
Proplist1menu:EnableHorizontal( true )
Proplist1menu:EnableVerticalScrollbar( false )
Proplist1menu:SetPadding( 4 )
for k,v in pairs(food) do
local icon = vgui.Create( "SpawnIcon", Proplist1menu )
icon:SetModel( v )
Proplist1menu:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v)
end
end
PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" )
PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" )
PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" )
end
usermessage.Hook( "call_vgui", ShowTeamMenu )
[/lua]
Err, one sec old thing wouldn't have worked
[editline]25th August 2011[/editline]
You need to set the contents of the Proplist1 to be the Proplist1menu
[QUOTE=zzaacckk;31934213]Err, one sec old thing wouldn't have worked
[editline]25th August 2011[/editline]
You need to set the contents of the Proplist1 to be the Proplist1menu[/QUOTE]
K i changed it back to how it was, I'm still stuck with the same problem though from the OP.
[QUOTE=zzaacckk;31934213]
You need to set the contents of the Proplist1 to be the Proplist1menu[/QUOTE]
[QUOTE=zzaacckk;31951399][/QUOTE]
with this?
[url]http://luasearch.overvprojects.nl/?keywords=Panel.SizeToContents[/url] ?
Cause I tried it, it doesn't change anything
BUMP!
BUMP again!
BUMP!
BUMP! Let me know if you want me to check something or provide more info
[b][url=http://wiki.garrysmod.com/?title=DCollapsibleCategory.SetContents]DCollapsibleCategory.SetContents [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]
That's all you needed to do :).
[lua]// Clientside only stuff goes here
function ShowTeamMenu()
local DermaPanel = vgui.Create( "DFrame" ) -- Creates the frame itself
DermaPanel:SetPos( 80,80 ) -- Position on the players screen
DermaPanel:SetSize( 800, 600 ) -- Size of the frame
DermaPanel:SetTitle( "Main Menu" ) -- Title of the frame
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( false ) -- Draggable by mouse?
DermaPanel:ShowCloseButton( true ) -- Show the close button?
DermaPanel:MakePopup() -- Show the frame
local TestingPanel = vgui.Create( "DPanel", DermaPanel )
TestingPanel:SetPos( 25, 50 )
TestingPanel:SetSize( 750, 50 )
TestingPanel.Paint = function() -- Paint function
surface.SetDrawColor( 50, 50, 50, 255 ) -- Set our rect color below us; we do this so you can see items added to this panel
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() ) -- Draw the rect
surface.DrawText( "Message of the Day: Zyler Rocks!" )
end
local PropertySheet = vgui.Create( "DPropertySheet" )
PropertySheet:SetParent( DermaPanel )
PropertySheet:SetPos( 25, 110 )
PropertySheet:SetSize( 750, 315 )
local Welcome = vgui.Create( "DLabel" )
Welcome:SetText( "A" )
Welcome:SetColor(Color(191,255,0,255))
Welcome:SizeToContents()
local Character = vgui.Create( "DLabel" )
Character:SetText( "B" )
Character:SetColor(Color(191,255,0,255))
Character:SizeToContents()
local Props = vgui.Create( "DPanel" )
Props:SetSize( 740, 305 )
Props.paint = function()
surface.SetDrawColor(Color(191,255,0,255))
surface.DrawRect( 0, 0, TestingPanel:GetWide(), TestingPanel:GetTall() )
surface.DrawText( "Pick props to spawn" )
end
local food = {}
food[1] = "models/props_junk/garbage_milkcarton002a.mdl"
food[2] = "models/props_junk/PopCan01a.mdl"
food[3] = "models/props_junk/garbage_takeoutcarton001a.mdl"
food[4] = "models/props_junk/watermelon01.mdl"
food[5] = "models/props_junk/garbage_metalcan001a.mdl"
food[6] = "models/props_lab/box01a.mdl"
food[7] = "models/props_lab/box01b.mdl"
local Proplist1 = vgui.Create("DCollapsibleCategory", Props)
Proplist1:SetPos(25, 50)
Proplist1:SetSize( 730, 50 ) -- Keep the second number at 50
Proplist1:SetLabel( "Proplist1" )
Proplist1menu = vgui.Create("DModelSelect", Proplist1 )
Proplist1menu:SetSize( 650, 300 )
Proplist1menu:SetSpacing( 5 )
Proplist1menu:EnableHorizontal( true )
Proplist1menu:EnableVerticalScrollbar( false )
Proplist1menu:SetPadding( 4 )
for k,v in pairs(food) do
local icon = vgui.Create( "SpawnIcon", Proplist1menu )
icon:SetModel( v )
Proplist1menu:AddItem( icon )
icon.DoClick = function( icon ) surface.PlaySound( "ui/buttonclickrelease.wav" ) RunConsoleCommand("gm_spawn", v)
end
end
Proplist1:SetContents(Proplist1menu)
PropertySheet:AddSheet( "Welcome", Welcome, "gui/silkicons/user", false, false, "Rules and stuff" )
PropertySheet:AddSheet( "Character/Groups", Character, "gui/silkicons/group", false, false, "Manage your character and groups" )
PropertySheet:AddSheet( "Props/Tools", Props, "gui/silkicons/group", false, false, "Get Props and Tools" )
end
usermessage.Hook( "call_vgui", ShowTeamMenu )
[/lua]
I've been having the same issue as you. If anyone finds a fix for this please let me know too.
[QUOTE=thelastpenguin;37854475]I've been having the same issue as you. If anyone finds a fix for this please let me know too.[/QUOTE]
this thread is over a year old
and im pretty sure there's a fix right there
Sorry, you need to Log In to post a reply to this thread.