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-07-10 04:14:28
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2019 Modified Files: ASList.as Log Message: unselect items before clear Index: ASList.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASList.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASList.as 9 Jul 2005 04:32:41 -0000 1.5 --- ASList.as 10 Jul 2005 04:14:18 -0000 1.6 *************** *** 219,222 **** --- 219,228 ---- */ public function removeAllItems():Void { + var items:Array = m_internalList.internalList(); + for(var i = 0;i < items.length;i++) { + if (items[i].isSelected()) { + items[i].setSelected(false); + } + } m_internalList.clear(); m_listView.computeHeight(); |
From: Richard K. <ric...@us...> - 2005-07-09 15:53:01
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32204 Modified Files: ASAnimatedTabView.as Log Message: added easing function support Index: ASAnimatedTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAnimatedTabView.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASAnimatedTabView.as 9 Jul 2005 04:33:34 -0000 1.6 --- ASAnimatedTabView.as 9 Jul 2005 15:52:49 -0000 1.7 *************** *** 32,36 **** --- 32,38 ---- import org.actionstep.NSView; import org.actionstep.NSRect; + import org.actionstep.NSPoint; import org.actionstep.NSTimer; + import org.actionstep.ASDraw; import org.actionstep.NSTabViewItem; import org.actionstep.constants.NSTabState; *************** *** 44,49 **** --- 46,63 ---- * */ + class org.actionstep.ASAnimatedTabView extends NSTabView { + private var m_tabOutEasingFunction:Function; + private var m_tabInEasingFunction:Function; + private var m_tabOutDuration:Number; + private var m_tabInDuration:Number; + + public function ASAnimatedTabView() { + m_tabOutEasingFunction = ASDraw.easeOutQuad; + m_tabInEasingFunction = ASDraw.easeInQuad; + m_tabInDuration = m_tabOutDuration = 500; + } + public function selectTabViewItem(item:NSTabViewItem) { if (m_delegate != null) { *************** *** 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) { --- 71,106 ---- } ! public function tabOutDuration():Number { ! return m_tabOutDuration; } ! ! public function tabInDuration():Number { ! return m_tabInDuration; } ! public function setTabOutDuration(dur:Number) { ! m_tabOutDuration = dur; } ! public function setTabInDuration(dur:Number) { ! m_tabInDuration = dur; ! } ! ! public function tabOutEasingFunction():Function { ! return m_tabOutEasingFunction; ! } ! ! public function setTabOutEasingFunction(func:Function) { ! m_tabOutEasingFunction = func; } + public function tabInEasingFunction():Function { + return m_tabInEasingFunction; + } + + public function setInOutEasingFunction(func:Function) { + m_tabInEasingFunction = func; + } + private function _removeOldItem(item:NSTabViewItem) { if (m_selected != null) { *************** *** 80,86 **** .005, this, "_animateOldItem", { item:item, ! point:m_selected.view().frame().origin.clone(), width:m_selected.view().frame().size.width, ! speed:this.removalSpeed() }, true); --- 110,117 ---- .005, this, "_animateOldItem", { item:item, ! startX:m_selected.view().frame().origin.x, ! y:m_selected.view().frame().origin.y, width:m_selected.view().frame().size.width, ! startTime:getTimer() }, true); *************** *** 91,106 **** private function _animateOldItem(timer:NSTimer) { ! var context = timer.userInfo(); ! context.point.x -= context.speed; ! context.speed+=this.removalAcceleration(); ! if ((-context.point.x) > context.width) { ! context.point.x = -context.width; m_selected.view().removeFromSuperview(); timer.invalidate(); _addNewItem(timer.userInfo().item); - } else { - m_selected.view().setFrameOrigin(context.point); - updateAfterEvent(); } } --- 122,136 ---- private function _animateOldItem(timer:NSTimer) { ! var info = timer.userInfo(); ! var currentTime = getTimer()-info.startTime; ! if (currentTime > m_tabOutDuration) currentTime = m_tabOutDuration; ! var currentX = m_tabOutEasingFunction.call(null, currentTime, info.startX, info.startX-info.width, m_tabOutDuration); ! if (currentTime == m_tabOutDuration) { ! currentX = info.startX-info.width; m_selected.view().removeFromSuperview(); timer.invalidate(); _addNewItem(timer.userInfo().item); } + m_selected.view().setFrameOrigin(new NSPoint(currentX, info.y)); } *************** *** 121,131 **** selectedView.setFrame(rect); setNeedsDisplay(true); - //window().displayIfNeeded(); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( .005, this, "_animateNewItem", { ! point:rect.origin, ! width: rect.size.width, ! targetX:(rect.origin.x+rect.size.width), ! speed:this.addSpeed() }, true); --- 151,160 ---- selectedView.setFrame(rect); setNeedsDisplay(true); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( .005, this, "_animateNewItem", { ! startX:rect.origin.x, ! y:rect.origin.y, ! width:rect.size.width, ! startTime:getTimer() }, true); *************** *** 141,156 **** private function _animateNewItem(timer:NSTimer) { ! var context = timer.userInfo(); ! context.point.x += context.speed; ! context.speed+=this.addAcceleration(); ! if (context.point.x > context.targetX) { ! context.point.x = context.targetX; ! m_selected.view().setFrameOrigin(context.point); timer.invalidate(); _finish(); - } else { - m_selected.view().setFrameOrigin(context.point); - updateAfterEvent(); } } --- 170,183 ---- private function _animateNewItem(timer:NSTimer) { ! var info = timer.userInfo(); ! var currentTime = getTimer()-info.startTime; ! if (currentTime > m_tabInDuration) currentTime = m_tabInDuration; ! var currentX = m_tabInEasingFunction.call(null, currentTime, info.startX, info.width, m_tabInDuration); ! if (currentTime == m_tabInDuration) { ! currentX = 0; timer.invalidate(); _finish(); } + m_selected.view().setFrameOrigin(new NSPoint(currentX, info.y)); } |
From: Richard K. <ric...@us...> - 2005-07-09 14:56:20
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv907 Modified Files: ASDraw.as Log Message: added easing functions Index: ASDraw.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASDraw.as,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ASDraw.as 29 Jun 2005 06:58:26 -0000 1.13 --- ASDraw.as 9 Jul 2005 14:56:11 -0000 1.14 *************** *** 41,50 **** public static var TRACE_FLAG:Boolean = false; ! public static function setTrace(value:Boolean) { TRACE_FLAG = value; } ! //draws a horizontal line with thickness=1. public static function drawHLine(mc:MovieClip, lineColor:Number, x1:Number, x2:Number, y1:Number) { --- 41,50 ---- public static var TRACE_FLAG:Boolean = false; ! public static function setTrace(value:Boolean) { TRACE_FLAG = value; } ! //draws a horizontal line with thickness=1. public static function drawHLine(mc:MovieClip, lineColor:Number, x1:Number, x2:Number, y1:Number) { *************** *** 1234,1237 **** --- 1234,1414 ---- + // EASING FUNCTIONS USEFUL FOR ANIMATIONS + // Robert Penner - Sept. 2001 - robertpenner.com + + public static function linearTween(t, b, c, d) { + return c*t/d + b; + }; + + + // quadratic easing in - accelerating from zero velocity + public static function easeInQuad(t, b, c, d) { + t /= d; + return c*t*t + b; + }; + + + // quadratic easing out - decelerating to zero velocity + public static function easeOutQuad(t, b, c, d) { + t /= d; + return -c * t*(t-2) + b; + }; + + + + // quadratic easing in/out - acceleration until halfway, then deceleration + public static function easeInOutQuad(t, b, c, d) { + t /= d/2; + if (t < 1) return c/2*t*t + b; + t--; + return -c/2 * (t*(t-2) - 1) + b; + }; + + // cubic easing in - accelerating from zero velocity + public static function easeInCubic(t, b, c, d) { + t /= d; + return c*t*t*t + b; + }; + + + + // cubic easing out - decelerating to zero velocity + public static function easeOutCubic(t, b, c, d) { + t /= d; + t--; + return c*(t*t*t + 1) + b; + }; + + + + // cubic easing in/out - acceleration until halfway, then deceleration + public static function easeInOutCubic(t, b, c, d) { + t /= d/2; + if (t < 1) return c/2*t*t*t + b; + t -= 2; + return c/2*(t*t*t + 2) + b; + }; + + + // quartic easing in - accelerating from zero velocity + public static function easeInQuart(t, b, c, d) { + t /= d; + return c*t*t*t*t + b; + }; + + + + // quartic easing out - decelerating to zero velocity + public static function easeOutQuart(t, b, c, d) { + t /= d; + t--; + return -c * (t*t*t*t - 1) + b; + }; + + + + // quartic easing in/out - acceleration until halfway, then deceleration + public static function easeInOutQuart(t, b, c, d) { + t /= d/2; + if (t < 1) return c/2*t*t*t*t + b; + t -= 2; + return -c/2 * (t*t*t*t - 2) + b; + }; + + + // quintic easing in - accelerating from zero velocity + public static function easeInQuint(t, b, c, d) { + t /= d; + return c*t*t*t*t*t + b; + }; + + + + // quintic easing out - decelerating to zero velocity + public static function easeOutQuint(t, b, c, d) { + t /= d; + t--; + return c*(t*t*t*t*t + 1) + b; + }; + + + + // quintic easing in/out - acceleration until halfway, then deceleration + public static function easeInOutQuint(t, b, c, d) { + t /= d/2; + if (t < 1) return c/2*t*t*t*t*t + b; + t -= 2; + return c/2*(t*t*t*t*t + 2) + b; + }; + + + // sinusoidal easing in - accelerating from zero velocity + public static function easeInSine(t, b, c, d) { + return -c * Math.cos(t/d * (Math.PI/2)) + c + b; + }; + + + + // sinusoidal easing out - decelerating to zero velocity + public static function easeOutSine(t, b, c, d) { + return c * Math.sin(t/d * (Math.PI/2)) + b; + }; + + + + // sinusoidal easing in/out - accelerating until halfway, then decelerating + public static function easeInOutSine(t, b, c, d) { + return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; + }; + + + + // exponential easing in - accelerating from zero velocity + public static function easeInExpo(t, b, c, d) { + return c * Math.pow( 2, 10 * (t/d - 1) ) + b; + }; + + + + // exponential easing out - decelerating to zero velocity + public static function easeOutExpo(t, b, c, d) { + return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b; + }; + + + + // exponential easing in/out - accelerating until halfway, then decelerating + public static function easeInOutExpo(t, b, c, d) { + t /= d/2; + if (t < 1) return c/2 * Math.pow( 2, 10 * (t - 1) ) + b; + t--; + return c/2 * ( -Math.pow( 2, -10 * t) + 2 ) + b; + }; + + + // circular easing in - accelerating from zero velocity + public static function easeInCirc(t, b, c, d) { + t /= d; + return -c * (Math.sqrt(1 - t*t) - 1) + b; + }; + + + + // circular easing out - decelerating to zero velocity + public static function easeOutCirc(t, b, c, d) { + t /= d; + t--; + return c * Math.sqrt(1 - t*t) + b; + }; + + + + // circular easing in/out - acceleration until halfway, then deceleration + public static function easeInOutCirc(t, b, c, d) { + t /= d/2; + if (t < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b; + t -= 2; + return c/2 * (Math.sqrt(1 - t*t) + 1) + b; + }; } \ No newline at end of file |
From: Richard K. <ric...@us...> - 2005-07-09 04:33:43
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4693 Modified Files: ASAnimatedTabView.as Log Message: fixed time, now way more fluid Index: ASAnimatedTabView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAnimatedTabView.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASAnimatedTabView.as 21 Jun 2005 05:12:38 -0000 1.5 --- ASAnimatedTabView.as 9 Jul 2005 04:33:34 -0000 1.6 *************** *** 78,82 **** setNeedsDisplay(true); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( ! .1, this, "_animateOldItem", { item:item, point:m_selected.view().frame().origin.clone(), --- 78,82 ---- setNeedsDisplay(true); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( ! .005, this, "_animateOldItem", { item:item, point:m_selected.view().frame().origin.clone(), *************** *** 123,127 **** //window().displayIfNeeded(); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( ! .1, this, "_animateNewItem", { point:rect.origin, width: rect.size.width, --- 123,127 ---- //window().displayIfNeeded(); NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats( ! .005, this, "_animateNewItem", { point:rect.origin, width: rect.size.width, |
From: Richard K. <ric...@us...> - 2005-07-09 04:32:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4200 Modified Files: ASList.as ASListView.as Log Message: add ability to add multiple items at once, and optimize xml Index: ASListView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASListView.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASListView.as 21 Jun 2005 01:33:09 -0000 1.6 --- ASListView.as 9 Jul 2005 04:32:41 -0000 1.7 *************** *** 104,108 **** var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); var styleText = " ! .s { color: #FFFFFF; font-family: "+m_font.fontName()+"; --- 104,108 ---- var styleSheet:TextField.StyleSheet = new TextField.StyleSheet(); var styleText = " ! s { color: #FFFFFF; font-family: "+m_font.fontName()+"; *************** *** 111,115 **** display: block; } ! .n { color: #"+m_fontColorHex+"; font-family: "+m_font.fontName()+"; --- 111,115 ---- display: block; } ! n { color: #"+m_fontColorHex+"; font-family: "+m_font.fontName()+"; *************** *** 153,159 **** for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { ! m_text += "<span class='s'>"+items[i].label()+"</span><br>"; } else { ! m_text += "<span class='n'>"+items[i].label()+"</span><br>"; } } --- 153,159 ---- for(var i = 0;i < items.length;i++) { if (items[i].isSelected()) { ! m_text += "<s>"+items[i].label()+"</s>"; } else { ! m_text += "<n>"+items[i].label()+"</n>"; } } *************** *** 161,167 **** m_textField._height = m_textField.textHeight+1; } ! ! private function checkTextField(rect:NSRect) { ! if (m_textField == null || m_textField._parent == undefined) { m_textField = createBoundsTextField(); m_textField.border = false; --- 161,168 ---- m_textField._height = m_textField.textHeight+1; } ! ! public function createMovieClips() { ! super.createMovieClips(); ! if (m_mcBounds != null) { m_textField = createBoundsTextField(); m_textField.border = false; *************** *** 176,180 **** m_textField.selectable = false; m_textField.embedFonts = m_font.isEmbedded(); ! m_textField._width = rect.size.width; updateText(); setFrameSize(new NSSize(m_list.frame().size.width, m_textField.textHeight+4)); --- 177,181 ---- m_textField.selectable = false; m_textField.embedFonts = m_font.isEmbedded(); ! m_textField._width = m_list.frame().size.width; updateText(); setFrameSize(new NSSize(m_list.frame().size.width, m_textField.textHeight+4)); *************** *** 198,202 **** public function drawRect(rect:NSRect) { - checkTextField(rect); m_mcBounds.clear(); drawSelectedItems(rect); --- 199,202 ---- Index: ASList.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASList.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASList.as 20 Jun 2005 12:50:05 -0000 1.4 --- ASList.as 9 Jul 2005 04:32:41 -0000 1.5 *************** *** 170,174 **** --- 170,189 ---- return item; } + + public function addItems(items:Array):Void { + for (var i = 0;i < items.length;i++) { + m_internalList.addObject(items[i]); + } + m_listView.computeHeight(); + } + public function addItemsWithLabelsData(labels:Array, data:Array):Void { + var item:ASListItem; + for (var i = 0;i < labels.length;i++) { + m_internalList.addObject(ASListItem.listItemWithLabelData(labels[i], data[i])); + } + m_listView.computeHeight(); + } + /** * Inserts an item into the list. |
From: Tay R. C. <rc...@us...> - 2005-07-08 07:46:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7181/actionstep/org/actionstep Modified Files: NSTextField.as Log Message: textShouldBeginEditing checks isSelectable() before returning false Index: NSTextField.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTextField.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NSTextField.as 1 Jun 2005 03:32:41 -0000 1.8 --- NSTextField.as 8 Jul 2005 07:46:46 -0000 1.9 *************** *** 230,234 **** public function textShouldBeginEditing(editor):Boolean { ! if (!isEditable()) { return false; } --- 230,234 ---- public function textShouldBeginEditing(editor):Boolean { ! if (!(isEditable() || isSelectable())) { return false; } |
From: Tay R. C. <rc...@us...> - 2005-07-08 07:35:30
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2086/actionstep/org/actionstep Modified Files: ASUtils.as Log Message: traces caller value as well Index: ASUtils.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASUtils.as,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ASUtils.as 29 Jun 2005 08:07:59 -0000 1.12 --- ASUtils.as 8 Jul 2005 07:35:21 -0000 1.13 *************** *** 98,102 **** if(f) break; } ! if(!f) TRACE("not found"); } --- 98,102 ---- if(f) break; } ! if(!f) TRACE("not found: "+caller); } |
From: Richard K. <ric...@us...> - 2005-07-08 01:37:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13301 Modified Files: ASRootWindowView.as Log Message: remove unused import Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ASRootWindowView.as 7 Jul 2005 05:33:03 -0000 1.10 --- ASRootWindowView.as 8 Jul 2005 01:36:54 -0000 1.11 *************** *** 33,37 **** import org.actionstep.NSWindow; import org.actionstep.NSRect; - import org.actionstep.NSSize; import org.actionstep.NSFont; import org.actionstep.NSColor; --- 33,36 ---- |
From: Richard K. <ric...@us...> - 2005-07-07 05:33:11
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23483 Modified Files: ASRootWindowView.as Log Message: don't allow reduction less than title size Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ASRootWindowView.as 7 Jul 2005 05:20:09 -0000 1.9 --- ASRootWindowView.as 7 Jul 2005 05:33:03 -0000 1.10 *************** *** 147,151 **** m_resizeRect.origin.x = m_resizeClip._x; m_resizeRect.origin.y = m_resizeClip._y; ! m_titleTextField._x = (m_frame.size.width - (m_titleTextField.textWidth+4))/2; } } --- 147,151 ---- m_resizeRect.origin.x = m_resizeClip._x; m_resizeRect.origin.y = m_resizeClip._y; ! m_titleTextField._x = (m_frame.size.width - (m_titleTextField.textWidth+2))/2; } } *************** *** 383,390 **** return; } ! m_window.setFrame(new NSRect(m_trackingData.origin.x, m_trackingData.origin.y, ! event.mouseLocation.x - m_trackingData.origin.x + m_trackingData.offsetX, ! event.mouseLocation.y - m_trackingData.origin.y + m_trackingData.offsetY ! )); NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "resizeWindowCallback", m_trackingData.eventMask, true); } --- 383,395 ---- return; } ! var width:Number = event.mouseLocation.x - m_trackingData.origin.x + m_trackingData.offsetX; ! var height:Number = event.mouseLocation.y - m_trackingData.origin.y + m_trackingData.offsetY; ! if (width < m_titleTextField.textWidth+30) { ! width = m_titleTextField.textWidth+30; ! } ! if (height < 24) { ! height = 24; ! } ! m_window.setFrame(new NSRect(m_trackingData.origin.x, m_trackingData.origin.y, width, height)); NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "resizeWindowCallback", m_trackingData.eventMask, true); } *************** *** 419,423 **** m_titleTextField.text = m_window.title(); m_titleTextField._y = (22 - (m_titleTextField.textHeight+2))/2;; ! m_titleTextField._x = (width - (m_titleTextField.textWidth+4))/2; } m_titleTextFormat.color = isKey ? m_titleKeyFontColor.value : m_titleFontColor.value; --- 424,428 ---- m_titleTextField.text = m_window.title(); m_titleTextField._y = (22 - (m_titleTextField.textHeight+2))/2;; ! m_titleTextField._x = (width - (m_titleTextField.textWidth+2))/2; } m_titleTextFormat.color = isKey ? m_titleKeyFontColor.value : m_titleFontColor.value; |
From: Richard K. <ric...@us...> - 2005-07-07 05:20:18
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17524 Modified Files: ASRootWindowView.as Log Message: make resize box a box Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ASRootWindowView.as 7 Jul 2005 05:14:42 -0000 1.8 --- ASRootWindowView.as 7 Jul 2005 05:20:09 -0000 1.9 *************** *** 91,94 **** --- 91,103 ---- m_resizeClip = m_mcBounds.createEmptyMovieClip("ResizeClip", 1000000); with(m_resizeClip) { + beginFill(0xFFFFFF, 1); + lineStyle(0, 0xFFFFFF, 1); + moveTo(0,0); + lineTo(10,0); + lineTo(10,10); + lineTo(0,10); + lineTo(0,0); + endFill(); + //da 87 e8 ff lineStyle(1.5, 0xdadada, 100); *************** *** 101,107 **** moveTo(2,10); lineTo(10,2); - lineStyle(1.5, 0xFFFFFF, 0); - moveTo(3,10); - lineTo(10,3); lineStyle(1.5, 0xdadada, 100); --- 110,113 ---- *************** *** 114,120 **** moveTo(6,10); lineTo(10,6); - lineStyle(1.5, 0xFFFFFF, 0); - moveTo(7,10); - lineTo(10,7); lineStyle(1.5, 0xdadada, 100); --- 120,123 ---- |
From: Richard K. <ric...@us...> - 2005-07-07 05:14:58
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14730 Modified Files: ASRootWindowView.as NSWindow.as Log Message: got resize working on windows Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ASRootWindowView.as 6 Jul 2005 19:02:57 -0000 1.7 --- ASRootWindowView.as 7 Jul 2005 05:14:42 -0000 1.8 *************** *** 33,36 **** --- 33,37 ---- import org.actionstep.NSWindow; import org.actionstep.NSRect; + import org.actionstep.NSSize; import org.actionstep.NSFont; import org.actionstep.NSColor; *************** *** 49,52 **** --- 50,54 ---- private var m_window:NSWindow; private var m_titleRect:NSRect; + private var m_resizeRect:NSRect; private var m_trackingData; *************** *** 61,64 **** --- 63,151 ---- private var m_titleFontColor:NSColor; + private var m_resizeClip:MovieClip; + + public function ASRootWindowView() { + m_swfLoading = false; + m_swfLoaded = false; + m_titleRect = new NSRect(0,0,0,22); + m_resizeRect = new NSRect(-11,-11,11,11); + } + + public function initWithFrameWindow(frame:NSRect, window:NSWindow):ASRootWindowView { + initWithFrame(frame); + m_titleFont = NSFont.systemFontOfSize(12); + m_titleKeyFontColor = NSColor.systemFontColor(); + m_titleFontColor = new NSColor(0x666666); + m_titleTextFormat = m_titleFont.textFormat(); + m_titleTextFormat.bold = true; + m_titleTextFormat.color = m_titleKeyFontColor.value; + m_window = window; + setLowerView(highestViewOfLevel()); + return this; + } + + public function createMovieClips() { + super.createMovieClips(); + if (m_mcBounds != null) { + if (m_window.styleMask() & NSWindow.NSResizableWindowMask) { + m_resizeClip = m_mcBounds.createEmptyMovieClip("ResizeClip", 1000000); + with(m_resizeClip) { + //da 87 e8 ff + lineStyle(1.5, 0xdadada, 100); + moveTo(0,10); + lineTo(10,0); + lineStyle(1.5, 0x878787, 100); + moveTo(1,10); + lineTo(10,1); + lineStyle(1.5, 0xe8e8e8, 100); + moveTo(2,10); + lineTo(10,2); + lineStyle(1.5, 0xFFFFFF, 0); + moveTo(3,10); + lineTo(10,3); + + lineStyle(1.5, 0xdadada, 100); + moveTo(4,10); + lineTo(10,4); + lineStyle(1.5, 0x878787, 100); + moveTo(5,10); + lineTo(10,5); + lineStyle(1.5, 0xe8e8e8, 100); + moveTo(6,10); + lineTo(10,6); + lineStyle(1.5, 0xFFFFFF, 0); + moveTo(7,10); + lineTo(10,7); + + lineStyle(1.5, 0xdadada, 100); + moveTo(8,10); + lineTo(10,8); + lineStyle(1.5, 0x878787, 100); + moveTo(9,10); + lineTo(10,9); + lineStyle(1.5, 0xe8e8e8, 100); + moveTo(10,10); + lineTo(10,10); + } + m_resizeClip.view = this; + m_resizeClip._x = m_frame.size.width-12; + m_resizeClip._y = m_frame.size.height-12; + m_resizeRect.origin.x = m_resizeClip._x; + m_resizeRect.origin.y = m_resizeClip._y; + } + } + } + + private function updateFrameMovieClipSize():Void { + super.updateFrameMovieClipSize(); + if (m_mcFrame != null) { + m_resizeClip._x = m_frame.size.width-12; + m_resizeClip._y = m_frame.size.height-12; + m_resizeRect.origin.x = m_resizeClip._x; + m_resizeRect.origin.y = m_resizeClip._y; + m_titleTextField._x = (m_frame.size.width - (m_titleTextField.textWidth+4))/2; + } + } + public static function lowestView():ASRootWindowView { return g_lowestView; *************** *** 94,116 **** } - public function ASRootWindowView() { - m_swfLoading = false; - m_swfLoaded = false; - m_titleRect = new NSRect(0,0,0,22); - } - - public function initWithFrameWindow(frame:NSRect, window:NSWindow):ASRootWindowView { - initWithFrame(frame); - m_titleFont = NSFont.systemFontOfSize(12); - m_titleKeyFontColor = NSColor.systemFontColor(); - m_titleFontColor = new NSColor(0x666666); - m_titleTextFormat = m_titleFont.textFormat(); - m_titleTextFormat.bold = true; - m_titleTextFormat.color = m_titleKeyFontColor.value; - m_window = window; - setLowerView(highestViewOfLevel()); - return this; - } - public function level():Number { return m_window.level(); --- 181,184 ---- *************** *** 268,271 **** --- 336,342 ---- dragWindow(event); } + if(m_resizeRect.pointInRect(location)) { + resizeWindow(event); + } } *************** *** 290,293 **** --- 361,389 ---- NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "dragWindowCallback", m_trackingData.eventMask, true); } + + private function resizeWindow(event:NSEvent) { + var frame:NSRect = frame(); + m_trackingData = { + origin: frame.origin, + offsetX: frame.origin.x + frame.size.width - event.mouseLocation.x, + offsetY: frame.origin.y + frame.size.height - event.mouseLocation.y, + mouseDown: true, + eventMask: NSEvent.NSLeftMouseDownMask | NSEvent.NSLeftMouseUpMask | NSEvent.NSLeftMouseDraggedMask + | NSEvent.NSMouseMovedMask | NSEvent.NSOtherMouseDraggedMask | NSEvent.NSRightMouseDraggedMask, + complete: false, + }; + resizeWindowCallback(event); + } + + public function resizeWindowCallback(event:NSEvent) { + if (event.type == NSEvent.NSLeftMouseUp) { + return; + } + m_window.setFrame(new NSRect(m_trackingData.origin.x, m_trackingData.origin.y, + event.mouseLocation.x - m_trackingData.origin.x + m_trackingData.offsetX, + event.mouseLocation.y - m_trackingData.origin.y + m_trackingData.offsetY + )); + NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "resizeWindowCallback", m_trackingData.eventMask, true); + } public function drawRect(rect:NSRect) { Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NSWindow.as 6 Jul 2005 19:02:57 -0000 1.17 --- NSWindow.as 7 Jul 2005 05:14:42 -0000 1.18 *************** *** 239,242 **** --- 239,245 ---- if (m_contentRect.size.width != cRect.size.width || m_contentRect.size.height != cRect.size.height) { m_contentView.setFrameSize(cRect.size); + m_contentView.setNeedsDisplay(true); + m_rootView.setFrameSize(frame.size); + m_rootView.setNeedsDisplay(true); } m_contentRect = cRect; *************** *** 254,257 **** --- 257,261 ---- m_contentRect.size.height = size.height; m_frameRect = frameRectForContentRect(); + m_rootView.setFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size)); m_contentView.setFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size)); } |
From: Richard K. <ric...@us...> - 2005-07-07 05:14:58
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14730/test Modified Files: ASTestWindowStyles.as Log Message: got resize working on windows Index: ASTestWindowStyles.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestWindowStyles.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ASTestWindowStyles.as 6 Jul 2005 18:30:19 -0000 1.3 --- ASTestWindowStyles.as 7 Jul 2005 05:14:49 -0000 1.4 *************** *** 23,27 **** } target.createNormalWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(40,25,200,200), NSWindow.NSTitledWindowMask); window.setTitle("Normal Window"); view = new ASTestView(); --- 23,27 ---- } target.createNormalWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(40,25,200,200), NSWindow.NSTitledWindowMask | NSWindow.NSResizableWindowMask); window.setTitle("Normal Window"); view = new ASTestView(); *************** *** 32,36 **** } target.createTopWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(80,25,100,100), NSWindow.NSTitledWindowMask); window.setTitle("Top Window"); view = new ASTestView(); --- 32,36 ---- } target.createTopWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(80,25,100,100), NSWindow.NSTitledWindowMask | NSWindow.NSResizableWindowMask); window.setTitle("Top Window"); view = new ASTestView(); *************** *** 45,53 **** var window4:NSWindow; var view4:ASTestView; ! window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(200,200,200,200), NSWindow.NSTitledWindowMask); window4.setTitle("Higher level window"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); ! view4.setBackgroundColor(new NSColor(0xDD55DD)); window4.setContentView(view4); --- 45,53 ---- var window4:NSWindow; var view4:ASTestView; ! window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(200,200,200,200), NSWindow.NSTitledWindowMask | NSWindow.NSResizableWindowMask); window4.setTitle("Higher level window"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); ! //view4.setBackgroundColor(new NSColor(0xDD55DD)); window4.setContentView(view4); |
From: Richard K. <ric...@us...> - 2005-07-06 19:03:07
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12238 Modified Files: NSApplication.as NSWindow.as ASRootWindowView.as Log Message: key windows now working (title's change based on key) Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASRootWindowView.as 6 Jul 2005 18:30:18 -0000 1.6 --- ASRootWindowView.as 6 Jul 2005 19:02:57 -0000 1.7 *************** *** 56,60 **** --- 56,62 ---- private var m_titleTextField:TextField; + private var m_titleTextFormat:TextFormat; private var m_titleFont:NSFont; + private var m_titleKeyFontColor:NSColor; private var m_titleFontColor:NSColor; *************** *** 101,105 **** initWithFrame(frame); m_titleFont = NSFont.systemFontOfSize(12); ! m_titleFontColor = NSColor.systemFontColor(); m_window = window; setLowerView(highestViewOfLevel()); --- 103,111 ---- initWithFrame(frame); m_titleFont = NSFont.systemFontOfSize(12); ! m_titleKeyFontColor = NSColor.systemFontColor(); ! m_titleFontColor = new NSColor(0x666666); ! m_titleTextFormat = m_titleFont.textFormat(); ! m_titleTextFormat.bold = true; ! m_titleTextFormat.color = m_titleKeyFontColor.value; m_window = window; setLowerView(highestViewOfLevel()); *************** *** 292,296 **** } ! var fillColors:Array = [0xFFFFFF, 0xDEDEDE, 0xC6C6C6]; var fillAlpha:Number = 100; var cornerRadius:Number = 4; --- 298,304 ---- } ! var isKey:Boolean = m_window.isKeyWindow(); ! ! var fillColors:Array = isKey ? [0xFFFFFF, 0xDEDEDE, 0xC6C6C6] : [0xFFFFFF, 0xDEDEDE, 0xFFFFFF]; var fillAlpha:Number = 100; var cornerRadius:Number = 4; *************** *** 311,321 **** if (m_titleTextField.text != m_window.title()) { m_titleTextField.text = m_window.title(); - var textFormat = m_titleFont.textFormat(); - textFormat.bold = true; - textFormat.color = m_titleFontColor.value; - m_titleTextField.setTextFormat(textFormat); m_titleTextField._y = (22 - (m_titleTextField.textHeight+2))/2;; m_titleTextField._x = (width - (m_titleTextField.textWidth+4))/2; } var totalHeight = rect.size.height-1; --- 319,327 ---- if (m_titleTextField.text != m_window.title()) { m_titleTextField.text = m_window.title(); m_titleTextField._y = (22 - (m_titleTextField.textHeight+2))/2;; m_titleTextField._x = (width - (m_titleTextField.textWidth+4))/2; } + m_titleTextFormat.color = isKey ? m_titleKeyFontColor.value : m_titleFontColor.value; + m_titleTextField.setTextFormat(m_titleTextFormat); var totalHeight = rect.size.height-1; Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NSApplication.as 6 Jul 2005 17:27:51 -0000 1.18 --- NSApplication.as 6 Jul 2005 19:02:56 -0000 1.19 *************** *** 106,111 **** public function setKeyWindow(value:NSWindow) { m_keyWindow = value; - value.makeKeyWindow(); } --- 106,111 ---- public function setKeyWindow(value:NSWindow) { + value.makeKeyWindow(); m_keyWindow = value; } *************** *** 115,120 **** public function setMainWindow(value:NSWindow) { m_mainWindow = value; - value.makeMainWindow(); } --- 115,120 ---- public function setMainWindow(value:NSWindow) { + value.makeMainWindow(); m_mainWindow = value; } *************** *** 172,176 **** try { if (event.type == NSEvent.NSLeftMouseDown) { ! m_currentEvent.window.makeKeyAndOrderFront(); } m_currentEvent.window.sendEvent(m_currentEvent); --- 172,177 ---- try { if (event.type == NSEvent.NSLeftMouseDown) { ! m_currentEvent.window.orderFront(); ! setKeyWindow(m_currentEvent.window); } m_currentEvent.window.sendEvent(m_currentEvent); Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NSWindow.as 6 Jul 2005 17:28:51 -0000 1.16 --- NSWindow.as 6 Jul 2005 19:02:57 -0000 1.17 *************** *** 99,104 **** private var m_title:String; ! private var m_keyWin:Number; ! private var m_mainWin:Number; private var m_isKey:Boolean; --- 99,104 ---- private var m_title:String; ! //private var m_keyWin:Number; ! //private var m_mainWin:Number; private var m_isKey:Boolean; *************** *** 121,133 **** m_level = NSNormalWindowLevel; m_windowNumber = g_instances.length; ! var x = m_windowNumber; ! if(m_keyWin==null) { ! m_keyWin = x; m_app.setKeyWindow(this); ! } ! if(m_mainWin==null) { ! m_mainWin = x; m_app.setMainWindow(this); ! } } --- 121,133 ---- m_level = NSNormalWindowLevel; m_windowNumber = g_instances.length; ! //var x = m_windowNumber; ! //if(m_keyWin==null) { ! //m_keyWin = x; m_app.setKeyWindow(this); ! //} ! //if(m_mainWin==null) { ! //m_mainWin = x; m_app.setMainWindow(this); ! //} } *************** *** 324,327 **** --- 324,328 ---- if (!m_isKey) { m_isKey = true; + m_rootView.setNeedsDisplay(true); if (m_firstResponder == null || m_firstResponder == this) { if (m_initialFirstResponder != null) { *************** *** 363,366 **** --- 364,368 ---- } m_isKey = false; + m_rootView.setNeedsDisplay(true); m_notificationCenter.postNotificationWithNameObject(NSWindowDidResignKeyNotification, this); } |
From: Richard K. <ric...@us...> - 2005-07-06 18:30:28
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27413/test Modified Files: ASTestWindowStyles.as Log Message: got dynamic creation with levels working Index: ASTestWindowStyles.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestWindowStyles.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTestWindowStyles.as 6 Jul 2005 17:32:24 -0000 1.2 --- ASTestWindowStyles.as 6 Jul 2005 18:30:19 -0000 1.3 *************** *** 6,36 **** public static function test() { var app:NSApplication = NSApplication.sharedApplication(); ! var window1:NSWindow; ! var view1:ASTestView; ! window1 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(50,50,200,200), NSWindow.NSTitledWindowMask); ! window1.setTitle("My Window 1"); ! view1 = new ASTestView(); ! view1.initWithFrame(new NSRect(0,0,20,20)); ! view1.setBackgroundColor(new NSColor(0xDD5555)) ! window1.setContentView(view1); ! var window2:NSWindow; ! var view2:ASTestView; ! window2 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(100,100,200,200), NSWindow.NSTitledWindowMask); ! window2.setTitle("My Window 2"); ! view2 = new ASTestView(); ! view2.initWithFrame(new NSRect(0,0,20,20)); ! view2.setBackgroundColor(new NSColor(0x5555DD)) ! window2.setContentView(view2); ! ! var window3:NSWindow; ! var view3:ASTestView; ! window3 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(150,150,200,200), NSWindow.NSTitledWindowMask); ! window3.setTitle("My Window 3"); ! view3 = new ASTestView(); ! view3.initWithFrame(new NSRect(0,0,20,20)); ! view3.setBackgroundColor(new NSColor(0x55DDDD)) ! window3.setContentView(view3); var window4:NSWindow; --- 6,45 ---- public static function test() { var app:NSApplication = NSApplication.sharedApplication(); + + var window:NSWindow; + var view:ASTestView; + + var target = new Object(); + target.createDesktopWindow = function(button) { + window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(80,25,200,200), NSWindow.NSTitledWindowMask); + window.setTitle("Desktop Window"); + view = new ASTestView(); + view.initWithFrame(new NSRect(0,0,20,20)); + view.setBackgroundColor(new NSColor(0xDDDD55)); + window.setContentView(view); + window.display(); + window.setLevel(NSWindow.NSDesktopWindowLevel); ! } ! target.createNormalWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(40,25,200,200), NSWindow.NSTitledWindowMask); ! window.setTitle("Normal Window"); ! view = new ASTestView(); ! view.initWithFrame(new NSRect(0,0,20,20)); ! view.setBackgroundColor(new NSColor(0x55DD55)); ! window.setContentView(view); ! window.display(); ! } ! target.createTopWindow = function(button) { ! window = (new NSWindow()).initWithContentRectStyleMask(new NSRect(80,25,100,100), NSWindow.NSTitledWindowMask); ! window.setTitle("Top Window"); ! view = new ASTestView(); ! view.initWithFrame(new NSRect(0,0,20,20)); ! view.setBackgroundColor(new NSColor(0x55DDFF)); ! window.setContentView(view); ! window.display(); ! window.setLevel(NSWindow.NSModalPanelWindowLevel); ! } var window4:NSWindow; *************** *** 44,47 **** --- 53,74 ---- window4.setLevel(NSWindow.NSStatusWindowLevel); + + var button1 = (new NSButton()).initWithFrame(new NSRect(10,10,150,30)); + button1.setTitle("Create Desktop Window"); + view4.addSubview(button1); + button1.setTarget(target); + button1.setAction("createDesktopWindow"); + + var button2 = (new NSButton()).initWithFrame(new NSRect(10,50,150,30)); + button2.setTitle("Create Normal Window"); + view4.addSubview(button2); + button2.setTarget(target); + button2.setAction("createNormalWindow"); + + var button3 = (new NSButton()).initWithFrame(new NSRect(10,90,150,30)); + button3.setTitle("Create Top Window"); + view4.addSubview(button3); + button3.setTarget(target); + button3.setAction("createTopWindow"); app.run(); |
From: Richard K. <ric...@us...> - 2005-07-06 18:30:28
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27413 Modified Files: ASRootWindowView.as Log Message: got dynamic creation with levels working Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASRootWindowView.as 6 Jul 2005 17:28:51 -0000 1.5 --- ASRootWindowView.as 6 Jul 2005 18:30:18 -0000 1.6 *************** *** 78,81 **** --- 78,84 ---- view = view.higherView(); } + if (view.level() > level()) { + view = null; + } return view; } *************** *** 178,183 **** private function createFrameMovieClip() { var self = this; ! m_mcFrame = _root.createEmptyMovieClip("ASRootWindowView"+m_window.windowNumber(), m_targetDepth); _root["ASRootWindowView"+m_window.windowNumber()].window = m_window; m_mcFrame.onEnterFrame = function() { self.m_window.displayIfNeeded(); --- 181,191 ---- private function createFrameMovieClip() { var self = this; ! var depth = m_targetDepth; ! if (_root.getInstanceAtDepth(depth) != null) { ! depth = m_window.windowNumber()+100; ! } ! m_mcFrame = _root.createEmptyMovieClip("ASRootWindowView"+m_window.windowNumber(), depth); _root["ASRootWindowView"+m_window.windowNumber()].window = m_window; + matchDepth(); m_mcFrame.onEnterFrame = function() { self.m_window.displayIfNeeded(); |
From: Richard K. <ric...@us...> - 2005-07-06 17:32:33
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28576/test Modified Files: ASTestWindowStyles.as Log Message: change title Index: ASTestWindowStyles.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestWindowStyles.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestWindowStyles.as 6 Jul 2005 17:29:30 -0000 1.1 --- ASTestWindowStyles.as 6 Jul 2005 17:32:24 -0000 1.2 *************** *** 37,47 **** var view4:ASTestView; window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(200,200,200,200), NSWindow.NSTitledWindowMask); ! window4.setTitle("My Window 4"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); ! view4.setBackgroundColor(new NSColor(0xDD55DD)) window4.setContentView(view4); ! window3.setLevel(NSWindow.NSStatusWindowLevel); app.run(); --- 37,47 ---- var view4:ASTestView; window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(200,200,200,200), NSWindow.NSTitledWindowMask); ! window4.setTitle("Higher level window"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); ! view4.setBackgroundColor(new NSColor(0xDD55DD)); window4.setContentView(view4); ! window4.setLevel(NSWindow.NSStatusWindowLevel); app.run(); |
From: Richard K. <ric...@us...> - 2005-07-06 17:29:40
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26823/test Added Files: ASTestWindowStyles.as Log Message: test for window levels/title bars --- NEW FILE: ASTestWindowStyles.as --- import org.actionstep.*; import org.actionstep.test.ASTestView; class org.actionstep.test.ASTestWindowStyles { public static function test() { var app:NSApplication = NSApplication.sharedApplication(); var window1:NSWindow; var view1:ASTestView; window1 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(50,50,200,200), NSWindow.NSTitledWindowMask); window1.setTitle("My Window 1"); view1 = new ASTestView(); view1.initWithFrame(new NSRect(0,0,20,20)); view1.setBackgroundColor(new NSColor(0xDD5555)) window1.setContentView(view1); var window2:NSWindow; var view2:ASTestView; window2 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(100,100,200,200), NSWindow.NSTitledWindowMask); window2.setTitle("My Window 2"); view2 = new ASTestView(); view2.initWithFrame(new NSRect(0,0,20,20)); view2.setBackgroundColor(new NSColor(0x5555DD)) window2.setContentView(view2); var window3:NSWindow; var view3:ASTestView; window3 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(150,150,200,200), NSWindow.NSTitledWindowMask); window3.setTitle("My Window 3"); view3 = new ASTestView(); view3.initWithFrame(new NSRect(0,0,20,20)); view3.setBackgroundColor(new NSColor(0x55DDDD)) window3.setContentView(view3); var window4:NSWindow; var view4:ASTestView; window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(200,200,200,200), NSWindow.NSTitledWindowMask); window4.setTitle("My Window 4"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); view4.setBackgroundColor(new NSColor(0xDD55DD)) window4.setContentView(view4); window3.setLevel(NSWindow.NSStatusWindowLevel); app.run(); } } |
From: Richard K. <ric...@us...> - 2005-07-06 17:29:02
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26496 Modified Files: NSWindow.as ASRootWindowView.as Log Message: added code for window levels and title bars Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASRootWindowView.as 21 Jun 2005 03:22:33 -0000 1.4 --- ASRootWindowView.as 6 Jul 2005 17:28:51 -0000 1.5 *************** *** 30,34 **** --- 30,40 ---- import org.actionstep.NSView; + import org.actionstep.NSApplication; + import org.actionstep.NSWindow; import org.actionstep.NSRect; + import org.actionstep.NSFont; + import org.actionstep.NSColor; + import org.actionstep.NSPoint; + import org.actionstep.NSEvent; class org.actionstep.ASRootWindowView extends NSView { *************** *** 36,58 **** // Static Functions ! var m_contentRect:NSRect; ! var m_swfLoading:Boolean; ! var m_swfLoaded:Boolean; public function ASRootWindowView() { m_swfLoading = false; m_swfLoaded = false; } ! public function initWithFrameWindow(frame, window):ASRootWindowView { initWithFrame(frame); m_window = window; return this; } 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(); --- 42,183 ---- // Static Functions ! private static var g_lowestView:ASRootWindowView = null; ! ! private var m_contentRect:NSRect; ! private var m_swfLoading:Boolean; ! private var m_swfLoaded:Boolean; ! private var m_window:NSWindow; ! private var m_titleRect:NSRect; ! private var m_trackingData; ! ! private var m_lowerView:ASRootWindowView; ! private var m_higherView:ASRootWindowView; ! private var m_targetDepth:Number; ! ! private var m_titleTextField:TextField; ! private var m_titleFont:NSFont; ! private var m_titleFontColor:NSColor; ! ! public static function lowestView():ASRootWindowView { ! return g_lowestView; ! } ! ! public function dump(view:ASRootWindowView) { ! if(view == null) view = g_lowestView; ! TRACE(view.lowerView().window().windowNumber()+" - "+view.window().windowNumber()+" - "+view.higherView().window().windowNumber()); ! if(view.higherView() != null) { ! dump(view.higherView()); ! } else { ! TRACE("---"); ! } ! } ! ! public function highestViewOfLevel():ASRootWindowView { ! var view:ASRootWindowView = g_lowestView; ! while(view.higherView() != null && view.higherView().level()<=level()) { ! view = view.higherView(); ! } ! return view; ! } ! ! public function lowestViewOfLevel():ASRootWindowView { ! var view:ASRootWindowView = g_lowestView; ! while(view != null && view.level()>=level()) { ! view = view.higherView(); ! } ! return view; ! } public function ASRootWindowView() { m_swfLoading = false; m_swfLoaded = false; + m_titleRect = new NSRect(0,0,0,22); } ! public function initWithFrameWindow(frame:NSRect, window:NSWindow):ASRootWindowView { initWithFrame(frame); + m_titleFont = NSFont.systemFontOfSize(12); + m_titleFontColor = NSColor.systemFontColor(); m_window = window; + setLowerView(highestViewOfLevel()); return this; } + public function level():Number { + return m_window.level(); + } + + public function setHigherView(view:ASRootWindowView) { + m_higherView = view; + } + + public function higherView():ASRootWindowView { + return m_higherView; + } + + public function setLowerView(view:ASRootWindowView) { + if (view == null) { + if (g_lowestView != null) { + g_lowestView.setLowerView(this); + } + m_lowerView = view; + g_lowestView = this; + } else { + if (view != m_lowerView) { + m_lowerView = view; + view.higherView().setLowerView(this); + view.setHigherView(this); + } + } + setTargetDepths(); + } + + public function setTargetDepths() { + var view:ASRootWindowView = g_lowestView; + var i = 100; + view.setTargetDepth(i++); + while(view.higherView() != null) { + view.higherView().setTargetDepth(i++); + view = view.higherView(); + } + } + + public function setTargetDepth(depth:Number) { + m_targetDepth = depth; + } + + public function extractView() { + var lower:ASRootWindowView = m_lowerView; + var higher:ASRootWindowView = m_higherView; + m_higherView = null; + m_lowerView = null; + if (g_lowestView == this) { + g_lowestView = higher; + higher.m_lowerView = null; + return; + } + higher.m_lowerView = lower; + lower.m_higherView = higher; + } + + public function lowerView():ASRootWindowView { + return m_lowerView; + } + + public function matchDepth() { + if (m_mcFrame == null) { + return; + } + var oldDepth:Number = m_mcFrame.getDepth(); + if (m_targetDepth != oldDepth) { + m_mcFrame.swapDepths(m_targetDepth); + _root.getInstanceAtDepth(oldDepth).view.matchDepth(); + } + } + private function createFrameMovieClip() { var self = this; ! m_mcFrame = _root.createEmptyMovieClip("ASRootWindowView"+m_window.windowNumber(), m_targetDepth); ! _root["ASRootWindowView"+m_window.windowNumber()].window = m_window; m_mcFrame.onEnterFrame = function() { self.m_window.displayIfNeeded(); *************** *** 119,124 **** --- 244,335 ---- } } + + public function mouseDown(event:NSEvent) { + if (m_window.styleMask() == NSWindow.NSBorderlessWindowMask) { + return; + } + var location:NSPoint = event.mouseLocation; + location = convertPointFromView(location); + if(m_titleRect.pointInRect(location)) { + dragWindow(event); + } + } + + private function dragWindow(event:NSEvent) { + var point:NSPoint = convertPointFromView(event.mouseLocation, null); + m_trackingData = { + offsetX: point.x, + offsetY: point.y, + mouseDown: true, + eventMask: NSEvent.NSLeftMouseDownMask | NSEvent.NSLeftMouseUpMask | NSEvent.NSLeftMouseDraggedMask + | NSEvent.NSMouseMovedMask | NSEvent.NSOtherMouseDraggedMask | NSEvent.NSRightMouseDraggedMask, + complete: false, + }; + dragWindowCallback(event); + } + public function dragWindowCallback(event:NSEvent) { + if (event.type == NSEvent.NSLeftMouseUp) { + return; + } + m_window.setFrameOrigin(new NSPoint(event.mouseLocation.x - m_trackingData.offsetX, event.mouseLocation.y - m_trackingData.offsetY)); + NSApplication.sharedApplication().callObjectSelectorWithNextEventMatchingMaskDequeue(this, "dragWindowCallback", m_trackingData.eventMask, true); + } + public function drawRect(rect:NSRect) { + m_mcBounds.clear(); + var styleMask:Number = m_window.styleMask(); + if (styleMask == NSWindow.NSBorderlessWindowMask) { + return; + } + + var fillColors:Array = [0xFFFFFF, 0xDEDEDE, 0xC6C6C6]; + var fillAlpha:Number = 100; + var cornerRadius:Number = 4; + var x = rect.origin.x; + var y = rect.origin.y; + var width = rect.size.width-1; + var height = 22; + m_titleRect.size.width = width; + + if (m_titleTextField == null || m_titleTextField._parent == null) { + m_titleTextField = createBoundsTextField(); + m_titleTextField.autoSize = true; + m_titleTextField.align = "center"; + m_titleTextField.selectable = false; + m_titleTextField._alpha = m_titleFontColor.alphaComponent()*100; + m_titleTextField.embedFonts = m_titleFont.isEmbedded(); + } + if (m_titleTextField.text != m_window.title()) { + m_titleTextField.text = m_window.title(); + var textFormat = m_titleFont.textFormat(); + textFormat.bold = true; + textFormat.color = m_titleFontColor.value; + m_titleTextField.setTextFormat(textFormat); + m_titleTextField._y = (22 - (m_titleTextField.textHeight+2))/2;; + m_titleTextField._x = (width - (m_titleTextField.textWidth+4))/2; + } + + var totalHeight = rect.size.height-1; + with (m_mcBounds) { + lineStyle(1.5, 0x8E8E8E, 100); + beginGradientFill("linear", fillColors, [100,100,100], [0, 50, 255], + {matrixType:"box", x:x,y:y,w:width,h:height,r:(.5*Math.PI)}); + moveTo(x+cornerRadius, y); + lineTo(x+width-cornerRadius, y); + lineTo(x+width, y+cornerRadius); //Angle + lineTo(x+width, y+height); + lineStyle(1.5, 0x6E6E6E, 100); + lineTo(x, y+height); + lineStyle(1.5, 0x8E8E8E, 100); + lineTo(x, y+cornerRadius); + lineTo(x+cornerRadius, y); //Angle + endFill(); + moveTo(x, y+height); + lineStyle(1.5, 0x8E8E8E, 100); + lineTo(x, y+totalHeight); + lineTo(x+width, y+totalHeight); + lineTo(x+width, y+height); + } } Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NSWindow.as 24 Jun 2005 02:21:17 -0000 1.15 --- NSWindow.as 6 Jul 2005 17:28:51 -0000 1.16 *************** *** 70,74 **** private static var g_instances:Array = new Array(); - private static var g_zOrder:Array = new Array(); public static function instances():Array { --- 70,73 ---- *************** *** 115,118 **** --- 114,118 ---- m_viewsNeedDisplay = true; m_fieldEditor= ASFieldEditor.instance(); + m_title = ""; m_isKey = false; m_isMain = false; *************** *** 172,183 **** } ! public function contentRectForFrameRect():NSRect { //! Based on style masks reshape? ! return m_frameRect.clone(); } public function frameRectForContentRect():NSRect { ! //! Based on style masks reshape? ! return m_contentRect.clone(); } --- 172,219 ---- } ! // Calculating layout ! ! public function contentRectForFrameRectStyleMask(styleMask:Number):NSRect { ! var rect:NSRect = m_frameRect.clone(); ! if (styleMask == NSBorderlessWindowMask) { ! return rect; ! } ! if (styleMask & NSTitledWindowMask) { ! rect.origin.y += 23; ! rect.size.height -= 24; ! rect.origin.x += 1; ! rect.size.width -= 2; ! } ! return rect; ! } ! ! public function frameRectForContentRectStyleMask(styleMask:Number):NSRect { ! var rect:NSRect = m_contentRect.clone(); ! if (styleMask == NSBorderlessWindowMask) { ! return rect; ! } ! /* ! public static var NSBorderlessWindowMask = 0 ! public static var NSTitledWindowMask = 1 ! public static var NSClosableWindowMask = 2 ! public static var NSMiniaturizableWindowMask = 4 ! public static var NSResizableWindowMask = 8 ! */ //! Based on style masks reshape? ! if (styleMask & NSTitledWindowMask) { ! rect.origin.y -= 23; ! rect.size.height += 24; ! rect.origin.x -= 1; ! rect.size.width += 2; ! } ! return rect; ! } ! ! public function contentRectForFrameRect():NSRect { ! return contentRectForFrameRectStyleMask(m_styleMask); } public function frameRectForContentRect():NSRect { ! return frameRectForContentRectStyleMask(m_styleMask); } *************** *** 222,261 **** // 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; ! } ! } } --- 258,276 ---- // Ordering Windows + + public function rootView():ASRootWindowView { + return m_rootView; + } public function orderBack(sender:Object) { ! m_rootView.extractView(); ! m_rootView.lowestViewOfLevel().setLowerView(m_rootView); ! m_rootView.matchDepth(); } public function orderFront(sender:Object) { ! m_rootView.extractView(); ! m_rootView.setLowerView(m_rootView.highestViewOfLevel()); ! m_rootView.matchDepth(); } *************** *** 269,293 **** 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(); --- 284,306 ---- public function orderWindowRelativeTo(positioned:NSWindowOrderingMode, windowNumber:Number) { ! var windowRoot:ASRootWindowView = g_instances[windowNumber].rootView(); ! switch(positioned) { ! case NSWindowOrderingMode.NSWindowAbove: ! m_rootView.extractView(); ! m_rootView.setLowerView(windowRoot); ! m_rootView.matchDepth(); ! break; ! case NSWindowOrderingMode.NSWindowBelow: ! m_rootView.extractView(); ! windowRoot.setLowerView(m_rootView); ! m_rootView.matchDepth(); ! break; ! case NSWindowOrderingMode.NSWindowOut: ! //! How to handle this? ! break; } } public function setLevel(newLevel:Number) { m_level = newLevel; orderFront(); *************** *** 334,338 **** public function makeKeyAndOrderFront() { makeKeyWindow(); ! //! Order front } --- 347,351 ---- public function makeKeyAndOrderFront() { makeKeyWindow(); ! orderFront(this); } *************** *** 496,501 **** m_contentView = view; m_rootView.setContentView(m_contentView); m_contentView.setNextResponder(this); - m_rootView.displayIfNeeded(); } --- 509,514 ---- m_contentView = view; m_rootView.setContentView(m_contentView); + m_contentView.setFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size)); m_contentView.setNextResponder(this); } |
From: Richard K. <ric...@us...> - 2005-07-06 17:27:59
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25891 Modified Files: NSApplication.as Log Message: on mouse down set key window and bring to front Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NSApplication.as 24 Jun 2005 02:08:08 -0000 1.17 --- NSApplication.as 6 Jul 2005 17:27:51 -0000 1.18 *************** *** 166,175 **** ASFieldEditor.instance().regainFocus(); } - /* // updates are now done in ASRootWindowView - if (event.window == undefined) { - updateWindowsIfNeeded(); - } else { - event.window.displayIfNeeded(); - }*/ return; } --- 166,169 ---- *************** *** 177,180 **** --- 171,177 ---- //! What else to do here? try { + if (event.type == NSEvent.NSLeftMouseDown) { + m_currentEvent.window.makeKeyAndOrderFront(); + } m_currentEvent.window.sendEvent(m_currentEvent); } catch (e:Error) { *************** *** 183,192 **** 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(); ! }*/ } --- 180,184 ---- if (event.type == NSEvent.NSLeftMouseUp && ASFieldEditor.instance().isEditing()) { ASFieldEditor.instance().regainFocus(); ! } } |
From: Tay R. C. <rc...@us...> - 2005-06-30 09:42:19
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28968/actionstep/org/actionstep/test Modified Files: ASTestModal.as Log Message: changed class name Index: ASTestModal.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestModal.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTestModal.as 24 Jun 2005 02:06:03 -0000 1.2 --- ASTestModal.as 30 Jun 2005 09:42:10 -0000 1.3 *************** *** 1,118 **** ! /* ! * 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.*; ! import org.actionstep.test.*; ! 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)); ! ! view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,500,500)); ! view1.setBorderColor(new NSColor(0xFFF000)); ! view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,250)); ! 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); ! window2.setContentView(view2); ! view2.setHidden(true); ! ! app.run(); ! } ! ! //tracking starts before modal can start posing! ! public static function trigger(button) { ! TRACE("Starting modal loop..."); ! window1.resignKeyWindow(); ! view2.setHidden(false); ! ! app.runModalForWindow(window2, self, "modal"); ! } ! ! 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 --- 1,121 ---- ! /* ! * 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.*; ! import org.actionstep.test.*; ! import org.actionstep.constants.* ! ! class org.actionstep.test.ASTestModal { ! public static var ! self = ASTestModal, ! 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(50,50,250,250)); ! window2 = (new NSWindow()).initWithContentRect(new NSRect(125,100,250,250)); ! ! window1.orderFront(); ! window2.orderBack(); ! ! view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,250)); ! view1.setBorderColor(new NSColor(0xFFF000)); ! view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,250)); ! 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); ! window2.setContentView(view2); ! //view2.setHidden(true); ! ! app.run(); ! } ! ! //tracking starts before modal can start posing! ! public static function trigger(button) { ! TRACE("Starting modal loop..."); ! window1.resignKeyWindow(); ! view2.setHidden(false); ! ! app.runModalForWindow(window2, self, "modal"); ! } ! ! 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: Scott H. <sco...@us...> - 2005-06-29 08:16:23
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9089/src/org/actionstep Modified Files: ASStringFormatter.as Log Message: Added an arg check for null, so we don't continue formatting unnecessarily. Index: ASStringFormatter.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASStringFormatter.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASStringFormatter.as 29 Jun 2005 08:12:41 -0000 1.2 --- ASStringFormatter.as 29 Jun 2005 08:16:11 -0000 1.3 *************** *** 160,163 **** --- 160,167 ---- arg = en.nextObject(); // Get argument to format + + if (arg == null) // We can't do anything else if there are no more args. + break; + precision = parseInt(format.substring(precisionstart + 1, end)); // extract precision fstr = g_types[format.charAt(end)](flags, parseInt(width), width.charAt(0) == "0", precision, arg); |
From: Scott H. <sco...@us...> - 2005-06-29 08:12:58
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7758/src/org/actionstep Modified Files: ASStringFormatter.as Log Message: Fixed handleHex() Index: ASStringFormatter.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASStringFormatter.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASStringFormatter.as 29 Jun 2005 08:07:35 -0000 1.1 --- ASStringFormatter.as 29 Jun 2005 08:12:41 -0000 1.2 *************** *** 379,422 **** var flt:Number = parseFloat(arg.toString()); var str:String = flt.toString(16); - - var parts:Array = str.split("."); // // Apply width // ! if (width == undefined && width == NaN && width > parts[0].length) { var padchar:String = zeroPad ? "0" : " "; ! var diff:Number = width - parts[0].length; ! ! for (var i:Number = 0; i < diff; i++) ! { ! parts[0] = padchar + parts[0]; ! } ! } ! ! //! DECIMALS DON'T WORK YET ! ! // ! // Apply precision ! // ! if (parts[1] == undefined) ! parts[1] = ""; ! ! if (precision == undefined || precision == NaN) ! precision = 6; ! ! if (precision > parts[1].length) ! { ! var diff:Number = precision - parts[1].length; for (var i:Number = 0; i < diff; i++) { ! parts[1] = parts[1] + " "; } } ! ! str = parts.join(""); ! if (flt != 0) { --- 379,397 ---- var flt:Number = parseFloat(arg.toString()); var str:String = flt.toString(16); // // Apply width // ! if (width == undefined && width == NaN && width > str.length) { var padchar:String = zeroPad ? "0" : " "; ! var diff:Number = width - str.length; for (var i:Number = 0; i < diff; i++) { ! str = padchar + str; } } ! if (flt != 0) { |
From: Scott H. <sco...@us...> - 2005-06-29 08:08:08
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5922/src/org/actionstep Modified Files: ASUtils.as Log Message: added a trimString method Index: ASUtils.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASUtils.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ASUtils.as 29 Jun 2005 05:04:37 -0000 1.11 --- ASUtils.as 29 Jun 2005 08:07:59 -0000 1.12 *************** *** 132,134 **** --- 132,151 ---- return result; } + + /** + * Removes whitespace from the beginning and end of a string. + */ + public static function trimString(str:String):String + { + var end = str.length; + var start = 0; + var white = new Object(); + white["_"+" ".charCodeAt(0)] = 1; + white["_"+"\n".charCodeAt(0)] = 1; + white["_"+"\r".charCodeAt(0)] = 1; + white["_"+"\t".charCodeAt(0)] = 1; + while(white["_"+str.charCodeAt(--end)]); + while(white["_"+str.charCodeAt(start++)]); + return str.slice(start-1,end+1); + } } \ No newline at end of file |
From: Scott H. <sco...@us...> - 2005-06-29 08:07:44
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5707/src/org/actionstep Added Files: ASStringFormatter.as Log Message: created not everything is working yet --- NEW FILE: ASStringFormatter.as --- (This appears to be a binary file; contents omitted.) |
From: Richard K. <ric...@us...> - 2005-06-29 07:03:24
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8094/test Modified Files: ASTestControls.as Log Message: added drawing of NSBox Index: ASTestControls.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestControls.as,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ASTestControls.as 13 Jun 2005 02:41:18 -0000 1.2 --- ASTestControls.as 29 Jun 2005 07:03:13 -0000 1.3 *************** *** 36,40 **** public static function test() { ! var triggerButton; var actionButton; var window1; --- 36,40 ---- public static function test() { ! var triggerButton:NSButton; var actionButton; var window1; *************** *** 48,52 **** var target = new Object(); target.trigger = function(button) { ! TRACE("Bam"); } target.move = function(button) { --- 48,52 ---- var target = new Object(); target.trigger = function(button) { ! TRACE(button.state()); } target.move = function(button) { *************** *** 64,91 **** var app = NSApplication.sharedApplication(); ! window1 = (new NSWindow()).initWithContentRect(new NSRect(0,0,250,500)); window2 = (new NSWindow()).initWithContentRect(new NSRect(251,0,250,500)); - view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); ! //box = (new NSBox()).initWithFrame(new NSRect(10,10,160,100)); //box.setTitlePosition(NSTitlePosition.NSAboveTop); ! //box.setTitle("button"); triggerButton = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! triggerButton.setTitle("Draw"); ! triggerButton.sendActionOn(NSEvent.NSLeftMouseDownMask); ! triggerButton.setContinuous(true); ! triggerButton.setPeriodicDelayInterval(.3, .5); ! triggerButton.setBezelStyle(NSBezelStyle.NSShadowlessSquareBezelStyle); ! actionButton = (new NSButton()).initWithFrame(new NSRect(10,120,70,30)); ! actionButton.setTitle("Switch"); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,200,120,30)); - view1.addSubview(box); //box.setContentView(triggerButton); view1.addSubview(triggerButton); --- 64,96 ---- var app = NSApplication.sharedApplication(); ! window1 = (new NSWindow()).initWithContentRectSwf(new NSRect(0,0,250,500)); ! //window1 = (new NSWindow()).initWithContentRect(new NSRect(0,0,250,500)); window2 = (new NSWindow()).initWithContentRect(new NSRect(251,0,250,500)); view1 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); view2 = (new ASTestView()).initWithFrame(new NSRect(0,0,250,500)); ! box = (new NSBox()).initWithFrame(new NSRect(10,10,160,100)); ! //box.setBorderType(NSBorderType.NSLineBorder); ! var boxFont:NSFont = NSFont.fontWithNameSize("Arial", 12); ! boxFont.setBold(true); ! box.setTitleFont(boxFont); //box.setTitlePosition(NSTitlePosition.NSAboveTop); ! box.setTitle("button"); ! view2.addSubview(box); triggerButton = (new NSButton()).initWithFrame(new NSRect(10,80,70,30)); ! triggerButton.setTitle("Press"); ! triggerButton.setButtonType(NSButtonType.NSPushOnPushOffButton); ! actionButton = (new NSButton()).initWithFrame(new NSRect(10,120,150,28)); ! actionButton.setTitle("LOGIN"); textField = (new NSTextField()).initWithFrame(new NSRect(10,160,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,200,120,30)); + textField2.setDrawsBackground(false); + textField2.setStringValue("My String"); + textField2.setEditable(false); + textField2.setSelectable(false); //box.setContentView(triggerButton); view1.addSubview(triggerButton); |