DVScrollBar

From GMod Wiki

Jump to: navigation, search
Derma Control: DVScrollBar
Parent Class:Panel
Subclasses:None
Description:
A vertical scrollbar.

Examples

DescriptionCreates a DNotify
Used onNewerClient.png
Code
 
 
local Frame = vgui.Create( "DFrame" )
DermaPanel:SetSize( 110,80 )
DermaPanel:Center()
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:MakePopup()
 
local DVScrollBar = vgui.Create( "DVScrollBar", DermaPanel )
DVScrollBar:SetSize( 16, 227)
DVScrollBar:SetPos(DermaPanel:GetWide() - 16,23)
DVScrollBar:SetUp(1,200)
DVScrollBar:SetEnabled(true)
OutputDVScrollBar.JPG


Notes

From addons/derma/lua/vgui/DVScrollBar.lua:

Usage:
Place this control in your panel. You will ideally have another panel or
control which is bigger than the original panel. This is the Canvas.
scrollbar:SetUp( _barsize_, _canvassize_ ) should be called whenever
the size of your 'canvas' changes.
scrollbar:GetOffset() can be called to get the offset of the canvas.
You should call this in your PerformLayout function and set the Y pos of your canvas to this value.


Methods

NewerClient.png DVScrollBar.AddScroll
NewerClient.png DVScrollBar.BarScale
NewerClient.png DVScrollBar.GetOffset
NewerClient.png DVScrollBar.GetScroll
NewerClient.png DVScrollBar.Grip
NewerClient.png DVScrollBar.Init
NewerClient.png DVScrollBar.OnCursorMoved
NewerClient.png DVScrollBar.OnMousePressed
NewerClient.png DVScrollBar.OnMouseReleased
NewerClient.png DVScrollBar.OnMouseWheeled
NewerClient.png DVScrollBar.Paint
NewerClient.png DVScrollBar.PerformLayout
NewerClient.png DVScrollBar.SetEnabled
NewerClient.png DVScrollBar.SetScroll
NewerClient.png DVScrollBar.SetUp
NewerClient.png DVScrollBar.Think
NewerClient.png DVScrollBar.Value

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox