Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: samples/calculator/tape.dart

Issue 11273041: Make first and last getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/calculator/calculator.dart ('k') | samples/markdown/block_parser.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Tape { 5 class Tape {
6 static const int OP_NOOP = 0; 6 static const int OP_NOOP = 0;
7 static const int OP_PLUS = 1; 7 static const int OP_PLUS = 1;
8 static const int OP_MINUS = 2; 8 static const int OP_MINUS = 2;
9 static const int OP_MULTI = 3; 9 static const int OP_MULTI = 3;
10 static const int OP_DIV = 4; 10 static const int OP_DIV = 4;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 void clearTotal() { 214 void clearTotal() {
215 final element = new Element.tag('div'); 215 final element = new Element.tag('div');
216 216
217 element.innerHTML = tapeUI.clearCalculation(); 217 element.innerHTML = tapeUI.clearCalculation();
218 tapeUI.tape.elements.add(element.elements[0]); 218 tapeUI.tape.elements.add(element.elements[0]);
219 219
220 scrollToTapeBottom(); 220 scrollToTapeBottom();
221 } 221 }
222 222
223 bool get isClear { 223 bool get isClear {
224 return tapeUI.tape.elements.last().classes.contains(TapeUI.clearCalc); 224 return tapeUI.tape.elements.last.classes.contains(TapeUI.clearCalc);
225 } 225 }
226 226
227 void clearTape() { 227 void clearTape() {
228 tapeUI.tape.elements.clear(); 228 tapeUI.tape.elements.clear();
229 229
230 SettingsDialog settingsUI = new SettingsDialog(); 230 SettingsDialog settingsUI = new SettingsDialog();
231 tapeUI.tape.elements.add(settingsUI.root); 231 tapeUI.tape.elements.add(settingsUI.root);
232 mySettings = new Settings(settingsUI, Settings.THEME_BUTTON); 232 mySettings = new Settings(settingsUI, Settings.THEME_BUTTON);
233 } 233 }
234 234
235 DivElement get activeInput => window.document.query("#activeInput"); 235 DivElement get activeInput => window.document.query("#activeInput");
236 DivElement get activeTotal => window.document.query("#activeTotal"); 236 DivElement get activeTotal => window.document.query("#activeTotal");
237 237
238 void clear() { 238 void clear() {
239 final element = new Element.tag('div'); 239 final element = new Element.tag('div');
240 element.innerHTML = tapeUI.clearCalculation(); 240 element.innerHTML = tapeUI.clearCalculation();
241 tapeUI.tape.elements.add(element.elements[0]); 241 tapeUI.tape.elements.add(element.elements[0]);
242 } 242 }
243 } 243 }
OLDNEW
« no previous file with comments | « samples/calculator/calculator.dart ('k') | samples/markdown/block_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698