I'd like to share with you a brief doc showing all supported tags for the rewritten Button class, please let me know what do you think and feel free to suggest any idea
FUNCTION scui.Button.Add(Info)
Code: Select all
; INPUT [F]=Funcs, [T]=Table, [S]=String, [N]=Number, [B]=Boolean
; • [T]Info Table used to define the new button
; • [S]Name Button's Name, cannot be NIL and must be unique
; • [T]Position Button's Position
; • [N]x Horizontal position
; • [N]y Vertical position
; • [T]Size Button's Size
; • [N]w Width
; • [N]h Height
; • [T]Look Table used to describe the button's appearance
; • [T]Borders Skin borders
; • [N]Top Top border
; • [N]Bottom Bottom border
; • [N]Left Left border
; • [N]Right Right border
; • [T]NSkin Skin for normal button's state
; • [T]Levels Table with multiple skin levels (or at least one)
; Each level must have the following fields
; • [T]Area Table with corrections to the current skin area
; • [N]x Value to add to the button's position X
; • [N]y Value to add to the button's position Y
; • [N]w Value to add to the button's width
; • [N]h Value to add to the button's height
; • [N]Type Skin type for this level
; • [T]Params Table used to define the level skin
; • ...depends on the skin type...
; • [T]HSkin Skin for hilighted button's state
; • ...see NSkin field...
; • [T]PSkin Skin for pushed button's state
; • ...see NSkin field...
; • [T]DSkin Skin for disabled button's state
; • ...see NSkin field...
; • [T]NText Text for normal button's state
; • ...see TextStruct...
; • [T]HText Text for hilighted button's state
; • ...see TextStruct...
; • [T]PText Text for pushed button's state
; • ...see TextStruct...
; • [T]DText Text for disabled button's state
; • ...see TextStruct...
; • [T]Caption Table with all text lines for all button's states
; • [N]Visible Sets if the button is visible or hidden, set this tag with
; #IFO_VISIBLE or #IFO_HIDDEN
; • [N]Enabled Sets if the button is enabled or disabled, set this tag with
; #IFO_ENABLED or #IFO_DISABLED
; • [S]Shortcut Set a key shortcut for this button
; • [B]UseCache Set to True to enable button caching (using brushes)
; • [T]Sounds Table with samples to be played along button's events
; • [N]OnPushed Sample ID to be played along OnPushed events
; • [N]OnDown Sample ID to be played along OnDown events
; • [N]OnOver Sample ID to be played along OnOver events
; • [T]Actions Table with funcs to be executes along button's events
; • [F]OnPushed Func to be executed along OnPushed events
; • [F]OnDown Func to be executed along OnDown events
; • [F]OnOver Func to be executed along OnOver events
; • [F]OnDrop Func to be executed when an object is dropped on this one
; • [F]OnDropOut Func to be called when this object is dropped out of
; its window
; • [S]WindowName Window name where the button must be created
; • [B]Background Automatic background handling (for alpha buttons)
; • [B]Draggable Sets it this item can be dragged & dropped around
; • [T]Tip String table with the tip message to show when the mouse
; is holded over this object
;———————————————————————————————————————————————————————————————————————————————
; OUTPUT [F]=Funcs, [T]=Table, [S]=String, [N]=Number, [B]=Boolean
; • [N] Id Id of the new button or -1 if an error has occurred
; • [T] Obj A table to obtain direct access to the button structure
;-------------------------------------------------------------------------------
- The only mandatory parameter is the object Name
- Actually Objects can be dragged using a qualifier key along the left mouse click on the object, the default one is LEFT SHIFT but you can set it in the scui.Initialize() function
- This class (along with the coming ones) will use a new skinning library that allow multilevel skins: solid color, gradient, shades, stretch, fit, variuos skinning methods using brushes sectors, and so on, giving an unlimited power to the skin system. Even complex skins, with the new "UseCache" flag will be really fast!
Any comment is highly appreciated