Permalink
Browse files

Fixed DTileLayout in derma_controls

+ Cleaned up some panel files
  • Loading branch information...
1 parent 2ea8e0c commit 8fe611c7f60713863547a01ba19f8ab8a3543e21 @robotboy655 robotboy655 committed Apr 27, 2016
@@ -1,13 +1,3 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
-
- DIconBrowser
-
---]]
local local_IconList = nil
@@ -143,9 +133,7 @@ function PANEL:Add( name )
return self.IconLayout:Add( name )
end
-
function PANEL:OnChange()
-
end
--[[---------------------------------------------------------
@@ -1,15 +1,3 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
-
- DPanelList
-
- A window.
-
---]]
local PANEL = {}
@@ -58,7 +46,6 @@ function PANEL:OnCursorMoved( x, y )
end
-
--[[---------------------------------------------------------
Name: Select
-----------------------------------------------------------]]
@@ -79,10 +66,11 @@ function PANEL:DoClick()
end
+function PANEL:GenerateExample( ClassName, PropertySheet, Width, Height )
+end
derma.DefineControl( "DListBoxItem", "", PANEL, "DLabel" )
-
local PANEL = {}
AccessorFunc( PANEL, "m_bSelectMultiple", "Multiple", FORCE_BOOL )
@@ -143,8 +131,6 @@ function PANEL:Rebuild()
local w = panel:GetWide()
local h = panel:GetTall()
-
-
panel:SetPos( self.Padding, y )
panel:SetWide( self:GetCanvas():GetWide() - self.Padding * 2 )
@@ -1,13 +1,4 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
- DPanel
-
---]]
local PANEL = {}
AccessorFunc( PANEL, "m_bBackground", "PaintBackground", FORCE_BOOL )
@@ -19,9 +10,6 @@ AccessorFunc( PANEL, "m_bgColor", "BackgroundColor" )
Derma_Hook( PANEL, "Paint", "Paint", "MenuBar" )
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function PANEL:Init()
self:Dock( TOP )
@@ -117,5 +105,4 @@ function PANEL:GenerateExample( ClassName, PropertySheet, Width, Height )
end
-
derma.DefineControl( "DMenuBar", "", PANEL, "DPanel" )
@@ -1,32 +1,18 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
- DPanel
-
---]]
local PANEL = {}
AccessorFunc( PANEL, "m_bBackground", "PaintBackground", FORCE_BOOL )
AccessorFunc( PANEL, "m_bBackground", "DrawBackground", FORCE_BOOL ) -- deprecated
AccessorFunc( PANEL, "m_bIsMenuComponent", "IsMenu", FORCE_BOOL )
AccessorFunc( PANEL, "m_bDisableTabbing", "TabbingDisabled", FORCE_BOOL )
-
-
AccessorFunc( PANEL, "m_bDisabled", "Disabled" )
AccessorFunc( PANEL, "m_bgColor", "BackgroundColor" )
Derma_Hook( PANEL, "Paint", "Paint", "Panel" )
Derma_Hook( PANEL, "ApplySchemeSettings", "Scheme", "Panel" )
Derma_Hook( PANEL, "PerformLayout", "Layout", "Panel" )
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function PANEL:Init()
self:SetPaintBackground( true )
@@ -37,9 +23,6 @@ function PANEL:Init()
end
---[[---------------------------------------------------------
-
------------------------------------------------------------]]
function PANEL:SetDisabled( bDisabled )
self.m_bDisabled = bDisabled
@@ -60,13 +43,14 @@ end
function PANEL:OnMousePressed( mousecode )
if ( self.m_bSelectionCanvas && !dragndrop.IsDragging() ) then
- self:StartBoxSelection();
- return end
+ self:StartBoxSelection()
+ return
+ end
if ( self:IsDraggable() ) then
self:MouseCapture( true )
- self:DragMousePress( mousecode );
+ self:DragMousePress( mousecode )
end
@@ -91,8 +75,6 @@ end
UpdateColours
-----------------------------------------------------------]]
function PANEL:UpdateColours()
-
end
-
derma.DefineControl( "DPanel", "", PANEL, "Panel" )
@@ -1,12 +1,3 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
-
-
---]]
local PANEL = {}
@@ -29,18 +20,17 @@ function PANEL:Init()
self:SetBorder( 0 )
self:SetBaseSize( 64 )
- self.LastW = 0;
- self.LastH = 0;
+ self.LastW = 0
+ self.LastH = 0
self.Tiles = {}
-
end
function PANEL:Layout()
- self.LastW = 0;
- self.LastH = 0;
+ self.LastW = 0
+ self.LastH = 0
self:InvalidateLayout()
end
@@ -136,10 +126,10 @@ end
function PANEL:LayoutTiles()
- local StartLine = 1;
- local LastX = 1;
- local tilesize = self.m_iBaseSize;
- local MaxWidth = math.ceil( self:GetWide() / tilesize );
+ local StartLine = 1
+ local LastX = 1
+ local tilesize = self.m_iBaseSize
+ local MaxWidth = math.ceil( self:GetWide() / tilesize )
self:ClearTiles()
@@ -167,14 +157,13 @@ function PANEL:LayoutTiles()
LastX = x
-
end
end
function PANEL:PerformLayout()
- local ShouldLayout = false;
+ local ShouldLayout = false
if ( self.LastW != self:GetWide() ) then ShouldLayout = true end
if ( self.LastH != self:GetTall() ) then ShouldLayout = true end
@@ -186,7 +175,7 @@ function PANEL:PerformLayout()
self:LayoutTiles()
end
- local w, h = self:ChildrenSize();
+ local w, h = self:ChildrenSize()
h = math.max( h, self:GetMinHeight() )
self:SetHeight( h )
@@ -209,7 +198,7 @@ function PANEL:OnChildAdded( child )
local dn = self:GetDnD()
if ( dn ) then
- child:Droppable( self:GetDnD() );
+ child:Droppable( self:GetDnD() )
end
if ( self:IsSelectionCanvas() ) then
@@ -256,11 +245,12 @@ function PANEL:GenerateExample( ClassName, PropertySheet, Width, Height )
local pnl = vgui.Create( ClassName )
pnl:MakeDroppable( "ExampleDraggable", false )
- pnl:SetSize( 200, 200 )
+ pnl:SetWide( 200 )
pnl:SetUseLiveDrag( true )
pnl:SetSelectionCanvas( true )
pnl:SetSpaceX( 4 )
pnl:SetSpaceY( 4 )
+ pnl:SetBaseSize( 36 )
for i=1, 32 do
@@ -1,13 +1,7 @@
---[[ _
- ( )
- _| | __ _ __ ___ ___ _ _
- /'_` | /'__`\( '__)/' _ ` _ `\ /'_` )
-( (_| |( ___/| | | ( ) ( ) |( (_| |
-`\__,_)`\____)(_) (_) (_) (_)`\__,_)
+--[[
DVScrollBar
-
Usage:
Place this control in your panel. You will ideally have another panel or
@@ -22,7 +16,6 @@
Example:
-
function PANEL:PerformLayout()
local Wide = self:GetWide()
@@ -47,7 +40,6 @@
end
-
--]]
local PANEL = {}
@@ -110,7 +102,6 @@ function PANEL:SetEnabled( b )
end
-
--[[---------------------------------------------------------
Name: Value
-----------------------------------------------------------]]
@@ -240,10 +231,8 @@ end
Name: Think
-----------------------------------------------------------]]
function PANEL:Think()
-
end
-
--[[---------------------------------------------------------
Name: Paint
-----------------------------------------------------------]]
@@ -351,5 +340,4 @@ function PANEL:PerformLayout()
end
-
derma.DefineControl( "DVScrollBar", "A Scrollbar", PANEL, "Panel" )

0 comments on commit 8fe611c

Please sign in to comment.