From 97203ca2561662e7e0fc225a68cbc6940235832e Mon Sep 17 00:00:00 2001 From: SticklyMan Date: Tue, 21 Nov 2023 05:19:47 -0700 Subject: [PATCH] Added ability to create a scrollable panel in xlib --- lua/ulx/modules/cl/xlib.lua | 13 +++++++++++++ ulx.build | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lua/ulx/modules/cl/xlib.lua b/lua/ulx/modules/cl/xlib.lua index 453ddf0..e8901ee 100644 --- a/lua/ulx/modules/cl/xlib.lua +++ b/lua/ulx/modules/cl/xlib.lua @@ -300,6 +300,19 @@ function xlib.makepanel( t ) return pnl end +function xlib.makescrollpanel( t ) + local pnl = vgui.Create( "DScrollPanel", t.parent ) + pnl:SetPos( t.x, t.y ) + pnl:SetSize( t.w, t.h ) + if t.dock then pnl:Dock( t.dock ) end -- NODOCK, FILL, LEFT, RIGHT, TOP, BOTTOM + if t.dockmargin then pnl:DockMargin( t.dockmargin[1], t.dockmargin[2], t.dockmargin[3], t.dockmargin[4] ) end + if t.dockpadding then pnl:DockPadding( t.dockpadding[1], t.dockpadding[2], t.dockpadding[3], t.dockpadding[4] ) end + pnl:SetZPos( t.zpos or 0 ) + if t.skin then pnl:SetSkin( t.skin ) end + if t.visible ~= nil then pnl:SetVisible( t.visible ) end + return pnl +end + function xlib.makeXpanel( t ) local pnl = vgui.Create( "xlib_Panel", t.parent ) pnl:MakePopup() diff --git a/ulx.build b/ulx.build index e7f2fcf..17c28f2 100644 --- a/ulx.build +++ b/ulx.build @@ -1 +1 @@ -1700569174 +1700569188