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: Scott H. <sco...@us...> - 2005-07-20 08:00:15
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19739/src/org/actionstep/test Modified Files: ASTestMatrix.as Log Message: Added some things to help test keys and inserts Index: ASTestMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestMatrix.as,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ASTestMatrix.as 1 Jun 2005 02:44:00 -0000 1.8 --- ASTestMatrix.as 20 Jul 2005 08:00:06 -0000 1.9 *************** *** 32,36 **** --- 32,44 ---- import org.actionstep.NSMatrix; import org.actionstep.constants.NSButtonType; + import org.actionstep.constants.NSAlertStyle; import org.actionstep.*; + import org.actionstep.NSWindow; + import org.actionstep.NSButton; + import org.actionstep.NSArray; + import org.actionstep.NSView; + import org.actionstep.NSTextField; + import org.actionstep.NSAlert; + import org.actionstep.NSPanel; /** *************** *** 41,51 **** class org.actionstep.test.ASTestMatrix { public static function test():Void { ! TRACE("application start"); ! 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 cell:NSButtonCell = (new NSButtonCell()).initTextCell("test"); cell.setButtonType(NSButtonType.NSRadioButton); --- 49,75 ---- class org.actionstep.test.ASTestMatrix { + public static var g_app:NSApplication; + public static var g_win:NSWindow; + public static function test():Void { ! var app:NSApplication; ! var window:NSWindow; ! var view:NSView; ! var addColumnButton:NSButton, addRowButton:NSButton, remColButton:NSButton, remRowButton:NSButton, ! insertColButton:NSButton, insertRowButton:NSButton; ! var insertColIdxInput:NSTextField, insertColTitleInput:NSTextField, insertRowIdxInput:NSTextField, ! insertRowTitleInput:NSTextField; + // + // Setup + // + app = g_app = NSApplication.sharedApplication(); + window = g_win = (new NSWindow()).initWithContentRect(new NSRect(0,0,800,600)); + view = (new NSView()).initWithFrame(new NSRect(0,0,500,500)); + + // + // Create matrix + // var cell:NSButtonCell = (new NSButtonCell()).initTextCell("test"); cell.setButtonType(NSButtonType.NSRadioButton); *************** *** 73,77 **** { var i = matrix.numberOfRows(); ! if(i==0) return; matrix.removeRow(i - 1); matrix.sizeToCells(); --- 97,105 ---- { var i = matrix.numberOfRows(); ! if(i==0) ! { ! ASTestMatrix.showErrorBox("No rows to remove."); ! return; ! } matrix.removeRow(i - 1); matrix.sizeToCells(); *************** *** 80,89 **** { var i = matrix.numberOfColumns(); ! if(i==0) return; matrix.removeColumn(i - 1); matrix.sizeToCells(); } ! var addColumnButton:NSButton = (new NSButton()).initWithFrame(new NSRect(10,10,100,30)); addColumnButton.setTitle("Add Column"); addColumnButton.setTarget(target); --- 108,150 ---- { var i = matrix.numberOfColumns(); ! if(i==0) ! { ! ASTestMatrix.showErrorBox("No columns to remove."); ! return; ! } ! matrix.removeColumn(i - 1); matrix.sizeToCells(); } + target.insertColumn = function() + { + var insert:Number = parseInt(insertColIdxInput.stringValue()); + + if (isNaN(insert) || insert < 0) + { + ASTestMatrix.showErrorBox("Insert index is out of range."); + return; + } + + cell = (new NSButtonCell()).initTextCell(insertColTitleInput.stringValue()); + matrix.insertColumnWithCells(insert, NSArray.arrayWithObject(cell)); + matrix.sizeToCells(); + } + target.insertRow = function() + { + var insert:Number = parseInt(insertRowIdxInput.stringValue()); + + if (isNaN(insert) || insert < 0) + { + ASTestMatrix.showErrorBox("Insert index is out of range."); + return; + } + + cell = (new NSButtonCell()).initTextCell(insertRowTitleInput.stringValue()); + matrix.insertRowWithCells(insert, NSArray.arrayWithObject(cell)); + matrix.sizeToCells(); + } ! addColumnButton = (new NSButton()).initWithFrame(new NSRect(10,10,100,30)); addColumnButton.setTitle("Add Column"); addColumnButton.setTarget(target); *************** *** 91,95 **** view.addSubview(addColumnButton); ! var addRowButton:NSButton = (new NSButton()).initWithFrame(new NSRect(120,10,100,30)); addRowButton.setTitle("Add Row"); addRowButton.setTarget(target); --- 152,156 ---- view.addSubview(addColumnButton); ! addRowButton = (new NSButton()).initWithFrame(new NSRect(120,10,100,30)); addRowButton.setTitle("Add Row"); addRowButton.setTarget(target); *************** *** 97,101 **** view.addSubview(addRowButton); ! var remRowButton:NSButton = (new NSButton()).initWithFrame(new NSRect(120,50,100,30)); remRowButton.setTitle("Remove Row"); remRowButton.setTarget(target); --- 158,162 ---- view.addSubview(addRowButton); ! remRowButton = (new NSButton()).initWithFrame(new NSRect(120,50,100,30)); remRowButton.setTitle("Remove Row"); remRowButton.setTarget(target); *************** *** 103,107 **** view.addSubview(remRowButton); ! var remColButton:NSButton = (new NSButton()).initWithFrame(new NSRect(10,50,100,30)); remColButton.setTitle("Remove Column"); remColButton.setTarget(target); --- 164,168 ---- view.addSubview(remRowButton); ! remColButton = (new NSButton()).initWithFrame(new NSRect(10,50,100,30)); remColButton.setTitle("Remove Column"); remColButton.setTarget(target); *************** *** 109,114 **** --- 170,232 ---- view.addSubview(remColButton); + insertColButton = (new NSButton()).initWithFrame(new NSRect(340,10,100,30)); + insertColButton.setTitle("Insert Column"); + insertColButton.setTarget(target); + insertColButton.setAction("insertColumn"); + view.addSubview(insertColButton); + + insertColIdxInput = (new NSTextField()).initWithFrame(new NSRect(230, 13, 20, 23)); + view.addSubview(insertColIdxInput); + + insertColTitleInput = (new NSTextField()).initWithFrame(new NSRect(250, 13, 80, 23)); + view.addSubview(insertColTitleInput); + + insertRowButton = (new NSButton()).initWithFrame(new NSRect(340,50,100,30)); + insertRowButton.setTitle("Insert Row"); + insertRowButton.setTarget(target); + insertRowButton.setAction("insertRow"); + view.addSubview(insertRowButton); + + insertRowIdxInput = (new NSTextField()).initWithFrame(new NSRect(230, 53, 20, 23)); + view.addSubview(insertRowIdxInput); + + insertRowTitleInput = (new NSTextField()).initWithFrame(new NSRect(250, 53, 80, 23)); + view.addSubview(insertRowTitleInput); + window.setContentView(view); + + // + // tabbing + // + window.setInitialFirstResponder(addColumnButton); + addColumnButton.setNextKeyView(addRowButton); + addRowButton.setNextKeyView(insertColIdxInput); + insertColIdxInput.setNextKeyView(insertColTitleInput); + insertColTitleInput.setNextKeyView(insertColButton); + insertColButton.setNextKeyView(remColButton); + remColButton.setNextKeyView(remRowButton); + remRowButton.setNextKeyView(insertRowIdxInput); + insertRowIdxInput.setNextKeyView(insertRowTitleInput); + insertRowTitleInput.setNextKeyView(insertRowButton); + insertRowButton.setNextKeyView(matrix); + matrix.setNextKeyView(addColumnButton); + app.run(); } + + + public static function showErrorBox(message:String):Void + { + var alert:NSAlert = (new NSAlert()).init(); + alert.addButtonWithTitle("OK"); + alert.setMessageText(message); + alert.setAlertStyle(NSAlertStyle.NSWarning); + alert.beginSheetModalForWindowModalDelegateDidEndSelectorContextInfo + (g_win, ASTestMatrix, "alertCallback", null); + } + + public static function alertCallback(sheet, ret:NSArray, ctxt:Object) + { + sheet.close(); + } } |
From: Scott H. <sco...@us...> - 2005-07-20 07:59:51
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19663/src/org/actionstep Modified Files: NSMatrix.as Log Message: Tons of key and mouse event stuff (but not all working) Fixed a number of bugs with inserts and selection Index: NSMatrix.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSMatrix.as,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** NSMatrix.as 27 Jun 2005 04:08:27 -0000 1.22 --- NSMatrix.as 20 Jul 2005 07:59:40 -0000 1.23 *************** *** 38,41 **** --- 38,42 ---- import org.actionstep.NSArray; import org.actionstep.NSEnumerator; + import org.actionstep.NSException; import org.actionstep.NSActionCell; import org.actionstep.NSCell; *************** *** 44,47 **** --- 45,49 ---- import org.actionstep.NSSize; [...1906 lines suppressed...] + + var cell:NSCell = cellAtRowColumn(row, column); + + if (cell.acceptsFirstResponder()) + { + if (m_dottedrow != -1 && m_dottedcol != -1) + { + //! setNeedsDisplayInRect(cellFrameAtRowColumn(m_dottedrow, m_dottedcol)); + } + + m_dottedrow = row; + m_dottedcol = column; + + //! setNeedsDisplayInRect(cellFrameAtRowColumn(m_dottedrow, m_dottedcol)); + setNeedsDisplay(true); + } + } + //****************************************************** //* Public Static Properties * |
From: Richard K. <ric...@us...> - 2005-07-20 05:31:54
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11795 Modified Files: ASRootWindowView.as Log Message: added acceptsFirstMouse for window dragging, etc Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ASRootWindowView.as 19 Jul 2005 21:55:53 -0000 1.17 --- ASRootWindowView.as 20 Jul 2005 04:08:10 -0000 1.18 *************** *** 342,345 **** --- 342,349 ---- } + public function acceptsFirstMouse(event:NSEvent) { + return true; + } + private function initializeBoundsMovieClip() { if (m_window.swf() != undefined) { |
From: Richard K. <ric...@us...> - 2005-07-20 00:16:24
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32520 Modified Files: ASTheme.as ASThemeProtocol.as ASFieldEditor.as Log Message: move first responder color to ASTheme Index: ASThemeProtocol.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASThemeProtocol.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ASThemeProtocol.as 19 Jul 2005 22:13:17 -0000 1.11 --- ASThemeProtocol.as 20 Jul 2005 00:16:14 -0000 1.12 *************** *** 44,47 **** --- 44,51 ---- interface org.actionstep.ASThemeProtocol { + /** + * First responder color + */ + public function firstResponderColor():NSColor; /** *************** *** 80,85 **** public function drawBorderButtonDisabledWithRectInView(rect:NSRect, view:NSView); public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView); ! public function drawListWithRectInView(rect:NSRect, view:NSView); --- 84,95 ---- public function drawBorderButtonDisabledWithRectInView(rect:NSRect, view:NSView); + /** + * Draws the border around the button when it has key focus + */ public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView); ! ! /** ! * Draws the the ASList background ! */ public function drawListWithRectInView(rect:NSRect, view:NSView); Index: ASFieldEditor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASFieldEditor.as,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ASFieldEditor.as 19 Jul 2005 23:41:41 -0000 1.12 --- ASFieldEditor.as 20 Jul 2005 00:16:15 -0000 1.13 *************** *** 33,36 **** --- 33,37 ---- import org.actionstep.NSNotificationCenter; import org.actionstep.ASUtils; + import org.actionstep.ASTheme; import org.actionstep.constants.NSTextMovement; *************** *** 254,258 **** m_textField.tabEnabled = false; m_textField.border = true; ! m_textField.borderColor = 0xC55660; var tform:TextFormat; --- 255,259 ---- m_textField.tabEnabled = false; m_textField.border = true; ! m_textField.borderColor = ASTheme.current().firstResponderColor().value; var tform:TextFormat; Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ASTheme.as 19 Jul 2005 22:13:17 -0000 1.18 --- ASTheme.as 20 Jul 2005 00:16:14 -0000 1.19 *************** *** 48,51 **** --- 48,52 ---- private static var g_current:ASThemeProtocol; + private var m_firstResponderColor:NSColor; /** *************** *** 53,56 **** --- 54,58 ---- */ private function ASTheme() { + m_firstResponderColor = new NSColor(0xC55660); } *************** *** 96,102 **** drawBorderButtonDown(view.mcBounds(), rect); } public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView) { ! ASDraw.outlineRectWithRect(view.mcBounds(), rect, [0xC55660]); } --- 98,108 ---- drawBorderButtonDown(view.mcBounds(), rect); } + + public function firstResponderColor():NSColor { + return m_firstResponderColor; + } public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView) { ! ASDraw.outlineRectWithRect(view.mcBounds(), rect, [firstResponderColor().value]); } |
From: Scott H. <sco...@us...> - 2005-07-20 00:07:34
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29932/src/org/actionstep Modified Files: NSObject.as Log Message: Added a few new key constants Index: NSObject.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSObject.as,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NSObject.as 19 Jul 2005 22:40:18 -0000 1.15 --- NSObject.as 20 Jul 2005 00:06:55 -0000 1.16 *************** *** 43,47 **** --- 43,52 ---- public static var NSEnterCharacter:Number = 13; public static var NSCarriageReturnCharacter:Number = 13; + public static var NSLeftArrowFunctionKey:Number = 37; + public static var NSUpArrowFunctionKey:Number = 38; + public static var NSRightArrowFunctionKey:Number = 39; + public static var NSDownArrowFunctionKey:Number = 40; + public function init() { return this; |
From: Richard K. <ric...@us...> - 2005-07-19 23:41:50
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24391 Modified Files: ASFieldEditor.as Log Message: fixed selection bug Index: ASFieldEditor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASFieldEditor.as,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ASFieldEditor.as 19 Jul 2005 21:58:38 -0000 1.11 --- ASFieldEditor.as 19 Jul 2005 23:41:41 -0000 1.12 *************** *** 241,244 **** --- 241,245 ---- m_textField.onChanged = null; m_string = m_textField.text; + Selection.setSelection(m_textField.text.length, m_textField.text.length); m_textField.setTextFormat(m_textFormat); Key.removeListener(this); |
From: Richard K. <ric...@us...> - 2005-07-19 22:40:26
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10372/test Modified Files: ASTestKeyEvents.as Log Message: got simulated click working and tabbing to from buttons Index: ASTestKeyEvents.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestKeyEvents.as,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ASTestKeyEvents.as 19 Jul 2005 21:59:21 -0000 1.1 --- ASTestKeyEvents.as 19 Jul 2005 22:40:18 -0000 1.2 *************** *** 59,63 **** textField2.setNextKeyView(button); button.setNextKeyView(textField1); ! view1.addSubview(textField1); --- 59,70 ---- textField2.setNextKeyView(button); button.setNextKeyView(textField1); ! ! var o = new Object(); ! o.click = function(b:NSButton) { ! TRACE("Clicked"); ! } ! ! button.setTarget(o); ! button.setAction("click"); view1.addSubview(textField1); |
From: Richard K. <ric...@us...> - 2005-07-19 22:40:26
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10372 Modified Files: NSButton.as NSCell.as NSObject.as Log Message: got simulated click working and tabbing to from buttons Index: NSObject.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSObject.as,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NSObject.as 18 Jul 2005 03:51:01 -0000 1.14 --- NSObject.as 19 Jul 2005 22:40:18 -0000 1.15 *************** *** 40,43 **** --- 40,46 ---- public static var NSNotFound:Number = -1; public static var NSTabCharacter:Number = 9; + public static var NSNewlineCharacter:Number = 13; + public static var NSEnterCharacter:Number = 13; + public static var NSCarriageReturnCharacter:Number = 13; public function init() { Index: NSButton.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSButton.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NSButton.as 1 Jun 2005 03:32:41 -0000 1.6 --- NSButton.as 19 Jul 2005 22:40:18 -0000 1.7 *************** *** 269,275 **** public function keyDown(event:NSEvent) { ! var chars:String = event.characters; ! //! handle newline, space, carriage return, enter ! //! and performClick(this); } --- 269,281 ---- public function keyDown(event:NSEvent) { ! var character:Number = event.keyCode; ! if ( (character == NSNewlineCharacter) ! || (character == NSEnterCharacter) ! || (character == NSCarriageReturnCharacter) ! || (character == 32)) { ! performClick(this); ! } else { ! super.keyDown(event); ! } } Index: NSCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSCell.as,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** NSCell.as 24 Jun 2005 02:14:00 -0000 1.19 --- NSCell.as 19 Jul 2005 22:40:18 -0000 1.20 *************** *** 41,44 **** --- 41,45 ---- import org.actionstep.NSSize; import org.actionstep.NSText; + import org.actionstep.NSTimer; import org.actionstep.NSNumber; import org.actionstep.NSControl; *************** *** 602,613 **** } if(view != null) { ! setNextState(); ! //! can we simulate a highlight of the control ? ! NSControl(view).sendActionTo(action(), target()); } else { setNextState(); NSApplication.sharedApplication().sendActionToFrom(action(), target(), this); } ! } --- 603,621 ---- } if(view != null) { ! setHighlighted(true); ! drawWithFrameInView(frame, view); ! NSTimer.scheduledTimerWithTimeIntervalTargetSelectorUserInfoRepeats(.1, this, "__performClickCallback", {frame:frame, view:view}, false); } else { setNextState(); NSApplication.sharedApplication().sendActionToFrom(action(), target(), this); } ! } ! ! private function __performClickCallback(timer:NSTimer) { ! var info = timer.userInfo(); ! setHighlighted(false); ! drawWithFrameInView(info.frame, info.view); ! setNextState(); ! NSControl(info.view).sendActionTo(action(), target()); } |
From: Richard K. <ric...@us...> - 2005-07-19 22:13:26
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4561 Modified Files: ASThemeProtocol.as ASTheme.as NSButtonCell.as Log Message: added first responder rendering Index: ASTheme.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASTheme.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ASTheme.as 11 Jul 2005 03:32:18 -0000 1.17 --- ASTheme.as 19 Jul 2005 22:13:17 -0000 1.18 *************** *** 96,99 **** --- 96,104 ---- drawBorderButtonDown(view.mcBounds(), rect); } + + public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView) { + ASDraw.outlineRectWithRect(view.mcBounds(), rect, [0xC55660]); + } + public function drawBezelButtonUpWithRectInViewHasShadow(rect:NSRect, view:NSView, hasShadow:Boolean) { Index: NSButtonCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSButtonCell.as,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NSButtonCell.as 27 Jun 2005 03:37:02 -0000 1.23 --- NSButtonCell.as 19 Jul 2005 22:13:17 -0000 1.24 *************** *** 659,662 **** --- 659,665 ---- image.unlockFocus(); } + if (m_showsFirstResponder) { + ASTheme.current().drawFirstResponderButtonWithRectInView(cellFrame, inView); + } } } \ No newline at end of file Index: ASThemeProtocol.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASThemeProtocol.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ASThemeProtocol.as 19 Jun 2005 05:21:57 -0000 1.10 --- ASThemeProtocol.as 19 Jul 2005 22:13:17 -0000 1.11 *************** *** 80,83 **** --- 80,85 ---- public function drawBorderButtonDisabledWithRectInView(rect:NSRect, view:NSView); + public function drawFirstResponderButtonWithRectInView(rect:NSRect, view:NSView); + public function drawListWithRectInView(rect:NSRect, view:NSView); |
From: Richard K. <ric...@us...> - 2005-07-19 21:59:31
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1410/test Added Files: ASTestKeyEvents.as Log Message: test of key/tab order --- NEW FILE: ASTestKeyEvents.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.*; import org.actionstep.test.*; import org.actionstep.constants.*; class org.actionstep.test.ASTestKeyEvents { public static function test() { var window1; var window2; var view1; var view2; var textField1; var textField2; var button:NSButton; 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)); textField1 = (new NSTextField()).initWithFrame(new NSRect(10,20,120,30)); textField2 = (new NSTextField()).initWithFrame(new NSRect(10,60,120,30)); button = (new NSButton()).initWithFrame(new NSRect(10,100,70,30)); button.setTitle("Submit"); textField1.setNextKeyView(textField2); textField2.setNextKeyView(button); button.setNextKeyView(textField1); view1.addSubview(textField1); view1.addSubview(textField2); view1.addSubview(button); window1.setContentView(view1); window1.setInitialFirstResponder(textField1); window2.setContentView(view2); app.run(); } } |
From: Richard K. <ric...@us...> - 2005-07-19 21:58:47
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1307 Modified Files: ASFieldEditor.as NSTextField.as NSTextFieldCell.as Log Message: got tab movement working for focus change management Index: NSTextField.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTextField.as,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NSTextField.as 8 Jul 2005 07:46:46 -0000 1.9 --- NSTextField.as 19 Jul 2005 21:58:38 -0000 1.10 *************** *** 177,180 **** --- 177,181 ---- if (isSelectable() && superview() != null) { if (m_editor == null) { + //ASFieldEditor.resignFirstResponder(); var x = NSTextFieldCell(m_cell).beginEditingWithDelegate(this); m_editor = x; *************** *** 273,276 **** --- 274,283 ---- return true; } + + public function keyDown(event:NSEvent) { + } + + public function keyUp(event:NSEvent) { + } public function textDidEndEditing(notification:NSNotification) { *************** *** 289,292 **** --- 296,312 ---- } break; + case NSTextMovement.NSTabTextMovement: + m_window.selectKeyViewFollowingView(this); + if (m_window.firstResponder() == m_window) { + selectText(this); + } + break; + case NSTextMovement.NSBacktabTextMovement: + TRACE("here"); + m_window.selectKeyViewPrecedingView(this); + if (m_window.firstResponder() == m_window) { + selectText(this); + } + break; case NSTextMovement.NSIllegalTextMovement: break; Index: ASFieldEditor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASFieldEditor.as,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ASFieldEditor.as 2 Jun 2005 01:15:08 -0000 1.10 --- ASFieldEditor.as 19 Jul 2005 21:58:38 -0000 1.11 *************** *** 80,83 **** --- 80,92 ---- return null; } + + public static function resignFirstResponder() { + var instance = ASFieldEditor.instance(); + if (instance.isEditing()) { + var delegate = instance.delegate(); + instance.notifyEndEditing(NSTextMovement.NSIllegalTextMovement); + delegate.resignFirstResponder(); + } + } public static function endEditing() { *************** *** 106,109 **** --- 115,119 ---- return m_cell; } + public function setDelegate(delegate:Object) { *************** *** 211,214 **** --- 221,230 ---- if (Key.getCode() == Key.ENTER) { notifyEndEditing(NSTextMovement.NSReturnTextMovement); + } else if(Key.getCode() == Key.TAB) { + if (Key.isDown(Key.SHIFT)) { + notifyEndEditing(NSTextMovement.NSBacktabTextMovement); + } else { + notifyEndEditing(NSTextMovement.NSTabTextMovement); + } } } *************** *** 261,264 **** --- 277,281 ---- } Key.addListener(this); + Selection.setFocus(String(m_textField)); notifyBeginEditing(); } Index: NSTextFieldCell.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSTextFieldCell.as,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NSTextFieldCell.as 11 Jul 2005 03:32:53 -0000 1.17 --- NSTextFieldCell.as 19 Jul 2005 21:58:38 -0000 1.18 *************** *** 126,130 **** public function endEditingWithDelegate(delegate:Object):Void { ! ASFieldEditor.endEditing(delegate); } --- 126,130 ---- public function endEditingWithDelegate(delegate:Object):Void { ! ASFieldEditor.endEditing(); } |
From: Richard K. <ric...@us...> - 2005-07-19 21:56:06
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv710 Modified Files: NSWindow.as NSApplication.as ASRootWindowView.as Log Message: change key/main window to be the first created window, added ability to hide resize indicators Index: ASRootWindowView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASRootWindowView.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ASRootWindowView.as 15 Jul 2005 22:36:25 -0000 1.16 --- ASRootWindowView.as 19 Jul 2005 21:55:53 -0000 1.17 *************** *** 63,66 **** --- 63,67 ---- private var m_resizeClip:MovieClip; + private var m_showsResizeIndicator:Boolean; // For flash 8 *************** *** 72,75 **** --- 73,77 ---- m_swfLoading = false; m_swfLoaded = false; + m_showsResizeIndicator = true; m_titleRect = new NSRect(0,0,0,22); m_resizeRect = new NSRect(-11,-11,11,11); *************** *** 95,139 **** 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); ! 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, 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, 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; --- 97,101 ---- m_resizeClip = m_mcBounds.createEmptyMovieClip("ResizeClip", 1000000); ! drawResizeClip(); m_resizeClip.view = this; m_resizeClip._x = m_frame.size.width-12; *************** *** 145,148 **** --- 107,158 ---- } + private function drawResizeClip() { + with(m_resizeClip) { + clear(); + beginFill(0xFFFFFF, 1); + lineStyle(0, 0xFFFFFF, 1); + moveTo(0,0); + lineTo(10,0); + lineTo(10,10); + lineTo(0,10); + lineTo(0,0); + endFill(); + } + if (m_showsResizeIndicator) { + 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, 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, 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); + } + } + } + public function removeFromSuperview() { removeMovieClips(); *************** *** 418,421 **** --- 428,432 ---- 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; + /* don't constrain here, constrain in NSWindow if (width < m_titleTextField.textWidth+30) { width = m_titleTextField.textWidth+30; *************** *** 423,430 **** 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); } public function drawRect(rect:NSRect) { --- 434,452 ---- 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); } + + public function showsResizeIndicator():Boolean { + return m_showsResizeIndicator; + } + + public function setShowsResizeIndicator(value:Boolean) { + if (m_showsResizeIndicator != value) { + m_showsResizeIndicator = value; + drawResizeClip(); + } + } public function drawRect(rect:NSRect) { Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** NSApplication.as 18 Jul 2005 03:52:20 -0000 1.27 --- NSApplication.as 19 Jul 2005 21:55:53 -0000 1.28 *************** *** 283,286 **** --- 283,288 ---- ASEventMonitor.instance().trackMouseEvents(); ASEventMonitor.instance().trackKeyboardEvents(); + wins[0].makeKeyWindow(); + wins[0].makeMainWindow(); //! What else should we do in run? m_active = true; Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** NSWindow.as 19 Jul 2005 03:57:35 -0000 1.27 --- NSWindow.as 19 Jul 2005 21:55:53 -0000 1.28 *************** *** 170,175 **** m_rootView = (new ASRootWindowView()).initWithFrameWindow(m_frameRect, this); setContentView((new NSView()).initWithFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size))); - makeKeyWindow(); - makeMainWindow(); return this; } --- 170,173 ---- *************** *** 302,305 **** --- 300,311 ---- m_contentView.setFrame(NSRect.withOriginSize(convertScreenToBase(m_contentRect.origin), m_contentRect.size)); } + + public function showsResizeIndicator():Boolean { + return m_rootView.showsResizeIndicator(); + } + + public function setShowsResizeIndicator(value:Boolean) { + m_rootView.setShowsResizeIndicator(value); + } // Constraining window size |
From: Richard K. <ric...@us...> - 2005-07-19 21:53:45
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32651 Modified Files: ASEventMonitor.as Log Message: forgot parathesis on getCode call Index: ASEventMonitor.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASEventMonitor.as,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ASEventMonitor.as 14 Jul 2005 21:56:42 -0000 1.16 --- ASEventMonitor.as 19 Jul 2005 21:53:34 -0000 1.17 *************** *** 125,134 **** buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); m_app.sendEvent(event); } private function keyUp() { ! if (m_lastKeyDown == Key.getCode) { m_lastKeyDown = 0; } --- 125,134 ---- buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); m_app.sendEvent(event); } private function keyUp() { ! if (m_lastKeyDown == Key.getCode()) { m_lastKeyDown = 0; } *************** *** 136,140 **** buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); m_app.sendEvent(event); } --- 136,140 ---- buildModifierFlags(), m_timeOffset+getTimer(), null /* window */, null /*contact*/, String.fromCharCode(Key.getAscii()), String.fromCharCode(Key.getAscii()), (m_lastKeyDown == Key.getCode()), Key.getCode()); ! m_lastKeyDown = Key.getCode(); m_app.sendEvent(event); } |
From: Richard K. <ric...@us...> - 2005-07-19 03:57:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29247 Modified Files: NSWindow.as Log Message: added min/max size constraints, constrain frame and publish notifications Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** NSWindow.as 18 Jul 2005 22:28:36 -0000 1.26 --- NSWindow.as 19 Jul 2005 03:57:35 -0000 1.27 *************** *** 82,85 **** --- 82,86 ---- public static var NSWindowDidResignKeyNotification = ASUtils.intern("NSWindowDidResignKeyNotification"); public static var NSWindowDidResignMainNotification = ASUtils.intern("NSWindowDidResignMainNotification"); + public static var NSWindowWillMoveNotification = ASUtils.intern("NSWindowWillMoveNotification"); // Private variables *************** *** 112,115 **** --- 113,119 ---- private var m_selectionDirection:NSSelectionDirection; + private var m_minFrameSize:NSSize; + private var m_maxFrameSize:NSSize; + public function NSWindow() { m_app = NSApplication.sharedApplication(); *************** *** 125,128 **** --- 129,134 ---- m_windowNumber = g_instances.length; m_selectionDirection = NSSelectionDirection.NSDirectSelection; + m_minFrameSize = new NSSize(1,1); + m_maxFrameSize = new NSSize(10000, 10000); } *************** *** 232,251 **** public function setFrame(frame:NSRect) { ! m_frameRect = frame.clone(); var cRect = contentRectForFrameRect(); ! 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; } public function setFrameOrigin(point:NSPoint) { ! m_frameRect.origin.x = point.x; ! m_frameRect.origin.y = point.y; ! m_contentRect = contentRectForFrameRect(); ! m_rootView.setFrameOrigin(m_frameRect.origin); } --- 238,296 ---- public function setFrame(frame:NSRect) { ! frame = frame.clone(); ! if (frame.size.width < m_minFrameSize.width) { ! frame.size.width = m_minFrameSize.width; ! } ! if (frame.size.height < m_minFrameSize.height) { ! frame.size.height = m_minFrameSize.height; ! } ! if (frame.size.width > m_maxFrameSize.width) { ! frame.size.width = m_maxFrameSize.width; ! } ! if (frame.size.height > m_maxFrameSize.height) { ! frame.size.height = m_maxFrameSize.height; ! } ! ! if (!frame.size.isEqual(m_frameRect.size)) { // Resize ! if (m_styleMask & NSTitledWindowMask) { ! frame = constrainFrameRect(frame); ! } ! if (m_delegate != null && typeof(m_delegate["windowWillResizeToSize"]) == "function") { ! frame.size = m_delegate["windowWillResizeToSize"].call(m_delegate, this, frame.size); ! } ! } ! if (frame.isEqual(m_frameRect)) { ! return; // Same shape; ! } ! if (!frame.origin.isEqual(m_frameRect.origin)) { ! m_notificationCenter.postNotificationWithNameObject(NSWindowWillMoveNotification, this); ! m_rootView.setFrameOrigin(frame.origin); ! } ! m_frameRect = frame; ! var cRect = contentRectForFrameRect(); ! if (!m_contentRect.size.isEqual(cRect.size)) { m_contentView.setFrameSize(cRect.size); m_contentView.setNeedsDisplay(true); m_rootView.setFrameSize(frame.size); m_rootView.setNeedsDisplay(true); + m_contentRect = cRect; } ! } ! ! public function constrainFrameRect(rect:NSRect):NSRect { ! if (rect.size.width < 100) { ! rect.size.width = 100; ! } ! if (rect.size.height < 24) { ! rect.size.height = 24; ! } ! return rect; } public function setFrameOrigin(point:NSPoint) { ! var f:NSRect = m_frameRect.clone(); ! f.origin = point; ! setFrame(f); } *************** *** 258,261 **** --- 303,336 ---- } + // Constraining window size + + public function maxSize():NSSize { + return m_maxFrameSize; + } + + public function minSize():NSSize { + return m_minFrameSize; + } + + public function setMaxSize(size:NSSize) { + if (size.width > 10000) { + size.width = 10000; + } + if (size.height > 10000) { + size.height = 10000; + } + m_maxFrameSize = size; + } + + public function setMinSize(size:NSSize) { + if (size.width < 1) { + size.width = 1; + } + if (size.height < 1) { + size.height = 1; + } + m_minFrameSize = size; + } + // Ordering Windows *************** *** 648,651 **** --- 723,727 ---- public function center() { + setFrameOrigin(new NSPoint((Stage.width - m_frameRect.size.width)/2, (Stage.height - m_frameRect.size.height)/2 - 10)); } *************** *** 713,716 **** --- 789,793 ---- mapDelegateNotification("DidResignKey"); mapDelegateNotification("DidResignMain"); + mapDelegateNotification("WillMove"); } |
From: Richard K. <ric...@us...> - 2005-07-19 03:57:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29247/test Modified Files: ASTestWindowStyles.as Log Message: added min/max size constraints, constrain frame and publish notifications Index: ASTestWindowStyles.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/test/ASTestWindowStyles.as,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ASTestWindowStyles.as 7 Jul 2005 05:14:49 -0000 1.4 --- ASTestWindowStyles.as 19 Jul 2005 03:57:35 -0000 1.5 *************** *** 9,12 **** --- 9,14 ---- var window:NSWindow; var view:ASTestView; + var window4:NSWindow; + var view4:ASTestView; var target = new Object(); *************** *** 40,53 **** window.display(); window.setLevel(NSWindow.NSModalPanelWindowLevel); - } ! 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); --- 42,51 ---- window.display(); window.setLevel(NSWindow.NSModalPanelWindowLevel); } ! window4 = (new NSWindow()).initWithContentRectStyleMask(new NSRect(50,50,200,200), NSWindow.NSTitledWindowMask | NSWindow.NSResizableWindowMask); ! window4.setTitle("Higher level Control window"); view4 = new ASTestView(); view4.initWithFrame(new NSRect(0,0,20,20)); window4.setContentView(view4); *************** *** 71,74 **** --- 69,84 ---- button3.setTarget(target); button3.setAction("createTopWindow"); + + window4.setMinSize(new NSSize(200, 200)); + + var o:Object = new Object(); + o.windowWillResizeToSize = function(win:NSWindow, size:NSSize) { + TRACE("Resize to: "+size); + return size; + } + o.windowWillMove = function(notification:NSNotification) { + TRACE("Window now at: "+notification.object.frame().origin); + } + window4.setDelegate(o); app.run(); |
From: Richard K. <ric...@us...> - 2005-07-18 22:28:44
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29580 Modified Files: NSWindow.as Log Message: make frameRectForContentRectStyleMask and contentRectForFrameRectStyleMask static to be used for absolute window sizes during window creation Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NSWindow.as 18 Jul 2005 03:53:04 -0000 1.25 --- NSWindow.as 18 Jul 2005 22:28:36 -0000 1.26 *************** *** 171,176 **** // Calculating layout ! public function contentRectForFrameRectStyleMask(styleMask:Number):NSRect { ! var rect:NSRect = m_frameRect.clone(); if (styleMask == NSBorderlessWindowMask) { return rect; --- 171,176 ---- // Calculating layout ! public static function contentRectForFrameRectStyleMask(frameRect:NSRect, styleMask:Number):NSRect { ! var rect:NSRect = frameRect.clone(); if (styleMask == NSBorderlessWindowMask) { return rect; *************** *** 185,190 **** } ! public function frameRectForContentRectStyleMask(styleMask:Number):NSRect { ! var rect:NSRect = m_contentRect.clone(); if (styleMask == NSBorderlessWindowMask) { return rect; --- 185,190 ---- } ! public static function frameRectForContentRectStyleMask(contentRect:NSRect, styleMask:Number):NSRect { ! var rect:NSRect = contentRect.clone(); if (styleMask == NSBorderlessWindowMask) { return rect; *************** *** 208,216 **** public function contentRectForFrameRect():NSRect { ! return contentRectForFrameRectStyleMask(m_styleMask); } public function frameRectForContentRect():NSRect { ! return frameRectForContentRectStyleMask(m_styleMask); } --- 208,216 ---- public function contentRectForFrameRect():NSRect { ! return NSWindow.contentRectForFrameRectStyleMask(m_frameRect, m_styleMask); } public function frameRectForContentRect():NSRect { ! return NSWindow.frameRectForContentRectStyleMask(m_contentRect, m_styleMask); } |
From: Richard K. <ric...@us...> - 2005-07-18 03:53:16
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28598 Modified Files: NSWindow.as Log Message: add keydown control Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** NSWindow.as 18 Jul 2005 01:43:43 -0000 1.24 --- NSWindow.as 18 Jul 2005 03:53:04 -0000 1.25 *************** *** 486,489 **** --- 486,507 ---- } } + + public function keyDown(event:NSEvent) { + if (event.keyCode == NSTabCharacter) { + if (event.modifierFlags & NSEvent.NSShiftKeyMask) { + selectPreviousKeyView(this); + } else { + selectNextKeyView(this); + } + return; + } + if (event.keyCode == Key.ESCAPE) { + if (m_app.modalWindow() == this) { + m_app.stopModal(); //! Should be abortModal()? + } + return; + } + //! performKeyEquivalent + } // Keyboard interface control |
From: Richard K. <ric...@us...> - 2005-07-18 03:52:29
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28431 Modified Files: NSApplication.as Log Message: dispatch key events Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** NSApplication.as 18 Jul 2005 01:42:19 -0000 1.26 --- NSApplication.as 18 Jul 2005 03:52:20 -0000 1.27 *************** *** 170,177 **** } //! What else to do here? ! try { ! m_currentEvent.window.sendEvent(m_currentEvent); ! } catch (e:Error) { ! TRACE(asFatal(e.message)); } if (event.type == NSEvent.NSLeftMouseUp && ASFieldEditor.instance().isEditing()) { --- 170,194 ---- } //! What else to do here? ! switch(event.type) { ! case NSEvent.NSKeyDown: ! try { ! m_keyWindow.sendEvent(m_currentEvent); ! } catch (e:Error) { ! TRACE(asFatal(e.message)); ! } ! break; ! case NSEvent.NSKeyUp: ! try { ! m_keyWindow.sendEvent(m_currentEvent); ! } catch (e:Error) { ! TRACE(asFatal(e.message)); ! } ! break; ! default: ! try { ! m_currentEvent.window.sendEvent(m_currentEvent); ! } catch (e:Error) { ! TRACE(asFatal(e.message)); ! } } if (event.type == NSEvent.NSLeftMouseUp && ASFieldEditor.instance().isEditing()) { |
From: Richard K. <ric...@us...> - 2005-07-18 03:51:44
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28145 Modified Files: NSView.as Log Message: fixed boolean problem Index: NSView.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSView.as,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** NSView.as 16 Jul 2005 22:23:41 -0000 1.28 --- NSView.as 18 Jul 2005 03:51:36 -0000 1.29 *************** *** 821,825 **** public function canBecomeKeyView():Boolean { ! return acceptsFirstResponder() && isHiddenOrHasHiddenAncestor(); } --- 821,825 ---- public function canBecomeKeyView():Boolean { ! return acceptsFirstResponder() && !isHiddenOrHasHiddenAncestor(); } |
From: Richard K. <ric...@us...> - 2005-07-18 03:51:10
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27807 Modified Files: NSObject.as Log Message: added NSTabCharacter Index: NSObject.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSObject.as,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NSObject.as 16 Jul 2005 22:22:52 -0000 1.13 --- NSObject.as 18 Jul 2005 03:51:01 -0000 1.14 *************** *** 39,42 **** --- 39,43 ---- public static var NSNotFound:Number = -1; + public static var NSTabCharacter:Number = 9; public function init() { |
From: Richard K. <ric...@us...> - 2005-07-18 03:01:13
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19453 Modified Files: ASAlertPanel.as Log Message: moved init of MessageFont to init function Index: ASAlertPanel.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAlertPanel.as,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ASAlertPanel.as 18 Jul 2005 02:52:39 -0000 1.6 --- ASAlertPanel.as 18 Jul 2005 03:01:03 -0000 1.7 *************** *** 118,122 **** //private static var ScrollMinSize:Number = 48; ! private static var MessageFont = NSFont.systemFontOfSize(14); //messageFontOfSize(14); // 5 is too little margin. private static var MessageHorzMargin:Number = 8; --- 118,122 ---- //private static var ScrollMinSize:Number = 48; ! private static var MessageFont:NSFont; //messageFontOfSize(14); // 5 is too little margin. private static var MessageHorzMargin:Number = 8; *************** *** 135,140 **** public function init ():ASAlertPanel { - m_app = NSApplication.sharedApplication(); //super.init(); var rect:NSRect = NSRect.ZeroRect, image:NSImage, --- 135,141 ---- public function init ():ASAlertPanel { //super.init(); + m_app = NSApplication.sharedApplication(); + MessageFont = NSFont.systemFontOfSize(14); var rect:NSRect = NSRect.ZeroRect, image:NSImage, |
From: Richard K. <ric...@us...> - 2005-07-18 02:52:48
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18228 Modified Files: ASAlertPanel.as Log Message: you CANNOT init a var to a static call, you have to do that elsewhere Index: ASAlertPanel.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/ASAlertPanel.as,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ASAlertPanel.as 17 Jul 2005 00:55:27 -0000 1.5 --- ASAlertPanel.as 18 Jul 2005 02:52:39 -0000 1.6 *************** *** 81,85 **** class org.actionstep.ASAlertPanel extends NSPanel { ! private var m_app:NSApplication = NSApplication.sharedApplication(); private static var m_standardAlertPanel:ASAlertPanel; --- 81,85 ---- class org.actionstep.ASAlertPanel extends NSPanel { ! private var m_app:NSApplication; private static var m_standardAlertPanel:ASAlertPanel; *************** *** 135,138 **** --- 135,139 ---- public function init ():ASAlertPanel { + m_app = NSApplication.sharedApplication(); //super.init(); var rect:NSRect = NSRect.ZeroRect, |
From: Richard K. <ric...@us...> - 2005-07-18 01:43:58
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7356 Modified Files: NSWindow.as NSPanel.as Log Message: added behavior to event handling including dispatching key events, correct left button down/up and refactored method to be reused by NSPanel (creating private method __sendEventBecomesKeyOnlyIfNeeded) Index: NSWindow.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSWindow.as,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NSWindow.as 16 Jul 2005 22:23:41 -0000 1.23 --- NSWindow.as 18 Jul 2005 01:43:43 -0000 1.24 *************** *** 106,109 **** --- 106,111 ---- private var m_canHide:Boolean + private var m_lastEventView:NSView; + private var m_level:Number; *************** *** 446,458 **** public function sendEvent(event:NSEvent) { switch(event.type) { case NSEvent.NSLeftMouseDown: ! if (event.view.acceptsFirstResponder()) { makeFirstResponder(event.view); } ! event.view.mouseDown(event); break; case NSEvent.NSLeftMouseUp: ! event.view.mouseUp(event); break; case NSEvent.NSMouseExited: --- 448,474 ---- public function sendEvent(event:NSEvent) { + __sendEventBecomesKeyOnlyIfNeeded(event, false); + } + + private function __sendEventBecomesKeyOnlyIfNeeded(event:NSEvent, becomesKeyOnlyIfNeeded:Boolean) { + var wasKey:Boolean = m_isKey; switch(event.type) { case NSEvent.NSLeftMouseDown: ! if (!wasKey && m_level != NSDesktopWindowLevel) { ! if (!becomesKeyOnlyIfNeeded || event.view.needsPanelToBecomeKey()) { ! makeKeyAndOrderFront(); ! } ! } ! if (m_firstResponder != event.view) { makeFirstResponder(event.view); } ! if (wasKey || event.view.acceptsFirstMouse(event)) { ! m_lastEventView = event.view; ! event.view.mouseDown(event); ! } break; case NSEvent.NSLeftMouseUp: ! // send mouse up to the view that got mouse down ! m_lastEventView.mouseUp(event); break; case NSEvent.NSMouseExited: *************** *** 462,465 **** --- 478,487 ---- event.view.mouseEntered(event); break; + case NSEvent.NSKeyDown: + m_firstResponder.keyDown(event); + break; + case NSEvent.NSKeyUp: + m_firstResponder.keyUp(event); + break; } } Index: NSPanel.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSPanel.as,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NSPanel.as 15 Jul 2005 12:22:58 -0000 1.3 --- NSPanel.as 18 Jul 2005 01:43:43 -0000 1.4 *************** *** 30,34 **** import org.actionstep.NSWindow; ! //import org.actionstep.NSEvent; import org.actionstep.NSRect; --- 30,34 ---- import org.actionstep.NSWindow; ! import org.actionstep.NSEvent; import org.actionstep.NSRect; *************** *** 130,138 **** m_becomesKeyOnlyIfNeeded = flag; } ! /* ! public function sendEvent (theEvent:NSEvent):Void { ! _sendEventBecomesKeyOnlyIfNeeded ! (theEvent, _becomesKeyOnlyIfNeeded); ! }*/ public function description():String { --- 130,137 ---- m_becomesKeyOnlyIfNeeded = flag; } ! ! public function sendEvent(theEvent:NSEvent):Void { ! __sendEventBecomesKeyOnlyIfNeeded(theEvent, m_becomesKeyOnlyIfNeeded); ! } public function description():String { |
From: Richard K. <ric...@us...> - 2005-07-18 01:42:29
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7191 Modified Files: NSApplication.as Log Message: move makeKeyAndOrderFront on left mouse down into NSWindow Index: NSApplication.as =================================================================== RCS file: /cvsroot/actionstep/actionstep/src/org/actionstep/NSApplication.as,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** NSApplication.as 17 Jul 2005 00:50:39 -0000 1.25 --- NSApplication.as 18 Jul 2005 01:42:19 -0000 1.26 *************** *** 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) { --- 171,174 ---- |
From: Scott H. <sco...@us...> - 2005-07-17 11:01:51
|
Update of /cvsroot/actionstep/actionstep/src/org/actionstep/constants In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5073/src/org/actionstep/constants Added Files: NSTableResizingStyle.as NSTableViewDropOperation.as Log Message: created --- NEW FILE: NSTableResizingStyle.as --- (This appears to be a binary file; contents omitted.) --- NEW FILE: NSTableViewDropOperation.as --- (This appears to be a binary file; contents omitted.) |