| 1 |
footashida |
1.1 |
#import "MainController.h" |
| 2 |
|
|
#import "DummyOutlineDataSource.h" |
| 3 |
footashida |
1.2 |
#import "MainToolbarSource.h" |
| 4 |
footashida |
1.1 |
#import "IconedCell.h" |
| 5 |
footashida |
1.2 |
#import "ComposeToolbarSource.h" |
| 6 |
footashida |
1.3 |
#import "PreferenceToolbarSource.h" |
| 7 |
footashida |
1.1 |
|
| 8 |
|
|
@implementation MainController |
| 9 |
|
|
-(void)awakeFromNib{ |
| 10 |
|
|
DummyOutlineDataSource *ds; |
| 11 |
|
|
NSToolbar *toolbar; |
| 12 |
footashida |
1.2 |
MainToolbarSource *mainToolbarSource; |
| 13 |
|
|
ComposeToolbarSource *composeToolbarSource; |
| 14 |
footashida |
1.3 |
PreferenceToolbarSource *preferenceToolbarSource; |
| 15 |
|
|
|
| 16 |
|
|
[preferenceWindow setContentSize:[generalPref bounds].size]; |
| 17 |
|
|
[[preferenceWindow contentView] addSubview:generalPref]; |
| 18 |
footashida |
1.1 |
|
| 19 |
|
|
ds = [[DummyOutlineDataSource alloc] init]; |
| 20 |
|
|
[folderTree setDataSource:ds]; |
| 21 |
|
|
|
| 22 |
|
|
toolbar = [[NSToolbar alloc] initWithIdentifier:@"myToolBar"]; |
| 23 |
footashida |
1.2 |
mainToolbarSource = [[MainToolbarSource alloc] initWithController:self]; |
| 24 |
|
|
[toolbar setDelegate:mainToolbarSource]; |
| 25 |
footashida |
1.1 |
[window setToolbar:toolbar]; |
| 26 |
|
|
[toolbar release]; |
| 27 |
|
|
|
| 28 |
|
|
toolbar = [[NSToolbar alloc] initWithIdentifier:@"componentToolBar"]; |
| 29 |
footashida |
1.2 |
composeToolbarSource = [[ComposeToolbarSource alloc] initWithController:self]; |
| 30 |
|
|
[toolbar setDelegate:composeToolbarSource]; |
| 31 |
footashida |
1.1 |
[composeWindow setToolbar:toolbar]; |
| 32 |
|
|
[toolbar release]; |
| 33 |
|
|
|
| 34 |
footashida |
1.3 |
toolbar = [[NSToolbar alloc] initWithIdentifier:@"preferenceToolBar"]; |
| 35 |
|
|
preferenceToolbarSource = [[PreferenceToolbarSource alloc] initWithController:self]; |
| 36 |
|
|
[toolbar setDelegate:preferenceToolbarSource]; |
| 37 |
|
|
[preferenceWindow setToolbar:toolbar]; |
| 38 |
|
|
[toolbar release]; |
| 39 |
|
|
|
| 40 |
footashida |
1.1 |
} |
| 41 |
|
|
- (void)applicationDidFinishLaunching:(NSNotification*)notif |
| 42 |
|
|
{ |
| 43 |
|
|
NSTableColumn* tableColumn; |
| 44 |
|
|
IconedCell* iconedCell; |
| 45 |
|
|
// �t�H���_�c���[���A�A�C�R��+�������\���������������ACell�����X���s���B |
| 46 |
|
|
tableColumn = [folderTree tableColumnWithIdentifier:@"folderview"]; |
| 47 |
|
|
iconedCell = [[[IconedCell alloc] init] autorelease]; |
| 48 |
|
|
[tableColumn setDataCell:iconedCell]; |
| 49 |
|
|
} |
| 50 |
|
|
-(IBAction)createNewMessage:(id)sender{ |
| 51 |
|
|
[composeWindow makeKeyAndOrderFront:nil]; |
| 52 |
|
|
} |
| 53 |
|
|
-(IBAction)findMessage:(id)sender{ |
| 54 |
|
|
[searchWindow makeKeyAndOrderFront:nil]; |
| 55 |
footashida |
1.2 |
} |
| 56 |
|
|
-(IBAction)showPreference:(id)sender{ |
| 57 |
|
|
[preferenceWindow makeKeyAndOrderFront:nil]; |
| 58 |
footashida |
1.3 |
} |
| 59 |
|
|
-(IBAction)selectPreferenceTab:(id)sender{ |
| 60 |
|
|
NSView *contentView; |
| 61 |
|
|
NSRect rect; |
| 62 |
|
|
float toolbarHeight; |
| 63 |
|
|
NSString *identifier = [sender itemIdentifier]; |
| 64 |
|
|
contentView = [preferenceWindow contentView]; |
| 65 |
|
|
|
| 66 |
|
|
toolbarHeight = [preferenceWindow frame].size.height - [contentView frame].size.height; |
| 67 |
|
|
NSLog(@"toolbarHeight = %f", toolbarHeight); |
| 68 |
|
|
|
| 69 |
|
|
if([identifier isEqual:@"general_tab"]){ |
| 70 |
|
|
rect.origin = NSMakePoint([preferenceWindow frame].origin.x, |
| 71 |
|
|
[preferenceWindow frame].origin.y - ([generalPref bounds].size.height - [contentView bounds].size.height) - toolbarHeight); |
| 72 |
|
|
rect.size = [generalPref bounds].size; |
| 73 |
|
|
[preferenceWindow setFrame:rect display:YES animate:YES]; |
| 74 |
|
|
[contentView replaceSubview:accountPref with:generalPref]; |
| 75 |
|
|
}else{ |
| 76 |
|
|
rect.origin = NSMakePoint([preferenceWindow frame].origin.x, |
| 77 |
|
|
[preferenceWindow frame].origin.y - ([accountPref bounds].size.height - [contentView bounds].size.height) - toolbarHeight); |
| 78 |
|
|
rect.size = [accountPref bounds].size; |
| 79 |
|
|
[preferenceWindow setFrame:rect display:YES animate:YES]; |
| 80 |
|
|
[contentView replaceSubview:generalPref with:accountPref]; |
| 81 |
|
|
} |
| 82 |
|
|
|
| 83 |
footashida |
1.1 |
} |
| 84 |
|
|
|
| 85 |
|
|
@end |