mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-20 18:32:17 +00:00
New tooltips code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19761 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2f4e4df656
commit
0296453981
12 changed files with 260 additions and 216 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2004-07-22 Serg Stoyan <stoyan255@ukr.net>
|
||||||
|
|
||||||
|
* Library/PCButton.m: Rewritten tooltips code. Almost ready for
|
||||||
|
incorporation into NSView.
|
||||||
|
|
||||||
|
* Library/PCProjectBuilder.m: Use new tooltip code and remove old
|
||||||
|
style code.
|
||||||
|
* Library/PCProjectLauncher.m: ditto.
|
||||||
|
* Library/PCProjectWindow.m: ditto.
|
||||||
|
|
||||||
|
|
||||||
2004-07-15 Serg Stoyan <stoyan255@ukr.net>
|
2004-07-15 Serg Stoyan <stoyan255@ukr.net>
|
||||||
|
|
||||||
* Library/PCProject.m:
|
* Library/PCProject.m:
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
ADDITIONAL_CPPFLAGS +=
|
ADDITIONAL_CPPFLAGS +=
|
||||||
|
|
||||||
# Additional flags to pass to the Objective-C compiler
|
# Additional flags to pass to the Objective-C compiler
|
||||||
ADDITIONAL_OBJCFLAGS +=
|
ADDITIONAL_OBJCFLAGS += -Wall -Werror
|
||||||
|
|
||||||
# Additional flags to pass to the C compiler
|
# Additional flags to pass to the C compiler
|
||||||
ADDITIONAL_CFLAGS +=
|
ADDITIONAL_CFLAGS +=
|
||||||
|
|
|
@ -32,20 +32,16 @@
|
||||||
*/
|
*/
|
||||||
@interface PCButton : NSButton
|
@interface PCButton : NSButton
|
||||||
{
|
{
|
||||||
NSString *_toolTipText;
|
NSToolTipTag mainToolTip;
|
||||||
|
|
||||||
NSTrackingRectTag tRectTag;
|
NSTimer *ttTimer;
|
||||||
NSTimer *ttTimer;
|
NSWindow *ttWindow;
|
||||||
NSWindow *ttWindow;
|
NSMutableDictionary *ttTitleAttrs;
|
||||||
NSPoint mouseLocation;
|
NSColor *ttBackground;
|
||||||
|
|
||||||
BOOL _hasTooltip;
|
BOOL _hasTooltips;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setShowTooltip:(BOOL)yn;
|
|
||||||
|
|
||||||
- (void)updateTrackingRect;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -25,8 +25,15 @@
|
||||||
#include "PCButton.h"
|
#include "PCButton.h"
|
||||||
#include "PCDefines.h"
|
#include "PCDefines.h"
|
||||||
|
|
||||||
|
#include "AppKit/NSBezierPath.h"
|
||||||
|
#include "GNUstepGUI/GSTrackingRect.h"
|
||||||
|
|
||||||
@implementation PCButton
|
@implementation PCButton
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// ==== Main
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
- (id)initWithFrame:(NSRect)frameRect
|
- (id)initWithFrame:(NSRect)frameRect
|
||||||
{
|
{
|
||||||
self = [super initWithFrame:frameRect];
|
self = [super initWithFrame:frameRect];
|
||||||
|
@ -36,254 +43,317 @@
|
||||||
|
|
||||||
ttTimer = nil;
|
ttTimer = nil;
|
||||||
ttWindow = nil;
|
ttWindow = nil;
|
||||||
|
ttTitleAttrs = [[NSMutableDictionary alloc] init];
|
||||||
|
[ttTitleAttrs setObject:[NSFont systemFontOfSize:10.0]
|
||||||
|
forKey:NSFontAttributeName];
|
||||||
|
ttBackground = [NSColor colorWithDeviceRed:1.0 green:1.0 blue:0.90 alpha:1.0];
|
||||||
|
RETAIN(ttBackground);
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter]
|
||||||
|
addObserver:self
|
||||||
|
selector:@selector(_updateTrackingRects:)
|
||||||
|
name:NSViewFrameDidChangeNotification
|
||||||
|
object:[[self window] contentView]];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)dealloc
|
- (void)dealloc
|
||||||
{
|
{
|
||||||
if (_hasTooltip)
|
if (_hasTooltips)
|
||||||
{
|
|
||||||
[[self superview] removeTrackingRect:tRectTag];
|
|
||||||
[ttTimer invalidate];
|
|
||||||
ttTimer = nil;
|
|
||||||
RELEASE(ttTimer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ttWindow != nil)
|
|
||||||
{
|
{
|
||||||
|
[self removeAllToolTips];
|
||||||
|
RELEASE(ttTitleAttrs);
|
||||||
|
RELEASE(ttBackground);
|
||||||
RELEASE(ttWindow);
|
RELEASE(ttWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setFrame:(NSRect)frameRect
|
// ============================================================================
|
||||||
{
|
// ==== Private methods
|
||||||
// NSLog (@"setFrame");
|
// ============================================================================
|
||||||
[super setFrame:frameRect];
|
|
||||||
|
|
||||||
if (_hasTooltip)
|
- (void)_updateTrackingRects:(NSNotification *)aNotif
|
||||||
|
{
|
||||||
|
NSTrackingRectTag tag;
|
||||||
|
NSRect rect;
|
||||||
|
NSString *string = nil;
|
||||||
|
int i, j;
|
||||||
|
GSTrackingRect *tr = nil;
|
||||||
|
|
||||||
|
if (_hasTooltips == NO)
|
||||||
{
|
{
|
||||||
[self updateTrackingRect];
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
j = [_tracking_rects count];
|
||||||
|
for (i = 0; i < j; i++)
|
||||||
|
{
|
||||||
|
tr = [_tracking_rects objectAtIndex:i];
|
||||||
|
|
||||||
|
// NSLog(@"PCButton: tr: %i data: %@", tr->tag, tr->user_data);
|
||||||
|
|
||||||
|
string = [(NSString *)tr->user_data copy];
|
||||||
|
|
||||||
|
rect = [self frame];
|
||||||
|
rect.origin.x = 0;
|
||||||
|
rect.origin.y = 0;
|
||||||
|
tag = [self addTrackingRect:rect
|
||||||
|
owner:self
|
||||||
|
userData:string
|
||||||
|
assumeInside:NO];
|
||||||
|
|
||||||
|
if (tr->tag == mainToolTip)
|
||||||
|
{
|
||||||
|
mainToolTip = tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
[self removeTrackingRect:tr->tag];
|
||||||
|
RELEASE(string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setShowTooltip:(BOOL)yn
|
- (void)_invalidateTimer
|
||||||
{
|
{
|
||||||
_hasTooltip = yn;
|
if (ttTimer == nil)
|
||||||
if (_hasTooltip)
|
|
||||||
{
|
{
|
||||||
tRectTag = [[self superview] addTrackingRect:[self frame]
|
return;
|
||||||
owner:self
|
}
|
||||||
userData:nil
|
|
||||||
assumeInside:NO];
|
// NSLog(@"_invalidateTimer");
|
||||||
[[self window] setAcceptsMouseMovedEvents:YES];
|
if ([ttTimer isValid])
|
||||||
|
{
|
||||||
|
[ttTimer invalidate];
|
||||||
|
}
|
||||||
|
ttTimer = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_closeToolTipWindow
|
||||||
|
{
|
||||||
|
if (ttWindow)
|
||||||
|
{
|
||||||
|
[ttWindow close];
|
||||||
|
ttWindow = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)updateTrackingRect
|
- (void)_drawToolTip:(NSAttributedString *)title
|
||||||
{
|
{
|
||||||
[[self superview] removeTrackingRect:tRectTag];
|
NSRectEdge sides[] = {NSMinXEdge, NSMaxYEdge, NSMaxXEdge, NSMinYEdge};
|
||||||
tRectTag = [[self superview] addTrackingRect:[self frame]
|
NSColor *black = [NSColor blackColor];
|
||||||
owner:self
|
NSColor *colors[] = {black, black, black, black};
|
||||||
userData:nil
|
NSRect bounds = [[ttWindow contentView] bounds];
|
||||||
assumeInside:NO];
|
NSRect titleRect;
|
||||||
|
|
||||||
|
titleRect = [ttWindow frame];
|
||||||
|
titleRect.origin.x = 2;
|
||||||
|
titleRect.origin.y = -2;
|
||||||
|
|
||||||
|
[[ttWindow contentView] lockFocus];
|
||||||
|
|
||||||
|
[title drawInRect:titleRect];
|
||||||
|
NSDrawColorTiledRects(bounds, bounds, sides, colors, 4);
|
||||||
|
|
||||||
|
[[ttWindow contentView] unlockFocus];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showTooltip:(NSTimer *)timer
|
- (void)_showTooltip:(NSTimer *)timer
|
||||||
{
|
{
|
||||||
NSAttributedString *attributedTitle = [self attributedTitle];
|
NSString *ttText = [timer userInfo];
|
||||||
NSSize titleSize = [attributedTitle size];
|
|
||||||
|
[self _invalidateTimer];
|
||||||
|
|
||||||
|
// NSLog(@"showTooltip: %@", ttText);
|
||||||
|
// NSLog(@"toolTips: %@", toolTips);
|
||||||
|
|
||||||
// NSLog (@"showTooltip");
|
|
||||||
if (ttWindow == nil)
|
if (ttWindow == nil)
|
||||||
{
|
{
|
||||||
NSTextField *ttText;
|
NSAttributedString *attributedTitle = nil;
|
||||||
NSRect windowRect;
|
NSSize titleSize;
|
||||||
NSRect titleRect;
|
NSPoint mouseLocation = [NSEvent mouseLocation];
|
||||||
NSRect contentRect;
|
NSRect windowRect;
|
||||||
|
|
||||||
windowRect = NSMakeRect(mouseLocation.x,
|
attributedTitle =
|
||||||
mouseLocation.y-16-(titleSize.height+3),
|
[[NSAttributedString alloc] initWithString:ttText
|
||||||
titleSize.width+10, titleSize.height+3);
|
attributes:ttTitleAttrs];
|
||||||
|
titleSize = [attributedTitle size];
|
||||||
|
|
||||||
titleRect = NSMakeRect(0,0, titleSize.width+10,titleSize.height+3);
|
// Window
|
||||||
/* windowRect = NSMakeRect(mouseLocation.x,
|
windowRect = NSMakeRect(mouseLocation.x + 8,
|
||||||
mouseLocation.y-16-(titleSize.height+3),
|
mouseLocation.y - 16 - (titleSize.height+3),
|
||||||
titleSize.width, titleSize.height);
|
titleSize.width + 4, titleSize.height + 4);
|
||||||
titleRect = NSMakeRect(0,0, titleSize.width,titleSize.height);*/
|
|
||||||
contentRect = [NSWindow frameRectForContentRect:titleRect
|
|
||||||
styleMask:NSBorderlessWindowMask];
|
|
||||||
|
|
||||||
ttWindow = [[NSWindow alloc] initWithContentRect:windowRect
|
ttWindow = [[NSWindow alloc] initWithContentRect:windowRect
|
||||||
styleMask:NSBorderlessWindowMask
|
styleMask:NSBorderlessWindowMask
|
||||||
backing:NSBackingStoreRetained
|
backing:NSBackingStoreRetained
|
||||||
defer:YES];
|
defer:YES];
|
||||||
|
[ttWindow setBackgroundColor:ttBackground];
|
||||||
|
[ttWindow setReleasedWhenClosed:YES];
|
||||||
[ttWindow setExcludedFromWindowsMenu:YES];
|
[ttWindow setExcludedFromWindowsMenu:YES];
|
||||||
|
[ttWindow setLevel:NSStatusWindowLevel];
|
||||||
|
|
||||||
ttText = [[NSTextField alloc] initWithFrame:contentRect];
|
[ttWindow orderFront:nil];
|
||||||
[ttText setEditable:NO];
|
|
||||||
[ttText setSelectable:NO];
|
[self _drawToolTip:attributedTitle];
|
||||||
[ttText setBezeled:NO];
|
RELEASE(attributedTitle);
|
||||||
[ttText setBordered:YES];
|
|
||||||
[ttText setBackgroundColor:[NSColor colorWithDeviceRed:1.0
|
|
||||||
green:1.0
|
|
||||||
blue:0.80
|
|
||||||
alpha:1.0]];
|
|
||||||
[ttText setFont:[self font]];
|
|
||||||
[ttText setStringValue:[self title]];
|
|
||||||
[[ttWindow contentView] addSubview:ttText];
|
|
||||||
}
|
|
||||||
else if (![ttWindow isVisible])
|
|
||||||
{
|
|
||||||
[ttWindow setFrameOrigin:
|
|
||||||
NSMakePoint(mouseLocation.x,
|
|
||||||
mouseLocation.y-16-(titleSize.height+3))];
|
|
||||||
[ttWindow orderFront:self];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// ==== Tool Tips
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
- (void)mouseEntered:(NSEvent *)theEvent
|
- (void)mouseEntered:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
// NSLog (@"mouseEntered");
|
NSLog (@"mouseEntered");
|
||||||
|
|
||||||
if (ttTimer == nil)
|
if (ttTimer == nil)
|
||||||
{
|
{
|
||||||
ttTimer = [NSTimer
|
// NSLog (@"mouseEntered: setTimer: %@", data);
|
||||||
scheduledTimerWithTimeInterval:0.5
|
ttTimer = [NSTimer scheduledTimerWithTimeInterval:0.5
|
||||||
target:self
|
target:self
|
||||||
selector:@selector(showTooltip:)
|
selector:@selector(_showTooltip:)
|
||||||
userInfo:nil
|
userInfo:[theEvent userData]
|
||||||
repeats:YES];
|
repeats:YES];
|
||||||
|
[[self window] setAcceptsMouseMovedEvents:YES];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseExited:(NSEvent *)theEvent
|
- (void)mouseExited:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
// NSLog (@"mouseExited");
|
// NSLog (@"mouseExited");
|
||||||
|
[self _invalidateTimer];
|
||||||
if (ttTimer != nil)
|
[self _closeToolTipWindow];
|
||||||
{
|
[[self window] setAcceptsMouseMovedEvents:NO];
|
||||||
// NSLog (@"-- invalidate");
|
|
||||||
[ttTimer invalidate];
|
|
||||||
ttTimer = nil;
|
|
||||||
|
|
||||||
if (ttWindow && [ttWindow isVisible])
|
|
||||||
{
|
|
||||||
[ttWindow orderOut:self];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseDown:(NSEvent *)theEvent
|
- (void)mouseDown:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
// NSLog (@"mouseDown");
|
// NSLog (@"mouseDown");
|
||||||
|
[self _invalidateTimer];
|
||||||
if (ttTimer != nil)
|
[self _closeToolTipWindow];
|
||||||
{
|
|
||||||
// NSLog (@"-- invalidate");
|
|
||||||
[ttTimer invalidate];
|
|
||||||
ttTimer = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
[super mouseDown:theEvent];
|
[super mouseDown:theEvent];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseMoved:(NSEvent *)theEvent
|
- (void)mouseMoved:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
NSPoint mouseLocation;
|
||||||
|
NSPoint origin;
|
||||||
|
|
||||||
|
// NSLog(@"mouseMoved");
|
||||||
mouseLocation = [NSEvent mouseLocation];
|
mouseLocation = [NSEvent mouseLocation];
|
||||||
// NSLog (@"mouseMoved %f %f", mouseLocation.x, mouseLocation.y);
|
|
||||||
if (ttWindow && [ttWindow isVisible])
|
|
||||||
{
|
|
||||||
[ttWindow orderOut:self];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Tool Tips
|
|
||||||
//
|
|
||||||
|
|
||||||
- (void)_invalidateToolTip:(NSTimer *)timer
|
|
||||||
{
|
|
||||||
[timer invalidate];
|
|
||||||
timer = nil;
|
|
||||||
|
|
||||||
if (ttWindow && [ttWindow isVisible])
|
|
||||||
{
|
|
||||||
[ttWindow orderOut:self];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSToolTipTag) addToolTipRect: (NSRect)aRect
|
|
||||||
owner: (id)anObject
|
|
||||||
userData: (void *)data
|
|
||||||
{
|
|
||||||
SEL ownerSelector = @selector(view:stringForToolTip:point:userData:);
|
|
||||||
|
|
||||||
/* if (aRect == NSZeroRect)
|
origin = NSMakePoint(mouseLocation.x + 8,
|
||||||
{
|
mouseLocation.y - 16 - [ttWindow frame].size.height);
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
[ttWindow setFrameOrigin:origin];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSToolTipTag)addToolTipRect:(NSRect)aRect
|
||||||
|
owner:(id)anObject
|
||||||
|
userData:(void *)data
|
||||||
|
{
|
||||||
|
SEL ownerSelector;
|
||||||
|
NSTrackingRectTag tag;
|
||||||
|
|
||||||
|
if (NSEqualRects(aRect,NSZeroRect) || ttTimer != nil)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ownerSelector = @selector(view:stringForToolTip:point:userData:);
|
||||||
if (![anObject respondsToSelector:ownerSelector]
|
if (![anObject respondsToSelector:ownerSelector]
|
||||||
&& ![anObject isKindOfClass:[NSString class]])
|
&& ![anObject isKindOfClass:[NSString class]])
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set rect tracking
|
||||||
|
tag = [[self superview] addTrackingRect:aRect
|
||||||
|
owner:self
|
||||||
|
userData:data
|
||||||
|
assumeInside:NO];
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeToolTip:(NSToolTipTag)tag
|
||||||
|
{
|
||||||
|
[self removeTrackingRect:tag];
|
||||||
|
// [toolTips removeObjectForKey:[NSNumber numberWithInt:tag]];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeAllToolTips
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
GSTrackingRect *tr = nil;
|
||||||
|
|
||||||
|
if (_hasTooltips == NO)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tRectTag = [[self superview] addTrackingRect:aRect
|
[self _invalidateTimer];
|
||||||
owner:self
|
[self _closeToolTipWindow];
|
||||||
userData:data
|
|
||||||
assumeInside:NO];
|
j = [_tracking_rects count];
|
||||||
[[self window] setAcceptsMouseMovedEvents:YES];
|
for (i = 0; i < j; i++)
|
||||||
|
|
||||||
if (ttTimer == nil)
|
|
||||||
{
|
{
|
||||||
ttTimer = [NSTimer
|
tr = [_tracking_rects objectAtIndex:i];
|
||||||
scheduledTimerWithTimeInterval:0.5
|
[self removeTrackingRect:tr->tag];
|
||||||
target:self
|
|
||||||
selector:@selector(showTooltip:)
|
|
||||||
userInfo:nil
|
|
||||||
repeats:YES];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
mainToolTip = -1;
|
||||||
|
_hasTooltips = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) removeAllToolTips
|
- (void)setToolTip:(NSString *)string
|
||||||
{
|
{
|
||||||
}
|
NSTrackingRectTag tag;
|
||||||
|
NSRect rect;
|
||||||
- (void) removeToolTip: (NSToolTipTag)tag
|
|
||||||
{
|
if (string == nil) // Remove tooltip
|
||||||
}
|
|
||||||
|
|
||||||
- (void) setToolTip: (NSString *)string
|
|
||||||
{
|
|
||||||
ASSIGN(_toolTipText, string);
|
|
||||||
|
|
||||||
if (string == nil)
|
|
||||||
{
|
{
|
||||||
_hasTooltip = NO;
|
if (_hasTooltips)
|
||||||
if (ttTimer != nil)
|
|
||||||
{
|
{
|
||||||
|
[self _invalidateTimer];
|
||||||
|
[self _closeToolTipWindow];
|
||||||
|
[self removeToolTip:mainToolTip];
|
||||||
|
mainToolTip = -1;
|
||||||
|
_hasTooltips = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (_hasTooltip)
|
|
||||||
{
|
{
|
||||||
tRectTag = [[self superview] addTrackingRect:[self frame]
|
// NSLog(@"setToolTip");
|
||||||
owner:self
|
rect = [self frame];
|
||||||
userData:nil
|
rect.origin.x = 0;
|
||||||
assumeInside:NO];
|
rect.origin.y = 0;
|
||||||
[[self window] setAcceptsMouseMovedEvents:YES];
|
tag = [self addTrackingRect:rect
|
||||||
|
owner:self
|
||||||
|
userData:string
|
||||||
|
assumeInside:NO];
|
||||||
|
_hasTooltips = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) toolTip
|
- (NSString *)toolTip
|
||||||
{
|
{
|
||||||
return _toolTipText;
|
NSEnumerator *enumerator = [_tracking_rects objectEnumerator];
|
||||||
|
GSTrackingRect *tr = nil;
|
||||||
|
|
||||||
|
while ((tr = [enumerator nextObject]))
|
||||||
|
{
|
||||||
|
if (tr->tag == mainToolTip)
|
||||||
|
{
|
||||||
|
return tr->user_data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -679,7 +679,7 @@ NSString
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (key = [keyEnum nextObject])
|
while ((key = [keyEnum nextObject]))
|
||||||
{
|
{
|
||||||
projectFiles = [projectDict objectForKey:key];
|
projectFiles = [projectDict objectForKey:key];
|
||||||
if ([projectFiles containsObject:pFile])
|
if ([projectFiles containsObject:pFile])
|
||||||
|
@ -1322,8 +1322,6 @@ NSString
|
||||||
- (BOOL)hasChildrenAtCategoryPath:(NSString *)categoryPath
|
- (BOOL)hasChildrenAtCategoryPath:(NSString *)categoryPath
|
||||||
{
|
{
|
||||||
NSString *listEntry = nil;
|
NSString *listEntry = nil;
|
||||||
NSString *categoryKey = nil;
|
|
||||||
NSString *category = nil;
|
|
||||||
PCProject *activeProject = [projectManager activeProject];
|
PCProject *activeProject = [projectManager activeProject];
|
||||||
|
|
||||||
if (self != activeProject)
|
if (self != activeProject)
|
||||||
|
|
|
@ -228,8 +228,6 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
||||||
|
|
||||||
- (BOOL)setPath:(NSString *)path
|
- (BOOL)setPath:(NSString *)path
|
||||||
{
|
{
|
||||||
int selectedColumn;
|
|
||||||
NSMatrix *columnMatrix = nil;
|
|
||||||
BOOL res;
|
BOOL res;
|
||||||
|
|
||||||
if ([[browser path] isEqualToString: path])
|
if ([[browser path] isEqualToString: path])
|
||||||
|
|
|
@ -71,7 +71,6 @@
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
- (NSView *)componentView;
|
- (NSView *)componentView;
|
||||||
- (void)setTooltips;
|
|
||||||
|
|
||||||
// --- Accessory
|
// --- Accessory
|
||||||
- (BOOL)isBuilding;
|
- (BOOL)isBuilding;
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
* 4 build Buttons
|
* 4 build Buttons
|
||||||
*/
|
*/
|
||||||
buildButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,271,43,43)];
|
buildButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,271,43,43)];
|
||||||
[buildButton setTitle: @"Build"];
|
[buildButton setToolTip: @"Build"];
|
||||||
[buildButton setImage: IMAGE(@"Build")];
|
[buildButton setImage: IMAGE(@"Build")];
|
||||||
[buildButton setAlternateImage: IMAGE(@"Stop")];
|
[buildButton setAlternateImage: IMAGE(@"Stop")];
|
||||||
[buildButton setTarget: self];
|
[buildButton setTarget: self];
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
RELEASE (buildButton);
|
RELEASE (buildButton);
|
||||||
|
|
||||||
cleanButton = [[PCButton alloc] initWithFrame: NSMakeRect(44,271,43,43)];
|
cleanButton = [[PCButton alloc] initWithFrame: NSMakeRect(44,271,43,43)];
|
||||||
[cleanButton setTitle: @"Clean"];
|
[cleanButton setToolTip: @"Clean"];
|
||||||
[cleanButton setImage: IMAGE(@"Clean")];
|
[cleanButton setImage: IMAGE(@"Clean")];
|
||||||
[cleanButton setAlternateImage: IMAGE(@"Stop")];
|
[cleanButton setAlternateImage: IMAGE(@"Stop")];
|
||||||
[cleanButton setTarget: self];
|
[cleanButton setTarget: self];
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
RELEASE (cleanButton);
|
RELEASE (cleanButton);
|
||||||
|
|
||||||
installButton = [[PCButton alloc] initWithFrame: NSMakeRect(88,271,43,43)];
|
installButton = [[PCButton alloc] initWithFrame: NSMakeRect(88,271,43,43)];
|
||||||
[installButton setTitle: @"Install"];
|
[installButton setToolTip: @"Install"];
|
||||||
[installButton setImage: IMAGE(@"Install")];
|
[installButton setImage: IMAGE(@"Install")];
|
||||||
[installButton setAlternateImage: IMAGE(@"Stop")];
|
[installButton setAlternateImage: IMAGE(@"Stop")];
|
||||||
[installButton setTarget: self];
|
[installButton setTarget: self];
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
RELEASE (installButton);
|
RELEASE (installButton);
|
||||||
|
|
||||||
optionsButton = [[PCButton alloc] initWithFrame: NSMakeRect(132,271,43,43)];
|
optionsButton = [[PCButton alloc] initWithFrame: NSMakeRect(132,271,43,43)];
|
||||||
[optionsButton setTitle: @"Options"];
|
[optionsButton setToolTip: @"Options"];
|
||||||
[optionsButton setImage: IMAGE(@"Options")];
|
[optionsButton setImage: IMAGE(@"Options")];
|
||||||
[optionsButton setTarget: self];
|
[optionsButton setTarget: self];
|
||||||
[optionsButton setAction: @selector(showOptionsPanel:)];
|
[optionsButton setAction: @selector(showOptionsPanel:)];
|
||||||
|
@ -407,14 +407,6 @@
|
||||||
return componentView;
|
return componentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setTooltips
|
|
||||||
{
|
|
||||||
[buildButton setShowTooltip:NO];
|
|
||||||
[cleanButton setShowTooltip:NO];
|
|
||||||
[installButton setShowTooltip:NO];
|
|
||||||
[optionsButton setShowTooltip:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- Accessory
|
// --- Accessory
|
||||||
- (BOOL)isBuilding
|
- (BOOL)isBuilding
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,7 +55,6 @@
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
- (NSView *) componentView;
|
- (NSView *) componentView;
|
||||||
- (void)setTooltips;
|
|
||||||
|
|
||||||
- (BOOL)isRunning;
|
- (BOOL)isRunning;
|
||||||
- (BOOL)isDebugging;
|
- (BOOL)isDebugging;
|
||||||
|
|
|
@ -175,12 +175,6 @@ enum {
|
||||||
return componentView;
|
return componentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setTooltips
|
|
||||||
{
|
|
||||||
[runButton setShowTooltip:YES];
|
|
||||||
[debugButton setShowTooltip:YES];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)isRunning
|
- (BOOL)isRunning
|
||||||
{
|
{
|
||||||
return _isRunning;
|
return _isRunning;
|
||||||
|
|
|
@ -63,12 +63,7 @@
|
||||||
[filesList setHeaderView:nil];
|
[filesList setHeaderView:nil];
|
||||||
[filesList addTableColumn:filesColumn];
|
[filesList addTableColumn:filesColumn];
|
||||||
[filesList setDataSource:self];
|
[filesList setDataSource:self];
|
||||||
/* [filesList setBackgroundColor: [NSColor colorWithDeviceRed:0.88
|
[filesList setDrawsGrid:NO];
|
||||||
green:0.76
|
|
||||||
blue:0.60
|
|
||||||
alpha:1.0]];*/
|
|
||||||
// Hack! Should be [filesList setDrawsGrid:NO]
|
|
||||||
[filesList setGridColor: [NSColor lightGrayColor]];
|
|
||||||
[filesList setTarget:self];
|
[filesList setTarget:self];
|
||||||
[filesList setDoubleAction:@selector(doubleClick:)];
|
[filesList setDoubleAction:@selector(doubleClick:)];
|
||||||
[filesList setAction:@selector(click:)];
|
[filesList setAction:@selector(click:)];
|
||||||
|
|
|
@ -105,62 +105,57 @@
|
||||||
|
|
||||||
buildButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,5,43,43)];
|
buildButton = [[PCButton alloc] initWithFrame: NSMakeRect(0,5,43,43)];
|
||||||
[buildButton setRefusesFirstResponder:YES];
|
[buildButton setRefusesFirstResponder:YES];
|
||||||
[buildButton setTitle: @"Build"];
|
[buildButton setToolTip: @"Build"];
|
||||||
[buildButton setImage: IMAGE(@"Build")];
|
[buildButton setImage: IMAGE(@"Build")];
|
||||||
[buildButton setTarget: self];
|
[buildButton setTarget: self];
|
||||||
[buildButton setAction: @selector(showProjectBuild:)];
|
[buildButton setAction: @selector(showProjectBuild:)];
|
||||||
[buildButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
[buildButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
[buildButton setButtonType: NSMomentaryPushButton];
|
[buildButton setButtonType: NSMomentaryPushButton];
|
||||||
[toolbarView addSubview: buildButton];
|
[toolbarView addSubview: buildButton];
|
||||||
// [buildButton setShowTooltip:YES];
|
|
||||||
RELEASE (buildButton);
|
RELEASE (buildButton);
|
||||||
|
|
||||||
launchButton = [[PCButton alloc] initWithFrame: NSMakeRect(44,5,43,43)];
|
launchButton = [[PCButton alloc] initWithFrame: NSMakeRect(44,5,43,43)];
|
||||||
[launchButton setRefusesFirstResponder:YES];
|
[launchButton setRefusesFirstResponder:YES];
|
||||||
[launchButton setTitle: @"Launch/Debug"];
|
[launchButton setToolTip: @"Launch/Debug"];
|
||||||
[launchButton setImage: IMAGE(@"Run")];
|
[launchButton setImage: IMAGE(@"Run")];
|
||||||
[launchButton setTarget: self];
|
[launchButton setTarget: self];
|
||||||
[launchButton setAction: @selector(showProjectLaunch:)];
|
[launchButton setAction: @selector(showProjectLaunch:)];
|
||||||
[launchButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
[launchButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
[launchButton setButtonType: NSMomentaryPushButton];
|
[launchButton setButtonType: NSMomentaryPushButton];
|
||||||
[toolbarView addSubview: launchButton];
|
[toolbarView addSubview: launchButton];
|
||||||
// [launchButton setShowTooltip:YES];
|
|
||||||
RELEASE (launchButton);
|
RELEASE (launchButton);
|
||||||
|
|
||||||
editorButton = [[PCButton alloc] initWithFrame: NSMakeRect(88,5,43,43)];
|
editorButton = [[PCButton alloc] initWithFrame: NSMakeRect(88,5,43,43)];
|
||||||
[editorButton setRefusesFirstResponder:YES];
|
[editorButton setRefusesFirstResponder:YES];
|
||||||
[editorButton setTitle: @"Editor"];
|
[editorButton setToolTip: @"Editor"];
|
||||||
[editorButton setImage: IMAGE(@"Editor")];
|
[editorButton setImage: IMAGE(@"Editor")];
|
||||||
[editorButton setTarget: self];
|
[editorButton setTarget: self];
|
||||||
[editorButton setAction: @selector(showProjectEditor:)];
|
[editorButton setAction: @selector(showProjectEditor:)];
|
||||||
[editorButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
[editorButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
[editorButton setButtonType: NSMomentaryPushButton];
|
[editorButton setButtonType: NSMomentaryPushButton];
|
||||||
[toolbarView addSubview: editorButton];
|
[toolbarView addSubview: editorButton];
|
||||||
// [editorButton setShowTooltip:YES];
|
|
||||||
RELEASE (editorButton);
|
RELEASE (editorButton);
|
||||||
|
|
||||||
findButton = [[PCButton alloc] initWithFrame: NSMakeRect(132,5,43,43)];
|
findButton = [[PCButton alloc] initWithFrame: NSMakeRect(132,5,43,43)];
|
||||||
[findButton setRefusesFirstResponder:YES];
|
[findButton setRefusesFirstResponder:YES];
|
||||||
[findButton setTitle: @"Find"];
|
[findButton setToolTip: @"Find"];
|
||||||
[findButton setImage: IMAGE(@"Find")];
|
[findButton setImage: IMAGE(@"Find")];
|
||||||
[findButton setTarget: project];
|
[findButton setTarget: project];
|
||||||
[findButton setAction: @selector(showFindView:)];
|
[findButton setAction: @selector(showFindView:)];
|
||||||
[findButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
[findButton setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
[findButton setButtonType: NSMomentaryPushButton];
|
[findButton setButtonType: NSMomentaryPushButton];
|
||||||
[toolbarView addSubview: findButton];
|
[toolbarView addSubview: findButton];
|
||||||
// [findButton setShowTooltip:YES];
|
|
||||||
RELEASE (findButton);
|
RELEASE (findButton);
|
||||||
|
|
||||||
inspectorButton = [[PCButton alloc] initWithFrame: NSMakeRect(176,5,43,43)];
|
inspectorButton = [[PCButton alloc] initWithFrame: NSMakeRect(176,5,43,43)];
|
||||||
[inspectorButton setRefusesFirstResponder:YES];
|
[inspectorButton setRefusesFirstResponder:YES];
|
||||||
[inspectorButton setTitle: @"Inspector"];
|
[inspectorButton setToolTip: @"Inspector"];
|
||||||
[inspectorButton setImage: IMAGE(@"Inspector")];
|
[inspectorButton setImage: IMAGE(@"Inspector")];
|
||||||
[inspectorButton setTarget: [project projectManager]];
|
[inspectorButton setTarget: [project projectManager]];
|
||||||
[inspectorButton setAction: @selector(showProjectInspector:)];
|
[inspectorButton setAction: @selector(showProjectInspector:)];
|
||||||
[inspectorButton setAutoresizingMask:(NSViewMaxXMargin | NSViewMinYMargin)];
|
[inspectorButton setAutoresizingMask:(NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
[inspectorButton setButtonType: NSMomentaryPushButton];
|
[inspectorButton setButtonType: NSMomentaryPushButton];
|
||||||
[toolbarView addSubview: inspectorButton];
|
[toolbarView addSubview: inspectorButton];
|
||||||
// [inspectorButton setShowTooltip:YES];
|
|
||||||
RELEASE (inspectorButton);
|
RELEASE (inspectorButton);
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,6 +552,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[componentView setBorderType:NSBezelBorder];
|
[componentView setBorderType:NSBezelBorder];
|
||||||
|
[componentView setFrame:NSMakeRect(0,0,128,130)];
|
||||||
[v_split addSubview:[[project projectLoadedFiles] componentView]];
|
[v_split addSubview:[[project projectLoadedFiles] componentView]];
|
||||||
[v_split adjustSubviews];
|
[v_split adjustSubviews];
|
||||||
}
|
}
|
||||||
|
@ -590,8 +586,6 @@
|
||||||
}
|
}
|
||||||
[self setCustomContentView:view];
|
[self setCustomContentView:view];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[project projectBuilder] setTooltips];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showProjectLaunch:(id)sender
|
- (void)showProjectLaunch:(id)sender
|
||||||
|
@ -619,8 +613,6 @@
|
||||||
}
|
}
|
||||||
[self setCustomContentView:view];
|
[self setCustomContentView:view];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[project projectLauncher] setTooltips];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)showProjectEditor:(id)sender
|
- (void)showProjectEditor:(id)sender
|
||||||
|
|
Loading…
Reference in a new issue