-------------------------------------------------------------------------------- -- Title: LWImage.lua -- Description: Like a square peg in a round hole -- Author: Raphaël Szwarc http://alt.textdrive.com/lua/ -- Creation Date: February 1, 2005 -- Legal: Copyright (C) 2005 Raphaël Szwarc -------------------------------------------------------------------------------- -- import dependencies local LWComponent = require( "LWComponent" ) local LWLink = require( "LWLink" ) local LWStyle = require( "LWStyle" ) local LUList = require( "LUList" ) -- define the class local super = LWComponent local self = super() -- method to access this image value function self:value() return self:bindings():get( "value" ) end -- method to access this image height function self:height() return self:bindings():get( "height" ) end -- method to access this image width function self:width() return self:bindings():get( "width" ) end -- method for string representation function self:toString() local aValue = self:value() if aValue ~= nil then local aBuffer = LUList() local anHeight = self:height() local aWidth = self:width() local aStyle = LWStyle:styleWithComponent( self ) aBuffer:add( "" ) aValue = aBuffer:join( "" ) end return aValue end return self