DMenuOption
From GMod Wiki
Derma Control: DMenuOption | |
---|---|
Parent Class: | DMenu |
Subclasses: | None |
Description: | |
This shouldn't be used directly. Use DMenu.AddOption to create menu options. |
Example
local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 50,50 ) DermaPanel:SetSize( 200, 250 ) DermaPanel:SetTitle( "Testing Derma Stuff" ) DermaPanel:SetVisible( true ) DermaPanel:SetDraggable( true ) DermaPanel:ShowCloseButton( true ) DermaPanel:MakePopup() local MenuButton = vgui.Create("DButton") MenuButton:SetParent( DermaPanel ) MenuButton:SetText( "Menu >" ) MenuButton:SetPos(25, 50) MenuButton:SetSize( 150, 175 ) MenuButton.DoClick = function ( btn ) local MenuButtonOptions = DermaMenu() -- Creates the menu MenuButtonOptions:AddOption("hello", function() Msg("Hello") end ) -- Add options to the menu MenuButtonOptions:AddOption("how", function() Msg("How") end ) MenuButtonOptions:AddOption("are", function() Msg("Are") end ) MenuButtonOptions:AddOption("you", function() Msg("You") end ) MenuButtonOptions:AddOption("?", function() Msg("?") end ) MenuButtonOptions:Open() -- Open the menu AFTER adding your options end
Functions
DMenuOption.ApplySchemeSettings
DMenuOption.Init
DMenuOption.OnMouseReleased
DMenuOption.Paint
DMenuOption.PerformLayout