Files
cappuccino/Tests/Manual/CPSplitViewDivider/AppController.j
T
Christophe Serafin 5ec5198dda Test: Added a test that verifies CPSplitView divider behavior when having only 1 subview.
Issue#2406 reported a behavior different from Cocoa Framework. This test validates that Cappuccino CPSplitView is working well when adding
and removing a subview. A CPSplitView that has only one subview should resize it to take the whole space available.

This PR adds a new test to Tests/Manual
2016-01-12 16:29:24 +01:00

48 lines
972 B
Plaintext

/*
* AppController.j
* CPSplitViewDivider
*
* Created by You on January 12, 2016.
* Copyright 2016, Your Company All rights reserved.
*/
@import <Foundation/Foundation.j>
@import <AppKit/AppKit.j>
@implementation AppController : CPObject
{
@outlet CPSplitView splitView;
@outlet CPView viewLeft;
@outlet CPView viewRight;
@outlet CPWindow theWindow;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
}
- (void)awakeFromCib
{
[theWindow setFullPlatformWindow:YES];
[viewLeft setBackgroundColor:[CPColor grayColor]];
[viewRight setBackgroundColor:[CPColor greenColor]];
}
- (@action)clickChangeButton:(id)aSender
{
if (![viewRight superview])
{
console.log(@"Add viewRight in splitView");
[splitView addSubview:viewRight];
}
else
{
console.error(@"Remove viewRight from splitView");
[viewRight removeFromSuperview];
}
}
@end