OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |