Description
Parent
Derives methods, etc not listed on this page from DScrollPanel.
Implements
Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.
Methods
Adds a DCollapsibleCategory to the list.
Adds an element to the list.
Calls Panel:UnselectAll on all child elements, if they have it.
Example
Creates a DCategoryList with a category and a DFrame, as seen above.
local frame
= vgui.
Create(
"DFrame" )
frame:
SetSize(
500,
500 )
frame:
Center()
frame:
MakePopup()
local CatList
= vgui.
Create(
"DCategoryList", frame )
CatList:
Dock( FILL )
local Cat
= CatList:
Add(
"Test category with text contents" )
Cat:
Add(
"Item 1" )
local button
= Cat:
Add(
"Item 2" )
button.DoClick
= function()
print(
"Item 2 was clicked." )
end
local Cat2
= CatList:
Add(
"Test category with panel contents" )
Cat2:
SetTall(
100 )
local Contents
= vgui.
Create(
"DButton" )
Contents:
SetText(
"This is the content of the category" )
Cat2:
SetContents( Contents )
CatList:
InvalidateLayout(
true )