mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 13:07:02 +00:00
Manual-test-fix
This commit is contained in:
@@ -2,16 +2,38 @@
|
||||
* AppController.j
|
||||
* TrackingArea
|
||||
*
|
||||
* Created by You on November 2, 2015.
|
||||
* Created by Didier Korthoudt on November 2, 2015.
|
||||
* Copyright 2015, Your Company All rights reserved.
|
||||
*/
|
||||
|
||||
@import <Foundation/Foundation.j>
|
||||
@import <AppKit/AppKit.j>
|
||||
|
||||
@class SensibleView;
|
||||
@class SensibleViewTA;
|
||||
@class SensibleViewAutoTA;
|
||||
|
||||
@implementation AppController : CPObject
|
||||
{
|
||||
@outlet CPWindow theWindow;
|
||||
|
||||
SensibleView v1;
|
||||
SensibleView v2;
|
||||
SensibleView v3;
|
||||
SensibleView v4;
|
||||
SensibleView v5;
|
||||
SensibleView v6;
|
||||
SensibleView v7;
|
||||
SensibleView v8;
|
||||
|
||||
SensibleViewTA w2;
|
||||
SensibleView w3;
|
||||
SensibleViewAutoTA w4;
|
||||
SensibleView w5;
|
||||
SensibleView w6;
|
||||
SensibleView w7;
|
||||
|
||||
@outlet SensibleView s1;
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
|
||||
@@ -30,10 +52,350 @@
|
||||
|
||||
var p = [theWindow contentView];
|
||||
|
||||
// No tracking area
|
||||
|
||||
v1 = [[SensibleView alloc] initWithFrame:CGRectMake(30, 10, 50, 50)];
|
||||
|
||||
[v1 setViewName:@"no_tracking_area"];
|
||||
[v1 setViewColor:[CPColor greenColor]];
|
||||
[v1 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
[p addSubview:v1];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"No tracking area"];
|
||||
|
||||
[l setCenter:CGPointMake([v1 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseEnteredAndExited
|
||||
|
||||
v2 = [[SensibleView alloc] initWithFrame:CGRectMake(160, 10, 50, 50)];
|
||||
|
||||
[v2 setViewName:@"CPTrackingMouseEnteredAndExited"];
|
||||
[v2 setViewColor:[CPColor greenColor]];
|
||||
[v2 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v2
|
||||
userInfo:nil];
|
||||
|
||||
[v2 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v2];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v2 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingCursorUpdate
|
||||
|
||||
v3 = [[SensibleView alloc] initWithFrame:CGRectMake(290, 10, 50, 50)];
|
||||
|
||||
[v3 setViewName:@"CPTrackingCursorUpdate"];
|
||||
[v3 setViewColor:[CPColor greenColor]];
|
||||
[v3 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v3
|
||||
userInfo:nil];
|
||||
|
||||
[v3 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v3];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingCursorUpdate\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v3 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseMoved
|
||||
|
||||
v4 = [[SensibleView alloc] initWithFrame:CGRectMake(420, 10, 50, 50)];
|
||||
|
||||
[v4 setViewName:@"CPTrackingMouseMoved"];
|
||||
[v4 setViewColor:[CPColor greenColor]];
|
||||
[v4 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseMoved | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v4
|
||||
userInfo:nil];
|
||||
|
||||
[v4 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v4];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseMoved\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v4 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseEnteredAndExited & CPTrackingCursorUpdate
|
||||
|
||||
v5 = [[SensibleView alloc] initWithFrame:CGRectMake(550, 10, 50, 50)];
|
||||
|
||||
[v5 setViewName:@"CPTrackingMouseEnteredAndExited+CPTrackingCursorUpdate"];
|
||||
[v5 setViewColor:[CPColor greenColor]];
|
||||
[v5 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v5
|
||||
userInfo:nil];
|
||||
|
||||
[v5 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v5];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\nCPTrackingCursorUpdate\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v5 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseMoved & CPTrackingCursorUpdate
|
||||
|
||||
v6 = [[SensibleView alloc] initWithFrame:CGRectMake(680, 10, 50, 50)];
|
||||
|
||||
[v6 setViewName:@"CPTrackingMouseMoved+CPTrackingCursorUpdate"];
|
||||
[v6 setViewColor:[CPColor greenColor]];
|
||||
[v6 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseMoved | CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v6
|
||||
userInfo:nil];
|
||||
|
||||
[v6 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v6];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseMoved\nCPTrackingCursorUpdate\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v6 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseEnteredAndExited & CPTrackingMouseMoved
|
||||
|
||||
v7 = [[SensibleView alloc] initWithFrame:CGRectMake(810, 10, 50, 50)];
|
||||
|
||||
[v7 setViewName:@"CPTrackingMouseEnteredAndExited+CPTrackingMouseMoved"];
|
||||
[v7 setViewColor:[CPColor greenColor]];
|
||||
[v7 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v7
|
||||
userInfo:nil];
|
||||
|
||||
[v7 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v7];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\nCPTrackingMouseMoved\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v7 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingMouseEnteredAndExited & CPTrackingMouseMoved & CPTrackingCursorUpdate
|
||||
|
||||
v8 = [[SensibleView alloc] initWithFrame:CGRectMake(940, 10, 50, 50)];
|
||||
|
||||
[v8 setViewName:@"CPTrackingMouseEnteredAndExited+CPTrackingMouseMoved+CPTrackingCursorUpdate"];
|
||||
[v8 setViewColor:[CPColor greenColor]];
|
||||
[v8 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingMouseMoved | CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v8
|
||||
userInfo:nil];
|
||||
|
||||
[v8 addTrackingArea:t];
|
||||
|
||||
[p addSubview:v8];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\nCPTrackingMouseMoved\nCPTrackingCursorUpdate\nCPTrackingInVisibleRect"];
|
||||
|
||||
[l setCenter:CGPointMake([v8 center].x, 90)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// Not CPTrackingInVisibleRect
|
||||
|
||||
w2 = [[SensibleView alloc] initWithFrame:CGRectMake(160, 110, 50, 50)];
|
||||
|
||||
[w2 setViewName:@"Not CPTrackingInVisibleRect"];
|
||||
[w2 setViewColor:[CPColor greenColor]];
|
||||
[w2 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMake(0, 0, 25, 25)
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow
|
||||
owner:w2
|
||||
userInfo:nil];
|
||||
|
||||
[w2 addTrackingArea:t];
|
||||
|
||||
[p addSubview:w2];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\n(top-left quarter is the active area)"];
|
||||
|
||||
[l setCenter:CGPointMake([w2 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// CPTrackingEnabledDuringMouseDrag
|
||||
|
||||
w3 = [[SensibleView alloc] initWithFrame:CGRectMake(290, 110, 50, 50)];
|
||||
|
||||
[w3 setViewName:@"CPTrackingEnabledDuringMouseDrag"];
|
||||
[w3 setViewColor:[CPColor greenColor]];
|
||||
[w3 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect | CPTrackingEnabledDuringMouseDrag
|
||||
owner:w3
|
||||
userInfo:nil];
|
||||
|
||||
[w3 addTrackingArea:t];
|
||||
|
||||
[p addSubview:w3];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"CPTrackingMouseEnteredAndExited\nCPTrackingInVisibleRect\nCPTrackingEnabledDuringMouseDrag"];
|
||||
|
||||
[l setCenter:CGPointMake([w3 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// View in CPScrollView
|
||||
|
||||
[s1 setViewName:@"View in CPScrollView"];
|
||||
[s1 setViewColor:[CPColor greenColor]];
|
||||
[s1 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:s1
|
||||
userInfo:nil];
|
||||
|
||||
[s1 addTrackingArea:t];
|
||||
|
||||
// No itinial TA
|
||||
|
||||
w4 = [[SensibleViewAutoTA alloc] initWithFrame:CGRectMake(420, 110, 50, 50)];
|
||||
|
||||
[w4 setViewName:@"No itinial TA"];
|
||||
[w4 setViewColor:[CPColor greenColor]];
|
||||
[w4 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
[p addSubview:w4];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"This one has no initial\ntracking area but\nuses updateTrackingAreas to\nattach one"];
|
||||
|
||||
[l setCenter:CGPointMake([w4 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
// Two views with tracking areas where the owner is not the view itself
|
||||
|
||||
w5 = [[SensibleView alloc] initWithFrame:CGRectMake(550, 110, 50, 50)];
|
||||
|
||||
[w5 setViewName:@"firstView"];
|
||||
[w5 setViewColor:[CPColor greenColor]];
|
||||
[w5 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
[p addSubview:w5];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"(firstView)\nThis view has a tracking area\nowned by the blue view"];
|
||||
|
||||
[l setCenter:CGPointMake([w5 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
w6 = [[SensibleView alloc] initWithFrame:CGRectMake(680, 110, 50, 50)];
|
||||
|
||||
[w6 setViewName:@"secondView"];
|
||||
[w6 setViewColor:[CPColor greenColor]];
|
||||
[w6 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
[p addSubview:w6];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"(secondView)\nThis view has a tracking area\nowned by the blue view"];
|
||||
|
||||
[l setCenter:CGPointMake([w6 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
w7 = [[SensibleView alloc] initWithFrame:CGRectMake(810, 110, 50, 50)];
|
||||
|
||||
[w7 setViewName:@"masterView"];
|
||||
[w7 setViewColor:[CPColor blueColor]];
|
||||
[w7 setViewCursor:[CPCursor crosshairCursor]];
|
||||
|
||||
[p addSubview:w7];
|
||||
|
||||
var l = [CPTextField labelWithTitle:@"I'm the owner of the\ntracking areas of\nthe 2 views on my left"];
|
||||
|
||||
[l setCenter:CGPointMake([w7 center].x, 190)];
|
||||
[l setFont:[CPFont systemFontOfSize:8]];
|
||||
[l setAlignment:CPCenterTextAlignment];
|
||||
|
||||
[p addSubview:l];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:w7
|
||||
userInfo:@{ @"trigger": @"View 1" } ];
|
||||
|
||||
[w5 addTrackingArea:t];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:w7
|
||||
userInfo:@{ @"trigger": @"View 2" } ];
|
||||
|
||||
[w6 addTrackingArea:t];
|
||||
|
||||
|
||||
// Cursor update complex test
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
CPLog.trace("i="+i);
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake((i == 0 ? 50 : 20), (i == 0 ? 200 : 20), 400-(i*40), 400-(i*40))];
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake((i == 0 ? 50 : 20), (i == 0 ? 240 : 20), 400-(i*40), 400-(i*40))];
|
||||
|
||||
[p addSubview:v];
|
||||
p = v;
|
||||
@@ -43,7 +405,6 @@
|
||||
var c = [CPColor colorWithHexString:[CPString stringWithFormat:@"%d%d%d%d%d%d",i,i,i,i,i,i]];
|
||||
|
||||
[v setViewColor:c];
|
||||
[v setBackgroundColor:c];
|
||||
|
||||
switch (i)
|
||||
{
|
||||
@@ -60,7 +421,7 @@
|
||||
}
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveAlways | CPTrackingInVisibleRect
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect | CPTrackingEnabledDuringMouseDrag
|
||||
owner:v
|
||||
userInfo:nil];
|
||||
[v addTrackingArea:t];
|
||||
@@ -71,8 +432,7 @@
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
CPLog.trace("i="+i);
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake((i == 0 ? 460 : 0), (i == 0 ? 200 : 0), 400-(i*40), 400-(i*40))];
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake((i == 0 ? 460 : 0), (i == 0 ? 240 : 0), 400-(i*40), 400-(i*40))];
|
||||
|
||||
[p addSubview:v];
|
||||
p = v;
|
||||
@@ -82,7 +442,6 @@
|
||||
var c = [CPColor colorWithHexString:[CPString stringWithFormat:@"%d%d%d%d%d%d",i,i,i,i,i,i]];
|
||||
|
||||
[v setViewColor:c];
|
||||
[v setBackgroundColor:c];
|
||||
|
||||
switch (i)
|
||||
{
|
||||
@@ -99,7 +458,7 @@
|
||||
}
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveAlways | CPTrackingInVisibleRect
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v
|
||||
userInfo:nil];
|
||||
[v addTrackingArea:t];
|
||||
@@ -109,17 +468,16 @@
|
||||
|
||||
[item setTarget:self];
|
||||
[item setAction:@selector(addAView:)];
|
||||
[item setCenter:CGPointMake(455, 620)];
|
||||
[item setCenter:CGPointMake(455, 660)];
|
||||
|
||||
[[theWindow contentView] addSubview:item];
|
||||
}
|
||||
|
||||
- (void)addAView:(id)aSender
|
||||
{
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake(250, 400, 410, 200)];
|
||||
var v = [[SensibleView alloc] initWithFrame:CGRectMake(250, 440, 410, 200)];
|
||||
|
||||
var c = [CPColor colorWithHexString:@"c8d3b2"];
|
||||
[v setBackgroundColor:c];
|
||||
[v setViewColor:c];
|
||||
[v setViewName:@"overview"];
|
||||
[v setViewCursor:[CPCursor disappearingItemCursor]];
|
||||
@@ -127,7 +485,7 @@
|
||||
[v setAlphaValue:0.7];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingCursorUpdate | CPTrackingActiveAlways | CPTrackingInVisibleRect
|
||||
options:CPTrackingCursorUpdate | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:v
|
||||
userInfo:nil];
|
||||
[v addTrackingArea:t];
|
||||
@@ -142,24 +500,104 @@
|
||||
{
|
||||
CPString viewName @accessors;
|
||||
CPCursor viewCursor @accessors;
|
||||
CPColor viewColor @accessors;
|
||||
CPColor viewColor;
|
||||
CPTextField coords;
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
{
|
||||
self = [super initWithFrame:aFrame];
|
||||
|
||||
if (self)
|
||||
{
|
||||
coords = [CPTextField labelWithTitle:@"WWWW,WWWW"];
|
||||
[coords setFont:[CPFont systemFontOfSize:9]];
|
||||
[coords setAlignment:CPCenterTextAlignment];
|
||||
[coords setCenter:CGPointMake(25,25)];
|
||||
[coords setStringValue:@""];
|
||||
|
||||
[self addSubview:coords];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)mouseEntered:(CPEvent)anEvent
|
||||
{
|
||||
[self setBackgroundColor:[CPColor redColor]];
|
||||
|
||||
var trigger = [[[anEvent trackingArea] userInfo] valueForKey:@"trigger"];
|
||||
|
||||
if (trigger)
|
||||
[coords setStringValue:trigger];
|
||||
}
|
||||
|
||||
- (void)mouseExited:(CPEvent)anEvent
|
||||
{
|
||||
[self setBackgroundColor:viewColor];
|
||||
|
||||
[coords setStringValue:@""];
|
||||
}
|
||||
|
||||
- (void)mouseMoved:(CPEvent)anEvent
|
||||
{
|
||||
var l = [anEvent locationInWindow];
|
||||
|
||||
[coords setStringValue:[CPString stringWithFormat:@"%d,%d",l.x,l.y]];
|
||||
}
|
||||
|
||||
- (void)cursorUpdate:(CPEvent)anEvent
|
||||
{
|
||||
CPLog.trace("cursorUpdate in "+viewName);
|
||||
[viewCursor set];
|
||||
}
|
||||
|
||||
- (void)setViewColor:(CPColor)aColor
|
||||
{
|
||||
viewColor = aColor;
|
||||
[self setBackgroundColor:aColor];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SensibleViewTA : SensibleView
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
CPLog.trace("updateTrackingAreas for "+viewName);
|
||||
|
||||
var trackingAreas = [self trackingAreas];
|
||||
|
||||
for (var i = 0; i < trackingAreas.length; i++)
|
||||
[self removeTrackingArea:[trackingAreas objectAtIndex:i]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMake(0, 0, 25, 25)
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow
|
||||
owner:self
|
||||
userInfo:nil];
|
||||
|
||||
[self addTrackingArea:t];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation SensibleViewAutoTA : SensibleView
|
||||
|
||||
- (void)updateTrackingAreas
|
||||
{
|
||||
CPLog.trace("updateTrackingAreas for "+viewName);
|
||||
|
||||
var trackingAreas = [self trackingAreas];
|
||||
|
||||
for (var i = 0; i < trackingAreas.length; i++)
|
||||
[self removeTrackingArea:[trackingAreas objectAtIndex:i]];
|
||||
|
||||
var t = [[CPTrackingArea alloc] initWithRect:CGRectMakeZero()
|
||||
options:CPTrackingMouseEnteredAndExited | CPTrackingActiveInKeyWindow | CPTrackingInVisibleRect
|
||||
owner:self
|
||||
userInfo:nil];
|
||||
|
||||
[self addTrackingArea:t];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -280,17 +280,204 @@
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" topStrut="YES"/>
|
||||
<rect key="contentRect" x="119" y="946" width="480" height="360"/>
|
||||
<rect key="contentRect" x="119" y="946" width="1374" height="1031"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<view key="contentView" id="372">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="1374" height="1031"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<splitView arrangesAllSubviews="NO" dividerStyle="thin" vertical="YES" id="Gf7-bI-H4t">
|
||||
<rect key="frame" x="940" y="811" width="214" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<customView id="Sze-Eb-8Fx">
|
||||
<rect key="frame" x="0.0" y="0.0" width="59" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
|
||||
<color key="value" red="0.0" green="0.53140729870000003" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView id="59Y-bY-6NO">
|
||||
<rect key="frame" x="60" y="0.0" width="59" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
|
||||
<color key="value" red="0.56690436239999997" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView id="e86-da-1nH">
|
||||
<rect key="frame" x="120" y="0.0" width="94" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
|
||||
<color key="value" red="0.57639149440000004" green="0.59769631410000001" blue="0.53293551319999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<holdingPriorities>
|
||||
<real value="250"/>
|
||||
<real value="250"/>
|
||||
<real value="250"/>
|
||||
</holdingPriorities>
|
||||
</splitView>
|
||||
<splitView arrangesAllSubviews="NO" id="9ty-Ct-bpx">
|
||||
<rect key="frame" x="940" y="698" width="214" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<customView id="Eb6-2a-ijs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="214" height="45"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
|
||||
<color key="value" red="0.0" green="0.2389628775" blue="0.64796560400000003" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView id="sJR-ny-vXH">
|
||||
<rect key="frame" x="0.0" y="54" width="214" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="backgroundColor">
|
||||
<color key="value" red="0.4716600252" green="0.3736891779" blue="0.17221581380000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<holdingPriorities>
|
||||
<real value="250"/>
|
||||
<real value="250"/>
|
||||
</holdingPriorities>
|
||||
</splitView>
|
||||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="pZB-1q-EQ1">
|
||||
<rect key="frame" x="940" y="513" width="277" height="163"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<clipView key="contentView" id="Tsy-28-w1p">
|
||||
<rect key="frame" x="1" y="1" width="260" height="146"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view id="35c-jE-A9i">
|
||||
<rect key="frame" x="0.0" y="0.0" width="260" height="316"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<customView id="qhh-BF-uJV" customClass="SensibleView">
|
||||
<rect key="frame" x="56" y="16" width="163" height="96"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<animations/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</clipView>
|
||||
<animations/>
|
||||
<scroller key="horizontalScroller" verticalHuggingPriority="750" horizontal="YES" id="haI-QJ-idG">
|
||||
<rect key="frame" x="1" y="147" width="260" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="en7-ag-3l6">
|
||||
<rect key="frame" x="261" y="1" width="15" height="146"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<scrollView autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="F6I-OP-yvg">
|
||||
<rect key="frame" x="940" y="377" width="277" height="119"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<clipView key="contentView" id="mCM-Xi-afN">
|
||||
<rect key="frame" x="1" y="23" width="275" height="95"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" headerView="ZTR-Tg-hlW" id="soC-Ts-qCo">
|
||||
<rect key="frame" x="0.0" y="0.0" width="275" height="95"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn width="78.77734375" minWidth="40" maxWidth="1000" id="ce2-Dt-Q9a">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="First">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Mhu-mt-2hd">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
</tableColumn>
|
||||
<tableColumn width="106.203125" minWidth="40" maxWidth="1000" id="oyN-zb-Aen">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Second">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="POl-Ii-IlH">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
</tableColumn>
|
||||
<tableColumn width="81" minWidth="10" maxWidth="3.4028234663852886e+38" id="4WF-b2-Qjp">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Third">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="6Vv-pe-Az4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<animations/>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="vti-fg-vzI">
|
||||
<rect key="frame" x="1" y="231" width="307" height="15"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="EWM-fi-aQY">
|
||||
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</scroller>
|
||||
<tableHeaderView key="headerView" id="ZTR-Tg-hlW">
|
||||
<rect key="frame" x="0.0" y="0.0" width="275" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<animations/>
|
||||
</tableHeaderView>
|
||||
</scrollView>
|
||||
</subviews>
|
||||
<animations/>
|
||||
</view>
|
||||
<point key="canvasLocation" x="178" y="401"/>
|
||||
<point key="canvasLocation" x="625" y="736.5"/>
|
||||
</window>
|
||||
<customObject id="450" customClass="AppController">
|
||||
<connections>
|
||||
<outlet property="s1" destination="qhh-BF-uJV" id="L8n-I6-kzA"/>
|
||||
<outlet property="theWindow" destination="371" id="459"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
|
||||
Reference in New Issue
Block a user