mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-27 14:07:03 +00:00
- You may now bind radio groups to selectedValue, selectedTag, selectedIndex, enabled, and hidden. enabled and hidden are multiple value bindings. - Added some API to CPRadioGroup that parallels NSMatrix: selectRadioAtIndex:, selectRadioWithTag: - Added setEnabled/setHidden, they operate on all of the radios in the group. - Sample app to demonstrate all new features.
38 lines
820 B
Plaintext
38 lines
820 B
Plaintext
/*
|
|
* AppController.j
|
|
* CPRadioBindings
|
|
*
|
|
* Created by You on February 22, 2013.
|
|
* Copyright 2013, Your Company All rights reserved.
|
|
*/
|
|
|
|
@import <Foundation/CPObject.j>
|
|
|
|
|
|
@implementation AppController : CPObject
|
|
{
|
|
@outlet CPWindow theWindow;
|
|
@outlet CPRadioGroup radios @accessors;
|
|
CPString title @accessors;
|
|
int index @accessors;
|
|
int tag @accessors;
|
|
BOOL enabled @accessors;
|
|
BOOL visible @accessors;
|
|
}
|
|
|
|
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
|
{
|
|
[self setTitle:@"Two"];
|
|
[self setIndex:2];
|
|
[self setTag:13];
|
|
[self setEnabled:YES];
|
|
[self setVisible:YES];
|
|
}
|
|
|
|
- (@action)deselectAll:(id)sender
|
|
{
|
|
[radios selectRadioAtIndex:-1];
|
|
}
|
|
|
|
@end
|