mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Decode splitview and items.
This commit is contained in:
parent
c7a3c798a9
commit
726c847803
2 changed files with 26 additions and 18 deletions
|
@ -62,8 +62,6 @@ extern "C" {
|
|||
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex;
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex;
|
||||
- (IBAction)toggleSidebar:(id)sender;
|
||||
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item;
|
||||
- (void)viewDidLoad;
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
@ -23,17 +23,19 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSArchiver.h>
|
||||
|
||||
#import "AppKit/NSSplitView.h"
|
||||
#import "AppKit/NSSplitViewController.h"
|
||||
#import "AppKit/NSSplitViewItem.h"
|
||||
|
||||
#import "GSFastEnumeration.h"
|
||||
|
||||
@implementation NSSplitViewController
|
||||
// return splitview...
|
||||
- (NSSplitView *) splitView
|
||||
{
|
||||
return [self view];
|
||||
return (NSSplitView *)[self view];
|
||||
}
|
||||
|
||||
- (void) setSplitView: (NSSplitView *)splitView
|
||||
|
@ -81,49 +83,57 @@
|
|||
// instance methods...
|
||||
- (NSRect)splitView:(NSSplitView *)splitView additionalEffectiveRectOfDividerAtIndex:(NSInteger)dividerIndex
|
||||
{
|
||||
|
||||
return [splitView frame];
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect ofDividerAtIndex:(NSInteger)dividerIndex
|
||||
- (NSRect)splitView:(NSSplitView *)splitView effectiveRect:(NSRect)proposedEffectiveRect forDrawnRect:(NSRect)drawnRect
|
||||
ofDividerAtIndex:(NSInteger)dividerIndex
|
||||
{
|
||||
return proposedEffectiveRect;
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldCollapseSubview:(NSView *)subview forDoubleClickOnDividerAtIndex:(NSInteger)dividerIndex
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (IBAction)toggleSidebar:(id)sender
|
||||
{
|
||||
}
|
||||
|
||||
- (BOOL)validateUserInterfaceItem:(id<NSValidatedUserInterfaceItem>)item
|
||||
{
|
||||
}
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
NSLog(@"Toggle");
|
||||
}
|
||||
|
||||
// NSCoding
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
self = [super initWithCoder: coder];
|
||||
if ([coder allowsKeyedCoding])
|
||||
{
|
||||
if ([coder containsValueForKey: @"NSSplitView"])
|
||||
{
|
||||
NSSplitView *sv = [coder decodeObjectForKey: @"NSSplitView"];
|
||||
[self setSplitView: sv];
|
||||
}
|
||||
if ([coder containsValueForKey: @"NSSplitViewItems"])
|
||||
{
|
||||
NSArray *items = [coder decodeObjectForKey: @"NSSplitViewItems"];
|
||||
[_splitViewItems addObjectsFromArray: items];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) encodeWithCoder: (NSCoder *)coder
|
||||
{
|
||||
}
|
||||
|
||||
// NSCopying
|
||||
- (id) copyWithZone: (NSZone *)z
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in a new issue