PageRenderTime 16ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/Tests/Manual/TableTest/BorderTableTest/AppController.j

http://github.com/cacaodev/cappuccino
Unknown | 60 lines | 46 code | 14 blank | 0 comment | 0 complexity | c6842e738689ddc240feeb57c6a1faef MD5 | raw file
 1/*
 2 * AppController.j
 3 * TableCibTest
 4 *
 5 * Created by Francisco Tolmasky on July 5, 2009.
 6 * Copyright 2009, 280 North, Inc. All rights reserved.
 7 */
 8
 9@import <Foundation/CPObject.j>
10
11CPLogRegister(CPLogConsole);
12
13@implementation AppController : CPObject
14{
15    CPWindow        theWindow; //this "outlet" is connected automatically by the Cib
16    CPScrollView    theScrollView;
17    CPTableView     theTableView;
18    CPPopupButton   theBorderTypePopup;
19}
20
21- (void)applicationDidFinishLaunching:(CPNotification)aNotification
22{
23    // This is called when the application is done loading.
24}
25
26- (void)awakeFromCib
27{
28    // This is called when the cib is done loading.
29    // You can implement this method on any object instantiated from a Cib.
30    // It's a useful hook for setting up current UI values, and other things.
31
32    // In this case, we want the window from Cib to become our full browser window
33    [theWindow setFullPlatformWindow:YES];
34
35    [theWindow setBackgroundColor:[CPColor colorWithHexString:@"f3f4f5"]];
36
37    [theBorderTypePopup selectItemWithTag:[theScrollView borderType]];
38}
39
40- (int)numberOfRowsInTableView:(CPTableView)tableView
41{
42    return 10;
43}
44
45- (id)tableView:(CPTableView)tableView objectValueForTableColumn:(CPTableColumn)tableColumn row:(CPInteger)row
46{
47    return String((row + 1) * [[tableColumn identifier] intValue]);
48}
49
50// Actions
51
52- (void)setBorder:(id)sender
53{
54    var type = [[sender selectedItem] tag];
55    console.log('type=%d', type);
56
57    [theScrollView setBorderType:type];
58}
59
60@end