Changeset 7300 for lang/actionscript/FxTerm
- Timestamp:
- 02/29/08 21:15:14 (5 years ago)
- Location:
- lang/actionscript/FxTerm/trunk
- Files:
-
- 4 modified
-
FxTerm.as (modified) (8 diffs)
-
Telnet.as (modified) (5 diffs)
-
TelnetPanel.mxml (modified) (6 diffs)
-
Terminal.as (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/actionscript/FxTerm/trunk/FxTerm.as
r7259 r7300 23 23 private var _screen:Array; // Array of Array of TextCell 24 24 25 private var curattr:uint ; // current attribute25 private var curattr:uint = 0x70; // current attribute 26 26 27 27 private var cols:int = 0; // cols by single character wide … … 86 86 // default color setting 87 87 ansiForegroundColors = [ 88 0x F0F0F0, // normal88 0x000000, // black 89 89 0xFF3214, // red 90 90 0x00FF00, // green … … 93 93 0xFF00FF, // magenta 94 94 0x00FFFF, // cyan 95 0xF FFFFF, // white95 0xF0F0F0, // normal 96 96 ]; 97 97 ansiBackgroundColors = [ … … 433 433 cursorCanvas.graphics.clear(); 434 434 // FIXME cursor color 435 cursorCanvas.graphics.beginFill(ansiForegroundColors[ 0], 1.0);435 cursorCanvas.graphics.beginFill(ansiForegroundColors[7], 1.0); 436 436 cursorCanvas.graphics.drawRect( 437 437 (this.width / cols - 0.05) * ccol + 2, … … 599 599 var screen:Array = _screen; 600 600 var wide:Boolean = isWideCharacter(c); 601 if( wide && ccol+1 >= cols ) { 602 screen[crow][ccol].wide = false; 603 screen[crow][ccol].text = " "; 604 cursorLineDown(); 605 ccol = 0; 601 if( wide ) { 602 if( ccol+1 >= cols ) { 603 screen[crow][ccol].wide = false; 604 screen[crow][ccol].text = " "; 605 cursorLineDown(); 606 ccol = 0; 607 } 608 } else { 609 if( ccol >= cols ) { 610 cursorLineDown(); 611 ccol = 0; 612 } 606 613 } 607 614 screen[crow][ccol].text = c; … … 623 630 } 624 631 ccol++; 625 }626 if( ccol >= cols ) {627 cursorLineDown();628 ccol = 0;629 632 } 630 633 cursorDirty = true; … … 1181 1184 private function isWideCharacter(c:String):Boolean 1182 1185 { 1186 return false; 1187 /* 1183 1188 characterWidthMeasure.width = 0; 1184 1189 characterWidthMeasure.text = c + "m"; … … 1189 1194 return true; 1190 1195 } 1196 */ 1191 1197 } 1192 1198 -
lang/actionscript/FxTerm/trunk/Telnet.as
r7237 r7300 81 81 _socket.writeByte(value); 82 82 } 83 _socket.flush(); 83 84 } 84 85 … … 86 87 if( !_active ) { return; } 87 88 _socket.writeBytes(bytes, offset, length); 89 _socket.flush(); 88 90 // FIXME convert IAC to IAC IAC 89 91 } … … 96 98 private function closeHandler(event:Event):void 97 99 { 98 _socket.close(); 99 _active = false; 100 close(); 100 101 dispatchEvent(event); 101 102 } … … 103 104 private function ioErrorHandler(event:IOErrorEvent):void 104 105 { 105 _socket.close(); 106 _active = false; 106 close(); 107 107 dispatchEvent(event); 108 108 } … … 110 110 private function securityErrorHandler(event:SecurityErrorEvent):void 111 111 { 112 _socket.close(); 113 _active = false; 112 close(); 114 113 dispatchEvent(event); 115 114 } -
lang/actionscript/FxTerm/trunk/TelnetPanel.mxml
r7259 r7300 31 31 { 32 32 telnet.connect(host, port); 33 } 34 35 public function close():void 36 { 37 telnet.close(); 33 38 } 34 39 … … 106 111 107 112 <mx:HBox label="Color" horizontalAlign="center"> 108 <mx:ColorPicker id="fgcolor Normal" showTextField="true"109 close="{terminal.ansiForeground Normal=fgcolorNormal.selectedColor}"110 selectedColor="{terminal.ansiForeground Normal}"/>113 <mx:ColorPicker id="fgcolorBlack" showTextField="true" 114 close="{terminal.ansiForegroundBlack=fgcolorBlack.selectedColor}" 115 selectedColor="{terminal.ansiForegroundBlack}"/> 111 116 <mx:ColorPicker id="fgcolorRed" showTextField="true" 112 117 close="{terminal.ansiForegroundRed=fgcolorRed.selectedColor}" … … 124 129 close="{terminal.ansiForegroundMagenta=fgcolorMagenta.selectedColor}" 125 130 selectedColor="{terminal.ansiForegroundMagenta}"/> 126 <mx:ColorPicker id="fgcolorWhite" showTextField="true" 127 close="{terminal.ansiForegroundWhite=fgcolorWhite.selectedColor}" 128 selectedColor="{terminal.ansiForegroundWhite}"/> 131 <mx:ColorPicker id="fgcolorCyan" showTextField="true" 132 close="{terminal.ansiForegroundCyan=fgcolorCyan.selectedColor}" 133 selectedColor="{terminal.ansiForegroundCyan}"/> 134 <mx:ColorPicker id="fgcolorNormal" showTextField="true" 135 close="{terminal.ansiForegroundNormal=fgcolorNormal.selectedColor}" 136 selectedColor="{terminal.ansiForegroundNormal}"/> 129 137 <mx:VRule/> 130 138 <mx:ColorPicker id="bgcolorNormal" showTextField="true" … … 146 154 close="{terminal.ansiBackgroundMagenta=bgcolorMagenta.selectedColor}" 147 155 selectedColor="{terminal.ansiBackgroundMagenta}"/> 156 <mx:ColorPicker id="bgcolorCyan" showTextField="true" 157 close="{terminal.ansiBackgroundCyan=bgcolorCyan.selectedColor}" 158 selectedColor="{terminal.ansiBackgroundCyan}"/> 148 159 <mx:ColorPicker id="bgcolorWhite" showTextField="true" 149 160 close="{terminal.ansiBackgroundWhite=bgcolorWhite.selectedColor}" … … 151 162 </mx:HBox> 152 163 153 <mx:HBox label=" Display" horizontalAlign="center">164 <mx:HBox label="System" horizontalAlign="center"> 154 165 <mx:Script> 155 166 <![CDATA[ … … 171 182 styleName="terminalControl" 172 183 /> 184 <mx:Spacer width="10"/> 185 <mx:Button label="disconnect" click="close(); telnet.dispatchEvent(new Event(Event.CLOSE));"/> 173 186 </mx:HBox> 174 187 -
lang/actionscript/FxTerm/trunk/Terminal.as
r7245 r7300 89 89 90 90 [Bindable] 91 public function get ansiForeground Normal():uint91 public function get ansiForegroundBlack():uint 92 92 { return _term.getForegroundColor(0); } 93 93 [Bindable] … … 107 107 { return _term.getForegroundColor(5); } 108 108 [Bindable] 109 public function get ansiForeground White():uint109 public function get ansiForegroundCyan():uint 110 110 { return _term.getForegroundColor(6); } 111 112 public function set ansiForegroundNormal(color:uint):void 111 [Bindable] 112 public function get ansiForegroundNormal():uint 113 { return _term.getForegroundColor(7); } 114 115 public function set ansiForegroundBlack(color:uint):void 113 116 { _term.setForegroundColor(0, color); changed(); } 114 117 public function set ansiForegroundRed(color:uint):void … … 122 125 public function set ansiForegroundMagenta(color:uint):void 123 126 { _term.setForegroundColor(5, color); changed(); } 124 public function set ansiForeground White(color:uint):void127 public function set ansiForegroundCyan(color:uint):void 125 128 { _term.setForegroundColor(6, color); changed(); } 129 public function set ansiForegroundNormal(color:uint):void 130 { _term.setForegroundColor(7, color); changed(); } 126 131 127 132 [Bindable] … … 144 149 { return _term.getBackgroundColor(5); } 145 150 [Bindable] 151 public function get ansiBackgroundCyan():uint 152 { return _term.getBackgroundColor(6); } 153 [Bindable] 146 154 public function get ansiBackgroundWhite():uint 147 { return _term.getBackgroundColor( 6); }155 { return _term.getBackgroundColor(7); } 148 156 149 157 public function set ansiBackgroundNormal(color:uint):void … … 159 167 public function set ansiBackgroundMagenta(color:uint):void 160 168 { _term.setBackgroundColor(5, color); changed(); } 169 public function set ansiBackgroundCyan(color:uint):void 170 { _term.setBackgroundColor(6, color); changed(); } 161 171 public function set ansiBackgroundWhite(color:uint):void 162 { _term.setBackgroundColor( 6, color); changed(); }172 { _term.setBackgroundColor(7, color); changed(); } 163 173 164 174 public function resize(cols:uint, rows:uint):void
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)