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

Side by Side Diff: client/samples/total/src/TotalLib.dart

Issue 8905021: Dartest CL - Please review (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #library("TotalLib"); 5 #library("TotalLib");
6 #import("dart:html"); 6 #import("dart:html");
7 7
8 #source("Cell.dart"); 8 #source("Cell.dart");
9 #source("CellContents.dart"); 9 #source("CellContents.dart");
10 #source("CellLocation.dart"); 10 #source("CellLocation.dart");
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #source("SpreadsheetLayout.dart"); 44 #source("SpreadsheetLayout.dart");
45 #source("SpreadsheetListener.dart"); 45 #source("SpreadsheetListener.dart");
46 #source("SpreadsheetPresenter.dart"); 46 #source("SpreadsheetPresenter.dart");
47 #source("StringUtils.dart"); 47 #source("StringUtils.dart");
48 #source("Style.dart"); 48 #source("Style.dart");
49 #source("SYLKReader.dart"); 49 #source("SYLKReader.dart");
50 #source("UndoStack.dart"); 50 #source("UndoStack.dart");
51 #source("Value.dart"); 51 #source("Value.dart");
52 #source("ValuePicker.dart"); 52 #source("ValuePicker.dart");
53 #source("ZoomTracker.dart"); 53 #source("ZoomTracker.dart");
54
55 class Total {
56 static final int DEFAULT_VISIBLE_COLUMNS = 10;
57 static final int DEFAULT_VISIBLE_ROWS = 25;
58
59 Spreadsheet _spreadsheet;
60 SpreadsheetPresenter _presenter;
61
62 Total() {
63 Element recalcButton = document.query("#recalcButton");
64 recalcButton.innerHTML = "Recalculate";
65 recalcButton.on.click.add((Event e) {
66 _presenter.recalculateAll();
67 });
68 }
69
70 void run() {
71 _spreadsheet = new Spreadsheet();
72 SYLKReader reader = new SYLKReader();
73 reader.request("mortgage", (String data) {
74 reader.loadFromString(_spreadsheet, data);
75 _presenter = new SpreadsheetPresenter(_spreadsheet, window,
76 0, 0, DEFAULT_VISIBLE_ROWS, DEFAULT_VISIBLE_COLUMNS);
77 _spreadsheet.setListener(_presenter);
78 _presenter.recalculateViewport();
79 });
80 }
81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698