//=============================================================================//
// ___ ___ _ _ _ __ _ ___ ___ __ __
// |_ _|| __| / \ | \_/ | / _| / \ | o \ o \\ V /
// | | | _| | o || \_/ | ( |_n| o || / / \ /
// |_| |___||_n_||_| |_| \__/|_n_||_|\\_|\\ |_| 2009
//
//=============================================================================//
local PANEL = {}
/*---------------------------------------------------------
Init
---------------------------------------------------------*/
function PANEL:Init()
self:SetMin( 0 )
self:SetMax( 1000 )
self:SetValue( 253 )
end
function PANEL:LabelAsPecentage()
self.m_bLabelAsPercentage = true
self:UpdateText()
end
function PANEL:SetMin( i )
self.m_iMin = i
self:UpdateText()
end
function PANEL:SetMax( i )
self.m_iMax = i
self:UpdateText()
end
function PANEL:SetValue( i )
self.m_iValue = i
self:UpdateText()
end
function PANEL:UpdateText()
if ( !self.m_iMax ) then return end
if ( !self.m_iMin ) then return end
if ( !self.m_iValue ) then return end
local fDelta = 0;
if ( self.m_iMax-self.m_iMin != 0 ) then
fDelta = ( self.m_iValue - self.m_iMin ) / (self.m_iMax-self.m_iMin)
end
if ( self.m_bLabelAsPercentage ) then
return
end
if ( self.m_iMin == 0 ) then
else
// Todo..
end
end
/*---------------------------------------------------------
PerformLayout
---------------------------------------------------------*/
function PANEL:PerformLayout()
//self.Label:CopyBounds( self )
end
function PANEL:Paint()
local fDelta = 0;
if ( self.m_iMax-self.m_iMin != 0 ) then
fDelta = ( self.m_iValue - self.m_iMin ) / (self.m_iMax-self.m_iMin)
end
end