Garry's Mod Wiki

DIconBrowser

DIconBrowser

Description

Simply a DIconLayout which automatically displays all of the Silkicons. Used as a way to get the user to select an icon.

Parent

Derives methods, etc not listed on this page from DScrollPanel.

Methods

DIconBrowser:Fill()
This is used internally - although you're able to use it you probably shouldn't. Automatically called to fill the browser with icons. Will not work if DIconBrowser:SetManual is set to true.
DIconBrowser:FilterByText( string text )
A simple unused search feature, hides all icons that do not contain given text in their file path.
boolean DIconBrowser:GetManual()
Returns whether or not the browser should fill itself with icons.
string DIconBrowser:GetSelectedIcon()
Returns the currently selected icon's file path.
DIconBrowser:OnChange()
Called when the selected icon was changed. Use DIconBrowser:GetSelectedIcon to get the selected icon's filepath.
DIconBrowser:OnChangeInternal()
This is used internally - although you're able to use it you probably shouldn't. Use DIconBrowser:OnChange instead
DIconBrowser:ScrollToSelected()
Scrolls the browser to the selected icon
DIconBrowser:SelectIcon( string icon )
Selects an icon from file path
DIconBrowser:SetManual( boolean manual )
Sets whether or not the browser should automatically fill itself with icons.
DIconBrowser:SetSelectedIcon( string str )
This is used internally - although you're able to use it you probably shouldn't. Set the currently selected file path. Do not use. Use DIconBrowser:SelectIcon instead.

Example

Creates a DIconBrowser which, when an icon is clicked, prints said icon's directory.

local DermaPanel = vgui.Create("DFrame") DermaPanel:SetSize(300, 200) DermaPanel:Center() DermaPanel:SetTitle("DIconBrowserExample") DermaPanel:MakePopup() local IconBrowser = DermaPanel:Add("DIconBrowser") IconBrowser:Dock(FILL) IconBrowser.OnChange = function(self) chat.AddText("You selected: " .. self:GetSelectedIcon()) end

Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 6
Generate Html 9
SaveChanges (1) 6
Render Body 0
Render Sidebar 7