Files
cappuccino/Tests/Manual/TableTest/DelegateSelectionTest/AppController.j
T
Alexandre Wilhelm 016c267e69 Fixed: Delegate method of CPTableView aren't call in the good order
Previously the call of the delegate method of a CPTableView weren't call in the good order, specially the selecting method.
Now it works as in Cocoa.
Fixed typos

Test app in Tests/Manual/TableTest/DelegateSelectionTest
2013-10-16 15:01:28 -07:00

77 lines
1.8 KiB
Plaintext
Executable File

/*
* AppController.j
* DelegateSelectionTest
*
* Created by You on October 16, 2013.
* Copyright 2013, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
CPArray _names;
@outlet CPWindow theWindow;
@outlet CPTableView tableView;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
// This is called when the application is done loading.
}
- (void)awakeFromCib
{
// This is called when the cib is done loading.
// You can implement this method on any object instantiated from a Cib.
// It's a useful hook for setting up current UI values, and other things.
_names = [@"Alexandre Wilhelm", @"Alexander Ljungberg", @"Antoine Mercadal", @"Aparajita Fishman"];
[tableView reloadData];
// In this case, we want the window from Cib to become our full browser window
[theWindow setFullPlatformWindow:YES];
}
- (int)numberOfRowsInTableView:(CPTableView)aTableView
{
return [_names count];
}
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(CPTableColumn)aColumn row:(int)aRowIndex
{
return _names[aRowIndex];
}
- (void)tableViewSelectionDidChange:(CPNotification)aNotification
{
console.log(@"tableViewSelectionDidChange")
}
- (BOOL)selectionShouldChangeInTableView:(CPTableView)aTableView
{
console.log(@"selectionShouldChangeInTableView")
return YES;
}
- (BOOL)tableView:(CPTableView)aTableView shouldSelectRow:(int)rowIndex
{
console.log(@"shouldSelectRow");
return YES;
}
- (void)tableViewSelectionIsChanging:(CPNotification)aNotification
{
console.log(@"tableViewSelectionIsChanging");
}
- (void)tableView:(CPTableView)tableView didClickTableColumn:(CPTableColumn)tableColumn;
{
console.log(@"didClickTableColumn");
}
@end