You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(124) |
Jun
(201) |
Jul
(168) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|
From: Richard K. <ric...@us...> - 2005-06-24 12:28:14
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv577/constants Added Files: NSWindowOrderingMode.as Log Message: ordering modes --- NEW FILE: NSWindowOrderingMode.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ class org.actionstep.constants.NSWindowOrderingMode { // Modal run responses public static var NSWindowAbove:NSWindowOrderingMode = new NSWindowOrderingMode(1), public static var NSWindowBelow:NSWindowOrderingMode = new NSWindowOrderingMode(-1), public static var NSWindowOut:NSWindowOrderingMode = new NSWindowOrderingMode(0); public var value:Number; private function NSWindowOrderingMode(num:Number) { value = num; } } |
From: Richard K. <ric...@us...> - 2005-06-24 02:21:26
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27489 Modified Files: NSWindow.as Log Message: flattened the m_flags variable into separate variables and began implementing ordering Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NSWindow.as 22 Jun 2005 09:50:11 -0000 1.14 --- NSWindow.as 24 Jun 2005 02:21:17 -0000 1.15 *************** *** 38,53 **** import org.actionstep.NSRect; import org.actionstep.NSView; - //import org.actionstep.NSText; import org.actionstep.NSPoint; import org.actionstep.NSSize; import org.actionstep.NSEvent; ! //import org.actionstep.NSTextView; class org.actionstep.NSWindow extends NSResponder { - public static var NSWindowAbove = 1; - public static var NSWindowBelow = -1; - public static var NSWindowOut = 0; - // Styles --- 38,49 ---- import org.actionstep.NSRect; import org.actionstep.NSView; import org.actionstep.NSPoint; import org.actionstep.NSSize; import org.actionstep.NSEvent; ! ! import org.actionstep.constants.NSWindowOrderingMode; class org.actionstep.NSWindow extends NSResponder { // Styles *************** *** 59,79 **** // Windows Levels ! public static var ! NSDesktopWindowLevel = -1000, /* GNUstep addition */ ! NSNormalWindowLevel = 0, /**The default level for NSWindow objects.*/ ! NSFloatingWindowLevel = 3, /**Useful for floating palettes.*/ ! NSSubmenuWindowLevel = 3, /**Reserved for submenus. Synonymous with NSTornOffMenuWindowLevel, which is preferred.*/ ! NSTornOffMenuWindowLevel = 3, /**The level for a torn-off menu. Synonymous with NSSubmenuWindowLevel.*/ ! NSMainMenuWindowLevel = 20, /**Reserved for the applications main menu.*/ ! NSDockWindowLevel = 21, /* Deprecated - use NSStatusWindowLevel */ ! //no comments for below (duh) ! NSStatusWindowLevel = 21, ! NSModalPanelWindowLevel = 100, ! NSPopUpMenuWindowLevel = 101, ! NSScreenSaverWindowLevel = 1000 ! // Private global variables private static var g_instances:Array = new Array(); public static function instances():Array { --- 55,74 ---- // Windows Levels ! ! public static var NSDesktopWindowLevel = -1000; /* GNUstep addition */ ! public static var NSNormalWindowLevel = 0; /**The default level for NSWindow objects.*/ ! public static var NSFloatingWindowLevel = 3; /**Useful for floating palettes.*/ ! public static var NSSubmenuWindowLevel = 3; /**Reserved for submenus. Synonymous with NSTornOffMenuWindowLevel, which is preferred.*/ ! public static var NSTornOffMenuWindowLevel = 3; /**The level for a torn-off menu. Synonymous with NSSubmenuWindowLevel.*/ ! public static var NSMainMenuWindowLevel = 20; /**Reserved for the applications main menu.*/ ! public static var NSStatusWindowLevel = 21; ! public static var NSModalPanelWindowLevel = 100; ! public static var NSPopUpMenuWindowLevel = 101; ! public static var NSScreenSaverWindowLevel = 1000; ! // Private global variables private static var g_instances:Array = new Array(); + private static var g_zOrder:Array = new Array(); public static function instances():Array { *************** *** 105,126 **** private var m_title:String; ! private var ! m_keyWin:Number, ! m_mainWin:Number; ! private var m_flags:Object public function NSWindow() { ! m_app = NSApplication.sharedApplication() ! m_windowNumber = g_instances.length; m_viewsNeedDisplay = true; m_fieldEditor= ASFieldEditor.instance(); ! m_flags = { ! isKey: false, ! isMain: false, ! isVisible: true, ! canHide: true ! }; ! g_instances.push(this); var x = m_windowNumber; if(m_keyWin==null) { --- 100,124 ---- private var m_title:String; ! private var m_keyWin:Number; ! private var m_mainWin:Number; ! private var m_isKey:Boolean; ! private var m_isMain:Boolean; ! private var m_isVisible:Boolean; ! private var m_canHide:Boolean ! ! private var m_level:Number; public function NSWindow() { ! m_app = NSApplication.sharedApplication(); ! g_instances.push(this); m_viewsNeedDisplay = true; m_fieldEditor= ASFieldEditor.instance(); ! m_isKey = false; ! m_isMain = false; ! m_isVisible = true; ! m_canHide = true; ! m_level = NSNormalWindowLevel; ! m_windowNumber = g_instances.length; var x = m_windowNumber; if(m_keyWin==null) { *************** *** 224,230 **** // Ordering Windows public function isVisible():Boolean { ! return m_flags.isVisible; } --- 222,303 ---- // Ordering Windows + + public function orderBack(sender:Object) { + removeFromZOrder(); + var start:Number = removeFromZOrder(); + for(var i = start;i >= 0;i--) { + if (g_instances[g_zOrder[i]].level() != m_level) { + g_zOrder.splice(i,0,m_windowNumber); + return; + } + } + g_zOrder.unshift(m_windowNumber); + } + + public function orderFront(sender:Object) { + var start:Number = removeFromZOrder(); + for(var i = start;i < g_zOrder.length;i++) { + if (g_instances[g_zOrder[i]].level() != m_level) { + g_zOrder.splice(i,0,m_windowNumber); + return; + } + } + g_zOrder.push(m_windowNumber); + } + + private function removeFromZOrder():Number { + for(var i = 0;i<g_zOrder.length;i++) { + if (g_zOrder[i] == m_windowNumber) { + g_zOrder.splice(i,1); + return i; + } + } + for(var i = 0;i<g_zOrder.length;i++) { + if (g_instances[g_zOrder[i]].level() == m_level || g_instances[g_zOrder[i]].level() > m_level) { + return i; + } + } + } + + public function orderFrontRegardless(sender:Object) { + orderFront(); + } + + public function orderOut(sender:Object) { + //! How to handle this? + } + + public function orderWindowRelativeTo(positioned:NSWindowOrderingMode, windowNumber:Number) { + removeFromZOrder(); + for(var i = 0;i<g_zOrder.length;i++) { + if (g_zOrder[i] == windowNumber) { + switch(positioned) { + case NSWindowOrderingMode.NSWindowAbove: + g_zOrder.splice(i,0,m_windowNumber); + break; + case NSWindowOrderingMode.NSWindowBelow: + g_zOrder.splice(i-1,0,m_windowNumber); + break; + case NSWindowOrderingMode.NSWindowOut: + //! How to handle this? + break; + } + return; + } + } + } + + public function setLevel(newLevel:Number) { + removeFromZOrder(); + m_level = newLevel; + orderFront(); + } + + public function level():Number { + return m_level; + } public function isVisible():Boolean { ! return m_isVisible; } *************** *** 236,241 **** public function becomeKeyWindow() { ! if (!m_flags.isKey) { ! m_flags.isKey = true; if (m_firstResponder == null || m_firstResponder == this) { if (m_initialFirstResponder != null) { --- 309,314 ---- public function becomeKeyWindow() { ! if (!m_isKey) { ! m_isKey = true; if (m_firstResponder == null || m_firstResponder == this) { if (m_initialFirstResponder != null) { *************** *** 256,260 **** public function isKeyWindow():Boolean { ! return m_flags.isKey; } --- 329,333 ---- public function isKeyWindow():Boolean { ! return m_isKey; } *************** *** 265,269 **** public function makeKeyWindow() { ! if (!m_flags.isKey && m_flags.isVisible && canBecomeKeyWindow()) { m_app.keyWindow().resignKeyWindow(); becomeKeyWindow(); --- 338,342 ---- public function makeKeyWindow() { ! if (!m_isKey && m_isVisible && canBecomeKeyWindow()) { m_app.keyWindow().resignKeyWindow(); becomeKeyWindow(); *************** *** 272,280 **** public function resignKeyWindow() { ! if (m_flags.isKey) { if (m_firstResponder != this) { Object(m_firstResponder).resignKeyWindow(); } ! m_flags.isKey = false; m_notificationCenter.postNotificationWithNameObject(NSWindowDidResignKeyNotification, this); } --- 345,353 ---- public function resignKeyWindow() { ! if (m_isKey) { if (m_firstResponder != this) { Object(m_firstResponder).resignKeyWindow(); } ! m_isKey = false; m_notificationCenter.postNotificationWithNameObject(NSWindowDidResignKeyNotification, this); } *************** *** 282,286 **** public function makeMainWindow() { ! if (m_flags.isVisible && !m_flags.isMain && canBecomeMainWindow()) { m_app.mainWindow().resignMainWindow(); becomeMainWindow(); --- 355,359 ---- public function makeMainWindow() { ! if (m_isVisible && !m_isMain && canBecomeMainWindow()) { m_app.mainWindow().resignMainWindow(); becomeMainWindow(); *************** *** 289,294 **** public function becomeMainWindow() { ! if (!m_flags.isMain) { ! m_flags.isMain = true; m_notificationCenter.postNotificationWithNameObject(NSWindowDidBecomeKeyNotification, this); } --- 362,367 ---- public function becomeMainWindow() { ! if (!m_isMain) { ! m_isMain = true; m_notificationCenter.postNotificationWithNameObject(NSWindowDidBecomeKeyNotification, this); } *************** *** 296,305 **** public function canBecomeMainWindow():Boolean { ! return m_flags.isVisible; } public function resignMainWindow() { ! if (m_flags.isMain) { ! m_flags.isMain = false; m_notificationCenter.postNotificationWithNameObject(NSWindowDidResignMainNotification, this); } --- 369,378 ---- public function canBecomeMainWindow():Boolean { ! return m_isVisible; } public function resignMainWindow() { ! if (m_isMain) { ! m_isMain = false; m_notificationCenter.postNotificationWithNameObject(NSWindowDidResignMainNotification, this); } *************** *** 307,319 **** public function isMainWindow():Boolean { ! return m_flags.isMain; } public function canHide():Boolean { ! return m_flags.canHide; } public function setCanHide(value:Boolean) { ! m_flags.canHide = value; } --- 380,392 ---- public function isMainWindow():Boolean { ! return m_isMain; } public function canHide():Boolean { ! return m_canHide; } public function setCanHide(value:Boolean) { ! m_canHide = value; } *************** *** 438,447 **** } - public function setLevel(i:Number) { - } - - public function orderFrontRegardless() { - } - public function close() { TRACE("$close window..."); --- 511,514 ---- |
From: Richard K. <ric...@us...> - 2005-06-24 02:19:51
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26676 Modified Files: NSView.as Log Message: changed addSubviewPositionedRelativeTo to use NSWindowOrderingMode Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NSView.as 17 Jun 2005 22:16:48 -0000 1.22 --- NSView.as 24 Jun 2005 02:19:41 -0000 1.23 *************** *** 45,48 **** --- 45,49 ---- import org.actionstep.NSClipView; import org.actionstep.NSScrollView; + import org.actionstep.constants.NSWindowOrderingMode; class org.actionstep.NSView extends NSResponder { *************** *** 266,270 **** } ! public function addSubviewPositionedRelativeTo(view:NSView, positioned:Number, otherView:NSView) { var i; for(i=0;i<m_subviews.length;i++) { --- 267,271 ---- } ! public function addSubviewPositionedRelativeTo(view:NSView, positioned:NSWindowOrderingMode, otherView:NSView) { var i; for(i=0;i<m_subviews.length;i++) { *************** *** 275,285 **** if(i == m_subviews.length || otherView == null) { switch(positioned) { ! case NSWindow.NSWindowAbove: i = m_subviews.length; break; ! case NSWindow.NSWindowBelow: i = 0; break; ! case NSWindow.NSWindowOut: //! How to handle this? break; --- 276,286 ---- if(i == m_subviews.length || otherView == null) { switch(positioned) { ! case NSWindowOrderingMode.NSWindowAbove: i = m_subviews.length; break; ! case NSWindowOrderingMode.NSWindowBelow: i = 0; break; ! case NSWindowOrderingMode.NSWindowOut: //! How to handle this? break; *************** *** 287,296 **** } else { switch(positioned) { ! case NSWindow.NSWindowAbove: i = i+1; break; ! case NSWindow.NSWindowBelow: break; ! case NSWindow.NSWindowOut: //! How to handle this? break; --- 288,297 ---- } else { switch(positioned) { ! case NSWindowOrderingMode.NSWindowAbove: i = i+1; break; ! case NSWindowOrderingMode.NSWindowBelow: break; ! case NSWindowOrderingMode.NSWindowOut: //! How to handle this? break; |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:18:08
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25858 Modified Files: NSPanel.as Log Message: Removed func definitions Index: NSPanel.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSPanel.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NSPanel.as 20 Jun 2005 02:06:48 -0000 1.1 --- NSPanel.as 24 Jun 2005 02:17:51 -0000 1.2 *************** *** 58,91 **** /* // - // Create an Attention Panel without Running It Yet - // - public static function NSGetAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):NSPanel - - //below 2 are strict - public static function NSGetCriticalAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):NSPanel - - public static function NSGetInformationalAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):NSPanel - - // - // Create and Run an Attention Panel - // - public static function NSRunAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):Number - - //strict - public static function NSRunCriticalAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):Number - - public static function NSRunInformationalAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):Number - - //strict os x - public static function NSRunLocalizedAlertPanel - (title:String, msg:String, defaultButton:String, alternateButton:String, otherButton:String):Number - - // // New alert interface of Mac OS X // --- 58,61 ---- *************** *** 111,117 **** --- 81,93 ---- */ + public function NSPanel() { + init(); + } public function init():NSPanel { var style:Number = NSTitledWindowMask | NSClosableWindowMask; + //setReleasedWhenClosed(false); + //setHidesOnDeactivate(true); + //setExcludedFromWindowsMenu(true); //return initWithContentRectStyleMaskBackingDefer *************** *** 119,130 **** } - /* - public function _initDefaults():Void { - super._initDefaults(); - setReleasedWhenClosed(false); - setHidesOnDeactivate(true); - setExcludedFromWindowsMenu(true); - }*/ - public function canBecomeKeyWindow():Boolean { return true; --- 95,98 ---- |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:16:30
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25125 Modified Files: NSControl.as Log Message: Uses m_app instead of using sharedApp calls Index: NSControl.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSControl.as,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NSControl.as 13 Jun 2005 02:40:10 -0000 1.19 --- NSControl.as 24 Jun 2005 02:16:21 -0000 1.20 *************** *** 53,56 **** --- 53,57 ---- private var m_trackingData; + private var m_app:NSApplication; /** *************** *** 95,98 **** --- 96,101 ---- public function initWithFrame(theFrame:NSRect) { super.initWithFrame(theFrame); + //doesn't work if in declaration + m_app = NSApplication.sharedApplication(); m_cell = new (this.getClass().cellClass())(); m_cell.init(); *************** *** 368,372 **** return false; } ! return NSApplication.sharedApplication().sendActionToFrom(theAction, theTarget, this); } --- 371,375 ---- return false; } ! return m_app.sendActionToFrom(theAction, theTarget, this); } *************** *** 468,472 **** m_cell.setTrackingCallbackSelector(null, null); } else { ! NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } } --- 471,475 ---- m_cell.setTrackingCallbackSelector(null, null); } else { ! m_app.callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } } *************** *** 478,481 **** --- 481,485 ---- //m_cell.sendActionOn(m_trackingData.actionMask); m_cell.setTrackingCallbackSelector(null, null); + m_cell.mouseTrackingCallback(event); return; } *************** *** 486,490 **** return; } ! NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } --- 490,494 ---- return; } ! m_app.callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:14:10
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23956 Modified Files: NSCell.as Log Message: Send action only if needed Index: NSCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSCell.as,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NSCell.as 24 Jun 2005 02:12:44 -0000 1.18 --- NSCell.as 24 Jun 2005 02:14:00 -0000 1.19 *************** *** 713,717 **** setNextState(); ! m_trackingData.view.sendActionTo(m_trackingData.action, m_trackingData.target); if (m_actionMask & NSEvent.NSPeriodicMask) { //stop sending periodic when mouse up **very impt** --- 713,719 ---- setNextState(); ! if(m_actionMask & NSEvent.NSLeftMouseUpMask) { ! m_trackingData.view.sendActionTo(m_trackingData.action, m_trackingData.target); ! } if (m_actionMask & NSEvent.NSPeriodicMask) { //stop sending periodic when mouse up **very impt** |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:12:53
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23409 Modified Files: NSCell.as Log Message: tracking stopped if modal loop is running Index: NSCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSCell.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NSCell.as 18 Jun 2005 14:04:20 -0000 1.17 --- NSCell.as 24 Jun 2005 02:12:44 -0000 1.18 *************** *** 656,659 **** --- 656,661 ---- var location:NSPoint = event.mouseLocation; var point:NSPoint = location.clone(); + var periodic:Boolean = false; + view.mcBounds().globalToLocal(point); if(!startTrackingAtInView(point, view)) { *************** *** 661,667 **** return; } ! if((m_actionMask & NSEvent.NSLeftMouseDownMask) && event.type == NSEvent.NSLeftMouseDown) { NSControl(controlView()).sendActionTo(action(), target()); } m_trackingData = { location: location, --- 663,670 ---- return; } ! if((m_actionMask & NSEvent.NSLeftMouseDownMask) && event.type == NSEvent.NSLeftMouseDown) { NSControl(controlView()).sendActionTo(action(), target()); } + m_trackingData = { location: location, *************** *** 673,690 **** eventMask: trackingEventMask() }; if(m_actionMask & NSEvent.NSPeriodicMask) { var times = getPeriodicDelayInterval(); NSEvent.startPeriodicEventsAfterDelayWithPeriod(times.delay, times.interval); m_trackingData.eventMask |= NSEvent.NSPeriodicMask; } m_app.callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } ! public function mouseTrackingCallback(event:NSEvent) { var point:NSPoint = event.mouseLocation.clone(); //optional cast -- apparently, mtasc's && returns last value var periodic:Boolean = Boolean((event.type == NSEvent.NSPeriodic) && (m_actionMask & NSEvent.NSPeriodicMask)) m_trackingData.view.mcBounds().globalToLocal(point); - if(event.view != m_trackingData.view) { //moved out of view stopTrackingAtInViewMouseIsUp(m_trackingData.lastPoint, point, controlView(), false); --- 676,701 ---- eventMask: trackingEventMask() }; + if(m_actionMask & NSEvent.NSPeriodicMask) { var times = getPeriodicDelayInterval(); NSEvent.startPeriodicEventsAfterDelayWithPeriod(times.delay, times.interval); m_trackingData.eventMask |= NSEvent.NSPeriodicMask; + periodic = true; } + + //don't track if modal loop has started + if(m_app.runningModal() && m_controlView.window()!=m_app.modalWindow()) { + m_trackingCallback[m_trackingCallbackSelector].call(m_trackingCallback, true, periodic); + return; + } + m_app.callObjectSelectorWithNextEventMatchingMaskDequeue(this, "mouseTrackingCallback", m_trackingData.eventMask, true); } ! public function mouseTrackingCallback(event:NSEvent) { var point:NSPoint = event.mouseLocation.clone(); //optional cast -- apparently, mtasc's && returns last value var periodic:Boolean = Boolean((event.type == NSEvent.NSPeriodic) && (m_actionMask & NSEvent.NSPeriodicMask)) m_trackingData.view.mcBounds().globalToLocal(point); if(event.view != m_trackingData.view) { //moved out of view stopTrackingAtInViewMouseIsUp(m_trackingData.lastPoint, point, controlView(), false); |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:08:22
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21482 Modified Files: NSApplication.as Log Message: endModalSession calls callback to send last result Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NSApplication.as 23 Jun 2005 00:08:56 -0000 1.16 --- NSApplication.as 24 Jun 2005 02:08:08 -0000 1.17 *************** *** 61,67 **** public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! public static var NSRunStoppedResponse:Number = 0; ! public static var NSRunAbortedResponse:Number = 1; ! public static var NSRunContinuesResponse:Number = 2; private static var m_sharedApplication:NSApplication; --- 61,67 ---- public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! public static var NSRunStoppedResponse:Number = -1000; ! public static var NSRunAbortedResponse:Number = -1001; ! public static var NSRunContinuesResponse:Number = -1002; private static var m_sharedApplication:NSApplication; *************** *** 143,148 **** private var m_eventFilter = null; ! ! public function callObjectSelectorWithNextEventMatchingMaskDequeue(callback:Object, selector:String, mask:Number, dequeue:Boolean) { m_eventFilter = {object: callback, selector: selector, mask: mask, dequeue: dequeue}; } --- 143,148 ---- private var m_eventFilter = null; ! ! public function callObjectSelectorWithNextEventMatchingMaskDequeue(callback:Object, selector:String, mask:Number, dequeue:Boolean):Void { m_eventFilter = {object: callback, selector: selector, mask: mask, dequeue: dequeue}; } *************** *** 295,299 **** } } - return m_modalSession; } --- 295,298 ---- *************** *** 329,332 **** --- 328,334 ---- sess.window.setLevel(sess.entryLevel); } + //send callback with result, set lastrun to true + var o = sess.callback + o[sess.selector].call(o, sess.runState, true); //end posing m_sharedApplication.sendEvent = m_sharedApplication.originalSendEvent; *************** *** 365,370 **** || eventWindow.worksWhenModal() == true || event.type == NSEvent.NSAppKitDefined)) { ! event = null ! TRACE(asDebug("kill")); } } --- 367,371 ---- || eventWindow.worksWhenModal() == true || event.type == NSEvent.NSAppKitDefined)) { ! event = null; } } *************** *** 383,388 **** } ! private function modalWin(ret:Number) { ! if(ret!=NSRunContinuesResponse) { endModalSession(m_modalSession); } --- 384,389 ---- } ! private function modalWin(ret:Number, lastrun:Boolean) { ! if(!lastrun && ret!=NSRunContinuesResponse) { endModalSession(m_modalSession); } *************** *** 397,401 **** public function stopModalWithCode(ret:Number):Void { - TRACE("sess: "+m_modalSession); if(m_modalSession == null) { var e:NSException = NSException.exceptionWithNameReasonUserInfo --- 398,401 ---- *************** *** 408,414 **** --- 408,420 ---- } + //note: can return null public function modalWindow():NSWindow { return m_modalSession.window; } + + //this function is not found in Cocoa + public function runningModal():Boolean { + return (m_modalSession==null) ? false : true; + } // Setting the delegate |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:07:01
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21072 Modified Files: ASUtils.as Log Message: Changed findCaller to findMatch Index: ASUtils.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASUtils.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ASUtils.as 10 Jun 2005 01:35:53 -0000 1.9 --- ASUtils.as 24 Jun 2005 02:06:52 -0000 1.10 *************** *** 79,93 **** /** ! * Find the caller of a function. ! * eg. ASUtils.findCaller([NSCell, NSControl], arguments.caller); ! * second param remains the same for *any* call */ ! public static function findCaller (suspects:Array, caller:Function) { var i, x, j, f ! for(i in suspects) { ! x = suspects[i].prototype; _global.ASSetPropFlags(x, null, 6, 1); for(j in x) { if(x[j]==caller) { ! TRACE("id: "+i+"--caller: "+j); f=true; break; --- 79,95 ---- /** ! * Multi-purpose function. ! * eg. ASUtils.findMatch([NSCell, NSControl], arguments.caller, "prototype"); ! * eg. ASUtils.findMatch([NSApplication, result); ! */ ! public static function findMatch (suspects:Array, caller:Object, ext:String) { var i, x, j, f ! for(i in suspects) { ! x = suspects[i]; ! if(ext!=null) x=x[ext]; _global.ASSetPropFlags(x, null, 6, 1); for(j in x) { if(x[j]==caller) { ! TRACE("id: "+i+"--match: "+j); f=true; break; |
From: Tay R. C. <rc...@us...> - 2005-06-24 02:06:14
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20700 Modified Files: ASTestModal.as Log Message: Changed some var names and code Index: ASTestModal.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestModal.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestModal.as 20 Jun 2005 02:05:16 -0000 1.1 --- ASTestModal.as 24 Jun 2005 02:06:03 -0000 1.2 *************** *** 33,46 **** import org.actionstep.constants.* ! class org.actionstep.test.ASTestModal { public static var ! self = ASTestModal, app:NSApplication = NSApplication.sharedApplication(), window1:NSWindow, window2:NSWindow, view1, view2, ! triggerButton:NSButton, triggerButton1:NSButton, textField:NSTextField, textField2:NSTextField public static function test() { window1= (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); window2 = (new NSWindow()).initWithContentRect(new NSRect(125,100,250,250)); --- 33,47 ---- import org.actionstep.constants.* ! class org.actionstep.test.ASTestPanel { public static var ! self = ASTestPanel, app:NSApplication = NSApplication.sharedApplication(), window1:NSWindow, window2:NSWindow, view1, view2, ! begin:NSButton, end:NSButton, textField:NSTextField, textField2:NSTextField public static function test() { + TRACE("app: "+app); window1= (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); window2 = (new NSWindow()).initWithContentRect(new NSRect(125,100,250,250)); *************** *** 51,82 **** view2.setBorderColor(new NSColor(0xFF0000)); ! triggerButton = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! triggerButton.setTitle("Error..."); ! triggerButton.sendActionOn(NSEvent.NSLeftMouseDownMask); ! //triggerButton.setContinuous(true); ! triggerButton.setPeriodicDelayInterval(.3, .5); ! triggerButton.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); ! triggerButton1 = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! triggerButton1.setTitle("OK"); ! triggerButton1.sendActionOn(NSEvent.NSLeftMouseDownMask); ! //triggerButton1.setContinuous(true); ! triggerButton1.setPeriodicDelayInterval(.3, .5); ! triggerButton1.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); ! view1.addSubview(triggerButton); view1.addSubview(textField); ! view2.addSubview(triggerButton1); view2.addSubview(textField2); ! triggerButton.setTarget(self); ! triggerButton.setAction("trigger"); ! triggerButton1.setTarget(self); ! triggerButton1.setAction("stop"); window1.setContentView(view1); --- 52,79 ---- view2.setBorderColor(new NSColor(0xFF0000)); ! begin = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! begin.setTitle("Error..."); ! begin.sendActionOn(NSEvent.NSLeftMouseUpMask); ! begin.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); ! end = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! end.setTitle("OK"); ! end.sendActionOn(NSEvent.NSLeftMouseUpMask); ! end.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); ! view1.addSubview(begin); view1.addSubview(textField); ! view2.addSubview(end); view2.addSubview(textField2); ! begin.setTarget(self); ! begin.setAction("trigger"); ! end.setTarget(self); ! end.setAction("stop"); window1.setContentView(view1); *************** *** 87,90 **** --- 84,88 ---- } + //tracking starts before modal can start posing! public static function trigger(button) { TRACE("Starting modal loop..."); *************** *** 95,111 **** } ! public static function modal (ret) { ! TRACE("MODAL: "+ret.value); } //this func will be called twice ! public static function stop () { TRACE("Ending modal loop..."); ! view2.setHidden(true); ! try { ! app.stopModal(); ! } catch (e:Error) { ! TRACE(e.message); } } } \ No newline at end of file --- 93,118 ---- } ! public static function modal (ret:Number) { ! if(ret!=NSApplication.NSRunContinuesResponse) { ! ASUtils.findMatch([NSApplication], ret); ! } } //this func will be called twice ! public static function stop (btn) { TRACE("Ending modal loop..."); ! var mask; ! end.sendActionOn(mask = end.sendActionOn(0)); ! if(mask & NSEvent.NSLeftMouseUpMask) { ! view2.setNeedsDisplay(true); ! view2.displayIfNeeded(); } + view2.setHidden(true); + + app.stopModal(); + } + + public static function toString():String { + return "Test::ASTestPanel" } } \ No newline at end of file |
From: Richard K. <ric...@us...> - 2005-06-23 02:42:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30962/test Modified Files: ASTestTextRenderer.as Log Message: refactored Index: ASTestTextRenderer.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestTextRenderer.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestTextRenderer.as 22 Jun 2005 05:12:31 -0000 1.1 --- ASTestTextRenderer.as 23 Jun 2005 02:41:54 -0000 1.2 *************** *** 72,78 **** var window:NSWindow = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); var view:NSView = (new NSView()).initWithFrame(new NSRect(0,0,500,500)); ! var textRenderer:ASTextRenderer = (new ASTextRenderer()).initWithFrame(new NSRect(10, 10, 200, 200)); ! textRenderer.setHasHorizontalScroller(false); ! textRenderer.setHasVerticalScroller(false); textRenderer.setStyleSheet(styleSheet); textRenderer.setText(htmlText); --- 72,76 ---- var window:NSWindow = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); var view:NSView = (new NSView()).initWithFrame(new NSRect(0,0,500,500)); ! var textRenderer:ASTextRenderer = (new ASTextRenderer()).initWithFrame(new NSRect(10, 10, 300, 300)); textRenderer.setStyleSheet(styleSheet); textRenderer.setText(htmlText); |
From: Richard K. <ric...@us...> - 2005-06-23 01:21:21
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20275 Modified Files: ASEventMonitor.as Log Message: move access to sharedApplication into the initializer Index: ASEventMonitor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASEventMonitor.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ASEventMonitor.as 21 Jun 2005 03:21:31 -0000 1.10 --- ASEventMonitor.as 23 Jun 2005 01:21:10 -0000 1.11 *************** *** 46,50 **** public static function instance():ASEventMonitor { if (g_instance == null) { ! g_instance = new ASEventMonitor(NSApplication.sharedApplication()); } return g_instance; --- 46,50 ---- public static function instance():ASEventMonitor { if (g_instance == null) { ! g_instance = new ASEventMonitor(); } return g_instance; *************** *** 55,60 **** } ! private function ASEventMonitor(app:NSApplication) { ! m_app = app; m_mouseTrackingClip = null; m_currentMouseTargetPath = ""; --- 55,60 ---- } ! private function ASEventMonitor() { ! m_app = NSApplication.sharedApplication(); m_mouseTrackingClip = null; m_currentMouseTargetPath = ""; |
From: Richard K. <ric...@us...> - 2005-06-23 00:09:05
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13969 Modified Files: NSApplication.as Log Message: changed $ var/function names, added stub function for original modal event function, misc. renaming, var defs on single line Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NSApplication.as 22 Jun 2005 09:48:36 -0000 1.15 --- NSApplication.as 23 Jun 2005 00:08:56 -0000 1.16 *************** *** 61,70 **** public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! public static var ! NSRunStoppedResponse:Number = 0, ! NSRunAbortedResponse:Number = 1, ! NSRunContinuesResponse:Number = 2; ! private static var m_sharedApplication = null; private var m_active:Boolean; --- 61,69 ---- public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); ! public static var NSRunStoppedResponse:Number = 0; ! public static var NSRunAbortedResponse:Number = 1; ! public static var NSRunContinuesResponse:Number = 2; ! private static var m_sharedApplication:NSApplication; private var m_active:Boolean; *************** *** 73,82 **** private var m_currentEvent:NSEvent; private var m_delegate:Object; ! private var m_notificationCenter; private var m_windowsNeedDisplay:Boolean; ! private var m_session:NSModalSession, ! $modal_call:Object, ! $modal_sel:String ! public static function sharedApplication():NSApplication { --- 72,81 ---- private var m_currentEvent:NSEvent; private var m_delegate:Object; ! private var m_notificationCenter:NSNotificationCenter; private var m_windowsNeedDisplay:Boolean; ! ! private var m_modalSession:NSModalSession; ! private var m_modalCallback:Object; ! private var m_modalSelector:String; public static function sharedApplication():NSApplication { *************** *** 149,152 **** --- 148,157 ---- } + /** + * Used to hold sendEvent function during modal event processing. + * Defined here for type checking reasons. + */ + private function originalSendEvent(event:NSEvent) {} + public function sendEvent(event:NSEvent) { m_currentEvent = event; *************** *** 277,281 **** //modal public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String):NSModalSession { ! m_session = new NSModalSession(NSRunContinuesResponse, null, win, m_session, call, sel); if(win instanceof NSPanel) { win.center(); --- 282,286 ---- //modal public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String):NSModalSession { ! m_modalSession = new NSModalSession(NSRunContinuesResponse, null, win, m_modalSession, call, sel); if(win instanceof NSPanel) { win.center(); *************** *** 291,299 **** } ! return m_session; } public function endModalSession(sess:NSModalSession) { ! var tmp:NSModalSession = m_session; if (sess == null) { var e:NSException = NSException.exceptionWithNameReasonUserInfo --- 296,304 ---- } ! return m_modalSession; } public function endModalSession(sess:NSModalSession) { ! var tmp:NSModalSession = m_modalSession; if (sess == null) { var e:NSException = NSException.exceptionWithNameReasonUserInfo *************** *** 313,333 **** e.raise(); } ! while (m_session != sess) { ! tmp = m_session; ! m_session = tmp.previous; if (tmp.window!=null) { tmp.window.setLevel(tmp.entryLevel); } } ! m_session = m_session.previous; if (sess.window != null) { sess.window.setLevel(sess.entryLevel); } //end posing ! m_sharedApplication.sendEvent = m_sharedApplication.$se } public function runModalSession(sess:NSModalSession):Void { ! if (sess != m_session) { var e:NSException = NSException.exceptionWithNameReasonUserInfo ("NSInvalidArgumentException", "wrong session", null); --- 318,338 ---- e.raise(); } ! while (m_modalSession != sess) { ! tmp = m_modalSession; ! m_modalSession = tmp.previous; if (tmp.window!=null) { tmp.window.setLevel(tmp.entryLevel); } } ! m_modalSession = m_modalSession.previous; if (sess.window != null) { sess.window.setLevel(sess.entryLevel); } //end posing ! m_sharedApplication.sendEvent = m_sharedApplication.originalSendEvent; } public function runModalSession(sess:NSModalSession):Void { ! if (sess != m_modalSession) { var e:NSException = NSException.exceptionWithNameReasonUserInfo ("NSInvalidArgumentException", "wrong session", null); *************** *** 343,353 **** } //start posing ! m_sharedApplication.$se = m_sharedApplication.sendEvent; ! m_sharedApplication.sendEvent = m_sharedApplication.$doModal; } ! private function $doModal (event:NSEvent) { var done = false; ! var sess = m_session; if (event != null) { var eventWindow:NSWindow = event.window; --- 348,358 ---- } //start posing ! m_sharedApplication.originalSendEvent = m_sharedApplication.sendEvent; ! m_sharedApplication.sendEvent = m_sharedApplication.modalSendEvent; } ! private function modalSendEvent(event:NSEvent) { var done = false; ! var sess = m_modalSession; if (event != null) { var eventWindow:NSWindow = event.window; *************** *** 367,387 **** o[sess.selector].call(o, sess.runState); if(event!=null) { ! m_sharedApplication.$se(event); } } public function runModalForWindow (win:NSWindow, callb:Object, sel:String):Void { ! var sess:NSModalSession = beginModalSessionForWindow(win, m_sharedApplication, "$modalWin"); runModalSession(sess); ! $modal_call = callb; ! $modal_sel = sel; } ! private function $modalWin(ret:Number) { if(ret!=NSRunContinuesResponse) { ! endModalSession(m_session); } ! var o = $modal_call; ! var s = $modal_sel; o[s].call(o, ret); } --- 372,392 ---- o[sess.selector].call(o, sess.runState); if(event!=null) { ! m_sharedApplication.originalSendEvent(event); } } public function runModalForWindow (win:NSWindow, callb:Object, sel:String):Void { ! var sess:NSModalSession = beginModalSessionForWindow(win, m_sharedApplication, "modalWin"); runModalSession(sess); ! m_modalCallback = callb; ! m_modalSelector = sel; } ! private function modalWin(ret:Number) { if(ret!=NSRunContinuesResponse) { ! endModalSession(m_modalSession); } ! var o = m_modalCallback; ! var s = m_modalSelector; o[s].call(o, ret); } *************** *** 392,397 **** public function stopModalWithCode(ret:Number):Void { ! TRACE("sess: "+m_session); ! if(m_session == null) { var e:NSException = NSException.exceptionWithNameReasonUserInfo ("NSInvalidArgumentException", "not in a modal session", null); --- 397,402 ---- public function stopModalWithCode(ret:Number):Void { ! TRACE("sess: "+m_modalSession); ! if(m_modalSession == null) { var e:NSException = NSException.exceptionWithNameReasonUserInfo ("NSInvalidArgumentException", "not in a modal session", null); *************** *** 399,408 **** e.raise(); } ! m_session.runState = ret; ! endModalSession(m_session); } public function modalWindow():NSWindow { ! return m_session.window; } --- 404,413 ---- e.raise(); } ! m_modalSession.runState = ret; ! endModalSession(m_modalSession); } public function modalWindow():NSWindow { ! return m_modalSession.window; } |
From: Richard K. <ric...@us...> - 2005-06-22 18:12:18
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23948 Modified Files: ASTextRenderer.as Removed Files: ASTextRendererView.as Log Message: merge function, use NSScrollView if needed --- ASTextRendererView.as DELETED --- Index: ASTextRenderer.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTextRenderer.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTextRenderer.as 22 Jun 2005 05:29:39 -0000 1.2 --- ASTextRenderer.as 22 Jun 2005 18:12:09 -0000 1.3 *************** *** 33,49 **** import org.actionstep.NSSize; import org.actionstep.ASTheme; - import org.actionstep.ASTextRendererView; - import org.actionstep.NSScrollView; - - import org.actionstep.constants.NSBorderType; class org.actionstep.ASTextRenderer extends NSView { ! private var m_borderType:NSBorderType; ! private var m_scrollView:NSScrollView; ! private var m_rendererView:ASTextRendererView; ! private var m_drawsBackground:Boolean; ! public function ASTextRenderer() { m_drawsBackground = true; } --- 33,55 ---- import org.actionstep.NSSize; import org.actionstep.ASTheme; class org.actionstep.ASTextRenderer extends NSView { ! private var m_textField:TextField; ! private var m_text:String; ! private var m_style:TextField.StyleSheet; ! private var m_leftMargin:Number; ! private var m_rightMargin:Number; ! private var m_topMargin:Number ! private var m_bottomMargin:Number; ! private var m_automaticResize:Boolean ! private var m_drawsBackground:Boolean ! public function ASTextRenderer() { + m_topMargin = 5; + m_leftMargin = 5; + m_bottomMargin = 5; + m_rightMargin = 5; + m_automaticResize = false; m_drawsBackground = true; } *************** *** 51,173 **** public function initWithFrame(rect:NSRect):ASTextRenderer { super.initWithFrame(rect); - m_scrollView = new NSScrollView(); - m_scrollView.initWithFrame(new NSRect(0,0,rect.size.width, rect.size.height)); - addSubview(m_scrollView); - m_rendererView = new ASTextRendererView(); - m_rendererView.initWithFrame(new NSRect(0,0,rect.size.width, rect.size.height)); - m_scrollView.setDocumentView(m_rendererView); return this; } ! ! public function hasVericalScroller():Boolean { ! return m_scrollView.hasVerticalScroller(); } ! ! public function setHasVerticalScroller(value:Boolean) { ! m_scrollView.setHasVerticalScroller(value); } ! ! public function hasHorizontalScroller():Boolean { ! return m_scrollView.hasHorizontalScroller(); } ! public function setHasHorizontalScroller(value:Boolean) { ! m_scrollView.setHasHorizontalScroller(value); } ! ! public function setBorderType(value:NSBorderType) { ! m_scrollView.setBorderType(value); } ! public function borderType():NSBorderType { ! return m_scrollView.borderType(); } ! public function setText(text:String) { ! m_rendererView.setText(text); } ! public function text():String { ! return m_rendererView.text(); } public function setStyleSheet(style:TextField.StyleSheet) { ! m_rendererView.setStyleSheet(style); } public function styleSheet():TextField.StyleSheet { ! return m_rendererView.styleSheet(); } ! /** ! * @see org.actionstep.NSView#setFrame ! */ ! public function setFrame(rect:NSRect) { ! super.setFrame(rect); ! m_scrollView.setFrameSize(new NSSize(rect.size.width, rect.size.height)); ! setNeedsDisplay(true); } ! ! /** ! * @see org.actionstep.NSView#setFrameSize ! */ ! public function setFrameSize(size:NSSize) { ! super.setFrameSize(size); ! m_scrollView.setFrameSize(new NSSize(size.width, size.height)); ! setNeedsDisplay(true); } ! public function description():String { ! return "ASTextRenderer()"; ! } ! ! // Drawing ! ! public function setDrawsBackground(value:Boolean) { ! m_drawsBackground = value; ! } ! ! public function drawsBackground():Boolean { ! return m_drawsBackground; ! } ! ! public function drawRect(rect:NSRect) { ! if (m_drawsBackground) { ! ASTheme.current().drawListWithRectInView(rect, this); ! } ! } ! ! // Margins ! ! public function setRightMargin(value:Number) { ! m_rendererView.setRightMargin(value); ! } ! ! public function rightMargin():Number { ! return m_rendererView.rightMargin() ! } ! ! public function setLeftMargin(value:Number) { ! m_rendererView.setLeftMargin(value); ! } ! ! public function leftMargin():Number { ! return m_rendererView.leftMargin(); ! } ! ! public function setTopMargin(value:Number) { ! m_rendererView.setTopMargin(value); ! } ! ! public function topMargin():Number { ! return m_rendererView.topMargin(); ! } ! public function setBottomMargin(value:Number) { ! m_rendererView.setBottomMargin(value); ! } ! public function bottomMargin():Number { ! return m_rendererView.bottomMargin(); ! } } \ No newline at end of file --- 57,177 ---- public function initWithFrame(rect:NSRect):ASTextRenderer { super.initWithFrame(rect); return this; } ! ! public function createMovieClips() { ! super.createMovieClips(); ! if (m_mcBounds != null) { ! m_textField = createBoundsTextField(); ! m_textField.border = false; ! m_textField.type = "dynamic" ! m_textField.wordWrap = false; ! m_textField.multiline = true; ! m_textField.autoSize = true ! m_textField.html = true; ! m_textField._x = m_leftMargin; ! m_textField._y = m_topMargin; ! m_textField.editable = false; ! m_textField.selectable = false; ! m_textField.styleSheet = m_style; ! m_textField.htmlText = m_text; ! m_textField._width = m_textField.textWidth; ! m_textField._height = m_textField.textHeight+1; ! autoSize(); ! } } ! ! public function setRightMargin(value:Number) { ! m_rightMargin = value; } ! ! public function rightMargin():Number { ! return m_rightMargin; } ! public function setLeftMargin(value:Number) { ! m_leftMargin = value; ! m_textField._x = m_leftMargin; ! autoSize(); } ! ! public function leftMargin():Number { ! return m_leftMargin; } ! public function setTopMargin(value:Number) { ! m_topMargin = value; ! m_textField._y = m_topMargin; ! autoSize(); ! } ! ! public function topMargin():Number { ! return m_topMargin; ! } ! ! public function setBottomMargin(value:Number) { ! m_bottomMargin = value; ! autoSize(); ! } ! ! public function bottomMargin():Number { ! return m_bottomMargin; } ! public function setAutomaticResize(value:Boolean) { ! if(m_automaticResize == value) return; ! m_automaticResize = value; ! autoSize(); } ! public function automaticResize():Boolean { ! return m_automaticResize; } public function setStyleSheet(style:TextField.StyleSheet) { ! m_style = style; ! m_textField.styleSheet = m_style; ! m_textField.htmlText = m_text; } public function styleSheet():TextField.StyleSheet { ! return m_style; } ! public function setText(text:String) { ! m_text = text; ! if (m_textField != null) { ! m_textField.htmlText = m_text; ! m_textField._width = m_textField.textWidth; ! m_textField._height = m_textField.textHeight+1; ! } ! autoSize(); } ! ! public function setDrawsBackground(value:Boolean) { ! if (m_drawsBackground == value) return; ! m_drawsBackground = value; ! setNeedsDisplay(true); } ! public function drawsBackground():Boolean { ! return m_drawsBackground; ! } ! public function text():String { ! return m_text; ! } ! public function drawRect(rect:NSRect) { ! ASTheme.current().drawListWithRectInView(rect, this); ! } ! ! public function autoSize() { ! if (!m_automaticResize) return; ! if (m_textField == undefined) { ! setFrameSize(new NSSize(0,0)); ! } else { ! setFrameSize(new NSSize(m_textField.textWidth+20, m_textField.textHeight+20)); ! } ! } } \ No newline at end of file |
From: Tay R. C. <rc...@us...> - 2005-06-22 10:14:34
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6715 Modified Files: NSModalSession.as Log Message: Changed NSRunResponse to Number Index: NSModalSession.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSModalSession.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NSModalSession.as 20 Jun 2005 02:07:09 -0000 1.1 --- NSModalSession.as 22 Jun 2005 10:14:24 -0000 1.2 *************** *** 32,39 **** import org.actionstep.NSWindow; - import org.actionstep.constants.NSRunResponse; - class org.actionstep.NSModalSession extends NSObject { ! public var runState:NSRunResponse, entryLevel:Number, //not supported window:NSWindow, --- 32,37 ---- import org.actionstep.NSWindow; class org.actionstep.NSModalSession extends NSObject { ! public var runState:Number, entryLevel:Number, //not supported window:NSWindow, *************** *** 44,48 **** selector:String; ! public function NSModalSession(run:NSRunResponse, entry:Number, win:NSWindow, prev:NSModalSession, call:Object, sel:String) { runState = run; entryLevel = entry; --- 42,46 ---- selector:String; ! public function NSModalSession(run:Number, entry:Number, win:NSWindow, prev:NSModalSession, call:Object, sel:String) { runState = run; entryLevel = entry; |
From: Tay R. C. <rc...@us...> - 2005-06-22 09:50:19
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28280 Modified Files: NSWindow.as Log Message: Title access, but no display Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NSWindow.as 20 Jun 2005 02:17:14 -0000 1.13 --- NSWindow.as 22 Jun 2005 09:50:11 -0000 1.14 *************** *** 103,106 **** --- 103,107 ---- private var m_fieldEditor:ASFieldEditor; private var m_rootSwfURL:String; + private var m_title:String; private var *************** *** 446,449 **** --- 447,459 ---- TRACE("$close window..."); } + + public function setTitle(s:String) { + m_title = s; + //!display + } + + public function title():String { + return m_title; + } // Field editor |
From: Tay R. C. <rc...@us...> - 2005-06-22 09:48:44
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27483 Modified Files: NSApplication.as Log Message: Changed posing for modal Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NSApplication.as 21 Jun 2005 03:22:33 -0000 1.14 --- NSApplication.as 22 Jun 2005 09:48:36 -0000 1.15 *************** *** 43,48 **** import org.actionstep.ASTheme; - import org.actionstep.constants.NSRunResponse; - class org.actionstep.NSApplication extends NSResponder { --- 43,46 ---- *************** *** 62,65 **** --- 60,68 ---- public static var NSApplicationWillUnhideNotification = ASUtils.intern("NSApplicationWillUnhideNotification"); public static var NSApplicationWillUpdateNotification = ASUtils.intern("NSApplicationWillUpdateNotification"); + + public static var + NSRunStoppedResponse:Number = 0, + NSRunAbortedResponse:Number = 1, + NSRunContinuesResponse:Number = 2; private static var m_sharedApplication = null; *************** *** 75,89 **** $modal_call:Object, $modal_sel:String - /* - function get m_session() { - return $m_session; - } - - function set m_session(sess) { - $m_session = sess; - if(sess==null) { - ASUtils.findCaller([NSApplication], arguments.caller); - } - }*/ --- 78,81 ---- *************** *** 285,289 **** //modal public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String):NSModalSession { ! m_session = new NSModalSession(NSRunResponse.NSRunContinuesResponse, null, win, m_session, call, sel); if(win instanceof NSPanel) { win.center(); --- 277,281 ---- //modal public function beginModalSessionForWindow(win:NSWindow, call:Object, sel:String):NSModalSession { ! m_session = new NSModalSession(NSRunContinuesResponse, null, win, m_session, call, sel); if(win instanceof NSPanel) { win.center(); *************** *** 332,336 **** sess.window.setLevel(sess.entryLevel); } ! NSApplication.prototype.sendEvent = NSApplication.prototype.$se } --- 324,329 ---- sess.window.setLevel(sess.entryLevel); } ! //end posing ! m_sharedApplication.sendEvent = m_sharedApplication.$se } *************** *** 349,354 **** win.makeMainWindow(); } ! NSApplication.prototype.$se = NSApplication.prototype.sendEvent; ! NSApplication.prototype.sendEvent = NSApplication.prototype.$doModal; } --- 342,348 ---- win.makeMainWindow(); } ! //start posing ! m_sharedApplication.$se = m_sharedApplication.sendEvent; ! m_sharedApplication.sendEvent = m_sharedApplication.$doModal; } *************** *** 373,377 **** o[sess.selector].call(o, sess.runState); if(event!=null) { ! NSApplication.prototype.$se(event); } } --- 367,371 ---- o[sess.selector].call(o, sess.runState); if(event!=null) { ! m_sharedApplication.$se(event); } } *************** *** 384,389 **** } ! private function $modalWin(ret:NSRunResponse) { ! if(ret!=NSRunResponse.NSRunContinuesResponse) { endModalSession(m_session); } --- 378,383 ---- } ! private function $modalWin(ret:Number) { ! if(ret!=NSRunContinuesResponse) { endModalSession(m_session); } *************** *** 394,401 **** public function stopModal() { ! stopModalWithCode(NSRunResponse.NSRunStoppedResponse); } ! public function stopModalWithCode(ret:NSRunResponse):Void { TRACE("sess: "+m_session); if(m_session == null) { --- 388,395 ---- public function stopModal() { ! stopModalWithCode(NSRunStoppedResponse); } ! public function stopModalWithCode(ret:Number):Void { TRACE("sess: "+m_session); if(m_session == null) { *************** *** 408,411 **** --- 402,409 ---- endModalSession(m_session); } + + public function modalWindow():NSWindow { + return m_session.window; + } // Setting the delegate |
From: U5eR <u5...@us...> - 2005-06-22 08:02:31
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5861/src/org/actionstep Modified Files: ASDraw.as Log Message: added alpha to the corner rect methods Index: ASDraw.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASDraw.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ASDraw.as 15 Jun 2005 23:10:10 -0000 1.11 --- ASDraw.as 22 Jun 2005 08:02:05 -0000 1.12 *************** *** 651,655 **** public static function drawLineWithAlpha(mc:MovieClip, startX:Number, startY:Number, endX:Number, endY:Number, color:Number, alpha:Number){ ! drawLineWithAlphaThickness(mc, startX, startY, endX, endY, color, DEFAULT_ALPHA, DEFAULT_LINE_THICKNESS); } --- 651,655 ---- public static function drawLineWithAlpha(mc:MovieClip, startX:Number, startY:Number, endX:Number, endY:Number, color:Number, alpha:Number){ ! drawLineWithAlphaThickness(mc, startX, startY, endX, endY, color, alpha, DEFAULT_LINE_THICKNESS); } *************** *** 820,865 **** //SOLIDS ! public static function solidCornerRectWithRect(mc:MovieClip, rect:NSRect, color:Number){ ! solidCornerRect(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color); } ! public static function solidCornerRectWithAlphaRect(mc:MovieClip, rect:NSRect, color:Number, alpha:Number){ ! solidCornerRectWithAlpha(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, alpha); } ! public static function solidCornerRect(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, color:Number){ var alpha:Number = 100; ! solidCornerRectWithAlpha(mc, x, y, width, height, color, alpha); } ! public static function solidCornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, color:Number, alpha:Number){ ! var cornerSize = 1; mc.lineStyle(undefined, 0, 100); mc.beginFill(color,alpha); ! cornerRectWithAlpha(mc, x, y, width, height); mc.endFill(); } //OUTLINES ! public static function outlineCornerRectWithRect(mc:MovieClip, rect:NSRect, color:Number){ ! outlineCornerRect(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color); } ! public static function outlineCornerRectWithAlphaRect(mc:MovieClip, rect:NSRect, color:Number, alpha:Number){ ! outlineCornerRectWithAlpha(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, color, alpha); } ! public static function outlineCornerRect(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, color:Number){ var alpha:Number = 100; ! outlineCornerRectWithAlpha(mc, x, y, width, height, color, alpha); } ! public static function outlineCornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, color:Number, alpha:Number){ mc.lineStyle(1, color, alpha); ! cornerRectWithAlpha(mc, x, y, width, height); } ! private static function cornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number){ ! var cornerSize = 1; mc.moveTo(x+cornerSize ,y); mc.lineTo(x+width-cornerSize,y); --- 820,864 ---- //SOLIDS ! public static function solidCornerRectWithRect(mc:MovieClip, rect:NSRect, corner:Number, color:Number){ ! solidCornerRect(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, corner, color); } ! public static function solidCornerRectWithAlphaRect(mc:MovieClip, rect:NSRect, corner:Number, color:Number, alpha:Number){ ! solidCornerRectWithAlpha(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, corner, color, alpha); } ! public static function solidCornerRect(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, corner:Number, color:Number){ var alpha:Number = 100; ! solidCornerRectWithAlpha(mc, x, y, width, height, corner, color, alpha); } ! public static function solidCornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, corner:Number, color:Number, alpha:Number){ ! // var cornerSize = 1; mc.lineStyle(undefined, 0, 100); mc.beginFill(color,alpha); ! cornerRectWithAlpha(mc, x, y, width, height, corner); mc.endFill(); } //OUTLINES ! public static function outlineCornerRectWithRect(mc:MovieClip, rect:NSRect, corner:Number, color:Number){ ! outlineCornerRect(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, corner, color); } ! public static function outlineCornerRectWithAlphaRect(mc:MovieClip, rect:NSRect, corner:Number, color:Number, alpha:Number){ ! outlineCornerRectWithAlpha(mc, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height, corner, color, alpha); } ! public static function outlineCornerRect(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, corner:Number, color:Number){ var alpha:Number = 100; ! outlineCornerRectWithAlpha(mc, x, y, width, height, corner, color, alpha); } ! public static function outlineCornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, corner:Number, color:Number, alpha:Number){ mc.lineStyle(1, color, alpha); ! cornerRectWithAlpha(mc, x, y, width, height, corner); } ! private static function cornerRectWithAlpha(mc:MovieClip, x:Number, y:Number, width:Number, height:Number, cornerSize:Number){ mc.moveTo(x+cornerSize ,y); mc.lineTo(x+width-cornerSize,y); |
From: Richard K. <ric...@us...> - 2005-06-22 05:29:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28615 Modified Files: ASTextRenderer.as ASTextRendererView.as Log Message: added margin support (right/bottom not fully working) Index: ASTextRendererView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTextRendererView.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTextRendererView.as 22 Jun 2005 05:16:46 -0000 1.2 --- ASTextRendererView.as 22 Jun 2005 05:29:39 -0000 1.3 *************** *** 71,74 **** --- 71,111 ---- } + public function setRightMargin(value:Number) { + m_rightMargin = value; + } + + public function rightMargin():Number { + return m_rightMargin; + } + + public function setLeftMargin(value:Number) { + m_leftMargin = value; + m_textField._x = m_leftMargin; + autoSize(); + } + + public function leftMargin():Number { + return m_leftMargin; + } + + public function setTopMargin(value:Number) { + m_topMargin = value; + m_textField._y = m_topMargin; + autoSize(); + } + + public function topMargin():Number { + return m_topMargin; + } + + public function setBottomMargin(value:Number) { + m_bottomMargin = value; + autoSize(); + } + + public function bottomMargin():Number { + return m_bottomMargin; + } + public function setStyleSheet(style:TextField.StyleSheet) { m_style = style; Index: ASTextRenderer.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTextRenderer.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTextRenderer.as 22 Jun 2005 05:12:31 -0000 1.1 --- ASTextRenderer.as 22 Jun 2005 05:29:39 -0000 1.2 *************** *** 43,46 **** --- 43,51 ---- private var m_scrollView:NSScrollView; private var m_rendererView:ASTextRendererView; + private var m_drawsBackground:Boolean; + + public function ASTextRenderer() { + m_drawsBackground = true; + } public function initWithFrame(rect:NSRect):ASTextRenderer { *************** *** 50,54 **** addSubview(m_scrollView); m_rendererView = new ASTextRendererView(); ! m_rendererView.initWithRenderer(this); m_scrollView.setDocumentView(m_rendererView); return this; --- 55,59 ---- addSubview(m_scrollView); m_rendererView = new ASTextRendererView(); ! m_rendererView.initWithFrame(new NSRect(0,0,rect.size.width, rect.size.height)); m_scrollView.setDocumentView(m_rendererView); return this; *************** *** 119,124 **** // Drawing public function drawRect(rect:NSRect) { ! ASTheme.current().drawListWithRectInView(rect, this); } } \ No newline at end of file --- 124,173 ---- // Drawing + public function setDrawsBackground(value:Boolean) { + m_drawsBackground = value; + } + + public function drawsBackground():Boolean { + return m_drawsBackground; + } + public function drawRect(rect:NSRect) { ! if (m_drawsBackground) { ! ASTheme.current().drawListWithRectInView(rect, this); ! } ! } ! ! // Margins ! ! public function setRightMargin(value:Number) { ! m_rendererView.setRightMargin(value); ! } ! ! public function rightMargin():Number { ! return m_rendererView.rightMargin() ! } ! ! public function setLeftMargin(value:Number) { ! m_rendererView.setLeftMargin(value); ! } ! ! public function leftMargin():Number { ! return m_rendererView.leftMargin(); ! } ! ! public function setTopMargin(value:Number) { ! m_rendererView.setTopMargin(value); ! } ! ! public function topMargin():Number { ! return m_rendererView.topMargin(); ! } ! ! public function setBottomMargin(value:Number) { ! m_rendererView.setBottomMargin(value); ! } ! ! public function bottomMargin():Number { ! return m_rendererView.bottomMargin(); } } \ No newline at end of file |
From: Richard K. <ric...@us...> - 2005-06-22 05:16:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21797 Modified Files: ASTextRendererView.as Log Message: just use initWithFrame for reuse perspective Index: ASTextRendererView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTextRendererView.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTextRendererView.as 22 Jun 2005 05:12:31 -0000 1.1 --- ASTextRendererView.as 22 Jun 2005 05:16:46 -0000 1.2 *************** *** 31,40 **** import org.actionstep.NSView; import org.actionstep.NSSize; - import org.actionstep.NSRect; - import org.actionstep.ASTextRenderer; class org.actionstep.ASTextRendererView extends NSView { - private var m_renderer:ASTextRenderer; private var m_textField:TextField; private var m_text:String; --- 31,37 ---- *************** *** 52,60 **** } - public function initWithRenderer(renderer:ASTextRenderer) { - super.initWithFrame(renderer.frame()); - m_renderer = renderer; - } - public function createMovieClips() { super.createMovieClips(); --- 49,52 ---- |
From: Richard K. <ric...@us...> - 2005-06-22 05:12:41
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19737/test Added Files: ASTestTextRenderer.as Log Message: added basic text renderer (its a scrollview) w/stylesheet --- NEW FILE: ASTestTextRenderer.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. and Affinity Systems may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import org.actionstep.*; class org.actionstep.test.ASTestTextRenderer { public static function test():Void { var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); styleSheet.parseCSS( " contact { font-family: Verdana,Ariel; color: #000000; display: block; } name { font-weight: bold; font-size: 18; } label { color: #555555; font-weight: bold; font-size: 12; display: inline; } item { font-size: 12; display: block; }"); var htmlText:String = " <contact> <name>Richard Kilmer</name> <item> President & CEO</item> <item> InfoEther, Inc.</item> <br><textformat tabstops='[60,200]'> <label> home \t</label> <item>555.555.1212</item> <label> work \t</label> <item>555.555.1313</item> </textformat> </contact> " var app:NSApplication = NSApplication.sharedApplication(); var window:NSWindow = (new NSWindow()).initWithContentRect(new NSRect(0,0,500,500)); var view:NSView = (new NSView()).initWithFrame(new NSRect(0,0,500,500)); var textRenderer:ASTextRenderer = (new ASTextRenderer()).initWithFrame(new NSRect(10, 10, 200, 200)); textRenderer.setHasHorizontalScroller(false); textRenderer.setHasVerticalScroller(false); textRenderer.setStyleSheet(styleSheet); textRenderer.setText(htmlText); view.addSubview(textRenderer); window.setContentView(view); app.run(); } } |
From: Richard K. <ric...@us...> - 2005-06-22 05:12:41
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19737 Modified Files: ASTheme.as Added Files: ASTextRenderer.as ASTextRendererView.as Log Message: added basic text renderer (its a scrollview) w/stylesheet Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ASTheme.as 19 Jun 2005 05:21:57 -0000 1.15 --- ASTheme.as 22 Jun 2005 05:12:31 -0000 1.16 *************** *** 88,92 **** drawTextfield(mc, rect); //these are the textfield left fade colors ! ASDraw.gradientRectWithAlphaRect(mc, topShadowRect, ASDraw.ANGLE_LEFT_TO_RIGHT, [0x767A85, 0xB6BBC1], [0,255], [50,0]); //ASDraw.gradientRectWithAlphaRect(mc, itemHiliteRect, ASDraw.ANGLE_LEFT_TO_RIGHT, // [0x494D56, 0x494D56, 0x494D56, 0x494D56], [265,373,413,430], [40,40,0,0]); --- 88,92 ---- drawTextfield(mc, rect); //these are the textfield left fade colors ! //ASDraw.gradientRectWithAlphaRect(mc, topShadowRect, ASDraw.ANGLE_LEFT_TO_RIGHT, [0x767A85, 0xB6BBC1], [0,255], [50,0]); //ASDraw.gradientRectWithAlphaRect(mc, itemHiliteRect, ASDraw.ANGLE_LEFT_TO_RIGHT, // [0x494D56, 0x494D56, 0x494D56, 0x494D56], [265,373,413,430], [40,40,0,0]); --- NEW FILE: ASTextRendererView.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import org.actionstep.NSView; import org.actionstep.NSSize; import org.actionstep.NSRect; import org.actionstep.ASTextRenderer; class org.actionstep.ASTextRendererView extends NSView { private var m_renderer:ASTextRenderer; private var m_textField:TextField; private var m_text:String; private var m_style:TextField.StyleSheet; private var m_leftMargin:Number; private var m_rightMargin:Number; private var m_topMargin:Number private var m_bottomMargin:Number; public function ASListView() { m_topMargin = 5; m_leftMargin = 5; m_bottomMargin = 5; m_rightMargin = 5; } public function initWithRenderer(renderer:ASTextRenderer) { super.initWithFrame(renderer.frame()); m_renderer = renderer; } public function createMovieClips() { super.createMovieClips(); if (m_mcBounds != null) { m_textField = createBoundsTextField(); m_textField.border = false; m_textField.type = "dynamic" m_textField.wordWrap = false; m_textField.multiline = true; m_textField.autoSize = true m_textField.html = true; m_textField._x = m_leftMargin; m_textField._y = m_topMargin; m_textField.editable = false; m_textField.selectable = false; m_textField.styleSheet = m_style; m_textField.htmlText = m_text; m_textField._width = m_textField.textWidth; m_textField._height = m_textField.textHeight+1; setFrameSize(new NSSize(m_textField.textWidth+20, m_textField.textHeight+20)); } } public function setStyleSheet(style:TextField.StyleSheet) { m_style = style; m_textField.styleSheet = m_style; m_textField.htmlText = m_text; } public function styleSheet():TextField.StyleSheet { return m_style; } public function setText(text:String) { m_text = text; if (m_textField != null) { m_textField.htmlText = m_text; m_textField._width = m_textField.textWidth; m_textField._height = m_textField.textHeight+1; } autoSize(); } public function text():String { return m_text; } public function autoSize() { if (m_textField == undefined) { setFrameSize(new NSSize(0,0)); } else { setFrameSize(new NSSize(m_textField.textWidth+20, m_textField.textHeight+20)); } } } --- NEW FILE: ASTextRenderer.as --- /* * Copyright (c) 2005, InfoEther, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1) Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2) Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3) The name InfoEther, Inc. may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ import org.actionstep.NSView; import org.actionstep.NSRect; import org.actionstep.NSSize; import org.actionstep.ASTheme; import org.actionstep.ASTextRendererView; import org.actionstep.NSScrollView; import org.actionstep.constants.NSBorderType; class org.actionstep.ASTextRenderer extends NSView { private var m_borderType:NSBorderType; private var m_scrollView:NSScrollView; private var m_rendererView:ASTextRendererView; public function initWithFrame(rect:NSRect):ASTextRenderer { super.initWithFrame(rect); m_scrollView = new NSScrollView(); m_scrollView.initWithFrame(new NSRect(0,0,rect.size.width, rect.size.height)); addSubview(m_scrollView); m_rendererView = new ASTextRendererView(); m_rendererView.initWithRenderer(this); m_scrollView.setDocumentView(m_rendererView); return this; } public function hasVericalScroller():Boolean { return m_scrollView.hasVerticalScroller(); } public function setHasVerticalScroller(value:Boolean) { m_scrollView.setHasVerticalScroller(value); } public function hasHorizontalScroller():Boolean { return m_scrollView.hasHorizontalScroller(); } public function setHasHorizontalScroller(value:Boolean) { m_scrollView.setHasHorizontalScroller(value); } public function setBorderType(value:NSBorderType) { m_scrollView.setBorderType(value); } public function borderType():NSBorderType { return m_scrollView.borderType(); } public function setText(text:String) { m_rendererView.setText(text); } public function text():String { return m_rendererView.text(); } public function setStyleSheet(style:TextField.StyleSheet) { m_rendererView.setStyleSheet(style); } public function styleSheet():TextField.StyleSheet { return m_rendererView.styleSheet(); } /** * @see org.actionstep.NSView#setFrame */ public function setFrame(rect:NSRect) { super.setFrame(rect); m_scrollView.setFrameSize(new NSSize(rect.size.width, rect.size.height)); setNeedsDisplay(true); } /** * @see org.actionstep.NSView#setFrameSize */ public function setFrameSize(size:NSSize) { super.setFrameSize(size); m_scrollView.setFrameSize(new NSSize(size.width, size.height)); setNeedsDisplay(true); } public function description():String { return "ASTextRenderer()"; } // Drawing public function drawRect(rect:NSRect) { ASTheme.current().drawListWithRectInView(rect, this); } } |
From: Richard K. <ric...@us...> - 2005-06-21 05:12:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22042 Modified Files: ASAnimatedTabView.as Log Message: set an additional value for animating Index: ASAnimatedTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAnimatedTabView.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASAnimatedTabView.as 21 Jun 2005 04:27:26 -0000 1.4 --- ASAnimatedTabView.as 21 Jun 2005 05:12:38 -0000 1.5 *************** *** 95,98 **** --- 95,99 ---- context.speed+=this.removalAcceleration(); if ((-context.point.x) > context.width) { + context.point.x = -context.width; m_selected.view().removeFromSuperview(); timer.invalidate(); *************** *** 124,127 **** --- 125,129 ---- .1, this, "_animateNewItem", { point:rect.origin, + width: rect.size.width, targetX:(rect.origin.x+rect.size.width), speed:this.addSpeed() |
From: Richard K. <ric...@us...> - 2005-06-21 04:27:34
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2448 Modified Files: ASAnimatedTabView.as Log Message: added speed methods enabling overriding Index: ASAnimatedTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAnimatedTabView.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASAnimatedTabView.as 2 Jun 2005 04:11:57 -0000 1.3 --- ASAnimatedTabView.as 21 Jun 2005 04:27:26 -0000 1.4 *************** *** 57,60 **** --- 57,76 ---- } + private function removalSpeed():Number { + return 50; + } + + private function removalAcceleration():Number { + return 10; + } + + private function addSpeed():Number { + return 140; + } + + private function addAcceleration():Number { + return -10; + } + private function _removeOldItem(item:NSTabViewItem) { if (m_selected != null) { *************** *** 66,70 **** point:m_selected.view().frame().origin.clone(), width:m_selected.view().frame().size.width, ! speed:50 }, true); --- 82,86 ---- point:m_selected.view().frame().origin.clone(), width:m_selected.view().frame().size.width, ! speed:this.removalSpeed() }, true); *************** *** 77,81 **** var context = timer.userInfo(); context.point.x -= context.speed; ! context.speed+=20; if ((-context.point.x) > context.width) { m_selected.view().removeFromSuperview(); --- 93,97 ---- var context = timer.userInfo(); context.point.x -= context.speed; ! context.speed+=this.removalAcceleration(); if ((-context.point.x) > context.width) { m_selected.view().removeFromSuperview(); *************** *** 104,113 **** selectedView.setFrame(rect); setNeedsDisplay(true); ! window().displayIfNeeded(); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( .1, this, "_animateNewItem", { point:rect.origin, targetX:(rect.origin.x+rect.size.width), ! speed:140 }, true); --- 120,129 ---- selectedView.setFrame(rect); setNeedsDisplay(true); ! //window().displayIfNeeded(); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( .1, this, "_animateNewItem", { point:rect.origin, targetX:(rect.origin.x+rect.size.width), ! speed:this.addSpeed() }, true); *************** *** 125,129 **** var context = timer.userInfo(); context.point.x += context.speed; ! context.speed-=20; if (context.point.x > context.targetX) { context.point.x = context.targetX; --- 141,145 ---- var context = timer.userInfo(); context.point.x += context.speed; ! context.speed+=this.addAcceleration(); if (context.point.x > context.targetX) { context.point.x = context.targetX; *************** *** 139,143 **** private function _finish() { setNeedsDisplay(true); ! window().displayIfNeeded(); if(typeof(m_delegate["tabViewDidSelectTabViewItem"]) == "function") { m_delegate["tabViewDidSelectTabViewItem"].call(m_delegate, this, m_selected); --- 155,159 ---- private function _finish() { setNeedsDisplay(true); ! //window().displayIfNeeded(); if(typeof(m_delegate["tabViewDidSelectTabViewItem"]) == "function") { m_delegate["tabViewDidSelectTabViewItem"].call(m_delegate, this, m_selected); |
From: Richard K. <ric...@us...> - 2005-06-21 03:22:44
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4745 Modified Files: NSApplication.as ASRootWindowView.as Log Message: change the way display update is handled...moved to the onEnterFrame loop Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASRootWindowView.as 17 Jun 2005 22:16:48 -0000 1.3 --- ASRootWindowView.as 21 Jun 2005 03:22:33 -0000 1.4 *************** *** 53,57 **** private function createFrameMovieClip() { var clipDepth = 100+m_window.windowNumber(); ! return _root.createEmptyMovieClip("ASRootWindowView"+clipDepth, clipDepth); } --- 53,62 ---- private function createFrameMovieClip() { var clipDepth = 100+m_window.windowNumber(); ! var self = this; ! m_mcFrame = _root.createEmptyMovieClip("ASRootWindowView"+clipDepth, clipDepth); ! m_mcFrame.onEnterFrame = function() { ! self.m_window.displayIfNeeded(); ! } ! return m_mcFrame; } Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NSApplication.as 20 Jun 2005 02:04:28 -0000 1.13 --- NSApplication.as 21 Jun 2005 03:22:33 -0000 1.14 *************** *** 169,177 **** ASFieldEditor.instance().regainFocus(); } if (event.window == undefined) { updateWindowsIfNeeded(); } else { event.window.displayIfNeeded(); ! } return; } --- 169,178 ---- ASFieldEditor.instance().regainFocus(); } + /* // updates are now done in ASRootWindowView if (event.window == undefined) { updateWindowsIfNeeded(); } else { event.window.displayIfNeeded(); ! }*/ return; } *************** *** 185,194 **** if (event.type == NSEvent.NSLeftMouseUp && ASFieldEditor.instance().isEditing()) { ASFieldEditor.instance().regainFocus(); ! } if (event.window == undefined) { updateWindowsIfNeeded(); } else { event.window.displayIfNeeded(); ! } } --- 186,195 ---- if (event.type == NSEvent.NSLeftMouseUp && ASFieldEditor.instance().isEditing()) { ASFieldEditor.instance().regainFocus(); ! }/* // updates are now done in ASRootWindowView if (event.window == undefined) { updateWindowsIfNeeded(); } else { event.window.displayIfNeeded(); ! }*/ } |