From: Richard K. <ric...@us...> - 2005-05-17 15:43:27
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11700 Modified Files: ASTheme.as ASThemeProtocol.as Log Message: moved default image registration into ASTheme Index: ASThemeProtocol.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASThemeProtocol.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASThemeProtocol.as 17 May 2005 15:31:40 -0000 1.2 --- ASThemeProtocol.as 17 May 2005 15:43:18 -0000 1.3 *************** *** 60,62 **** --- 60,67 ---- public function drawButtonBorderedWithRectColorsetInView(rect:NSRect, colorSet:String, view:NSView); + /** + * Registers the default image representations for buttons and other controls + */ + public function registerDefaultImages(); + } Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTheme.as 17 May 2005 15:31:40 -0000 1.2 --- ASTheme.as 17 May 2005 15:43:18 -0000 1.3 *************** *** 34,37 **** --- 34,38 ---- import org.actionstep.NSColor; import org.actionstep.ASDraw; + import org.actionstep.NSImage; /** *************** *** 96,101 **** * Constructs a new instance of ASTheme. */ ! private function ASTheme() ! { } --- 97,101 ---- * Constructs a new instance of ASTheme. */ ! private function ASTheme() { } *************** *** 158,162 **** ASDraw.drawVLineEdgeFade(mc, colors.right1, y, y+height, x+width-1, 5); } ! /** * @see org.actionstep.NSObject#description --- 158,169 ---- ASDraw.drawVLineEdgeFade(mc, colors.right1, y, y+height, x+width-1, 5); } ! ! public function registerDefaultImages() { ! setImage("NSRadioButton", org.actionstep.images.ASRadioButtonRep); ! setImage("NSHighlightedRadioButton", org.actionstep.images.ASHighlightedRadioButtonRep); ! setImage("NSSwitch", org.actionstep.images.ASSwitchRep); ! setImage("NSHighlightedSwitch", org.actionstep.images.ASHighlightedSwitchRep); ! } ! /** * @see org.actionstep.NSObject#description *************** *** 176,179 **** --- 183,193 ---- //* Private Methods * //****************************************************** + + private function setImage(name:String, klass:Function) { + var image = (new NSImage()).init(); + image.setName(name); + image.addRepresentation(new klass()); + } + //****************************************************** //* Public Static Properties * |