From cbf3861dce4f2f41f9957655382b09d797d15cd4 Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Thu, 15 Jul 2004 22:00:50 +0000 Subject: [PATCH] Fix recognizing subproject files git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19740 72102866-910b-0410-8b05-ffd578937521 --- Documentation/ChangeLog | 14 +++ Library/PCButton.h | 12 +- Library/PCButton.m | 152 +++++++++++++----------- Library/PCProject.m | 9 ++ Library/PCProjectManager.m | 11 +- Library/PCProjectWindow.m | 5 +- Resources/Preferences.gorm/objects.gorm | Bin 25821 -> 25907 bytes 7 files changed, 118 insertions(+), 85 deletions(-) diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index f43db13..b31e6ab 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,3 +1,17 @@ +2004-07-15 Serg Stoyan + + * Library/PCProject.m: + (projectFileForFile:forKey:): Fix recognizing of subproject files. + + * Library/PCProjectManager.m: + (addProjectFiles):ditto. + +2004-07-14 Serg Stoyan + + * Library/PCButton.m: PCButtonCell removed. + (initWithFrame:): [self setCell:] removed. [_cell setGradientType:] + added. + 2004-07-04 Serg Stoyan * Library/PCProject.m: diff --git a/Library/PCButton.h b/Library/PCButton.h index c4bac8e..0950f1d 100644 --- a/Library/PCButton.h +++ b/Library/PCButton.h @@ -32,6 +32,8 @@ */ @interface PCButton : NSButton { + NSString *_toolTipText; + NSTrackingRectTag tRectTag; NSTimer *ttTimer; NSWindow *ttWindow; @@ -46,14 +48,4 @@ @end -/* - * Button Cell - */ -@interface PCButtonCell : NSButtonCell -{ - NSImage *tile; -} - -@end - #endif diff --git a/Library/PCButton.m b/Library/PCButton.m index 66b7d96..45b244f 100644 --- a/Library/PCButton.m +++ b/Library/PCButton.m @@ -30,7 +30,7 @@ - (id)initWithFrame:(NSRect)frameRect { self = [super initWithFrame:frameRect]; - [self setCell:[[PCButtonCell alloc] init]]; + [_cell setGradientType:NSGradientConvexWeak]; [self setImagePosition:NSImageOnly]; [self setFont:[NSFont systemFontOfSize: 10.0]]; @@ -168,6 +168,11 @@ // NSLog (@"-- invalidate"); [ttTimer invalidate]; ttTimer = nil; + + if (ttWindow && [ttWindow isVisible]) + { + [ttWindow orderOut:self]; + } } } @@ -195,78 +200,91 @@ } } -@end +// +// Tool Tips +// -@implementation PCButtonCell - -- (id)init +- (void)_invalidateToolTip:(NSTimer *)timer { - self = [super init]; - tile = [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] - pathForImageResource:@"ButtonTile"]]; + [timer invalidate]; + timer = nil; - return self; -} - -- (void)dealloc -{ - RELEASE(tile); - - [super dealloc]; -} - -- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView -{ - [super drawInteriorWithFrame: cellFrame inView: controlView]; - - if (!_cell.is_highlighted) + if (ttWindow && [ttWindow isVisible]) { - NSPoint position; - NSImage *imageToDisplay; - unsigned mask = 0; - - if ([controlView isFlipped]) - { - position = NSMakePoint(cellFrame.origin.x+1, - cellFrame.size.height-2); - } - else - { - position = NSMakePoint(1, 2); - } - - // Tile - [tile compositeToPoint:position - operation:NSCompositeSourceOver]; - - if (_cell.state) - mask = _showAltStateMask; - - // Image - [_cell_image setBackgroundColor:[NSColor clearColor]]; - [_altImage setBackgroundColor:[NSColor clearColor]]; - if (mask & NSContentsCellMask) - { - imageToDisplay = _altImage; - } - else - { - imageToDisplay = _cell_image; - } - - position.x = (cellFrame.size.width - [_cell_image size].width)/2; - position.y = (cellFrame.size.height - [_cell_image size].height)/2; - if (_cell.is_disabled) - { - [_cell_image dissolveToPoint:position fraction:0.5]; - } - else - { - [imageToDisplay compositeToPoint:position - operation:NSCompositeSourceOver]; - } + [ttWindow orderOut:self]; } } +- (NSToolTipTag) addToolTipRect: (NSRect)aRect + owner: (id)anObject + userData: (void *)data +{ + SEL ownerSelector = @selector(view:stringForToolTip:point:userData:); + +/* if (aRect == NSZeroRect) + { + return; + }*/ + + if (![anObject respondsToSelector:ownerSelector] + && ![anObject isKindOfClass:[NSString class]]) + { + return; + } + + tRectTag = [[self superview] addTrackingRect:aRect + owner:self + userData:data + assumeInside:NO]; + [[self window] setAcceptsMouseMovedEvents:YES]; + + if (ttTimer == nil) + { + ttTimer = [NSTimer + scheduledTimerWithTimeInterval:0.5 + target:self + selector:@selector(showTooltip:) + userInfo:nil + repeats:YES]; + } + + return 0; +} + +- (void) removeAllToolTips +{ +} + +- (void) removeToolTip: (NSToolTipTag)tag +{ +} + +- (void) setToolTip: (NSString *)string +{ + ASSIGN(_toolTipText, string); + + if (string == nil) + { + _hasTooltip = NO; + if (ttTimer != nil) + { + } + } + + if (_hasTooltip) + { + tRectTag = [[self superview] addTrackingRect:[self frame] + owner:self + userData:nil + assumeInside:NO]; + [[self window] setAcceptsMouseMovedEvents:YES]; + } +} + +- (NSString *) toolTip +{ + return _toolTipText; +} + @end diff --git a/Library/PCProject.m b/Library/PCProject.m index 688555b..cdd5eb2 100644 --- a/Library/PCProject.m +++ b/Library/PCProject.m @@ -623,11 +623,20 @@ NSString NSMutableString *projectFile = nil; NSString *path = nil; NSRange pathRange; + NSRange slashRange; path = [file stringByDeletingLastPathComponent]; pathRange = [path rangeOfString:projectPath]; if (pathRange.length) + { + slashRange.location = pathRange.length; + slashRange.length = 1; + } + + if (pathRange.length + && slashRange.location != [path length] + && [[path substringWithRange:slashRange] isEqualToString:@"/"]) { pathRange.length++; projectFile = [NSMutableString stringWithString:file]; diff --git a/Library/PCProjectManager.m b/Library/PCProjectManager.m index c587003..8b8b5e7 100644 --- a/Library/PCProjectManager.m +++ b/Library/PCProjectManager.m @@ -722,8 +722,8 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; NSString *category = [[project projectBrowser] nameOfSelectedCategory]; NSString *categoryKey = [activeProject keyForCategory:category]; NSMutableArray *files = nil; - NSString *path = nil; - NSRange pathRange; + NSString *file = nil; + NSString *projectFile = nil; files = [fileManager filesForAdd]; @@ -736,10 +736,11 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; return NO; } - path = [[files objectAtIndex:0] stringByDeletingLastPathComponent]; - pathRange = [path rangeOfString:[activeProject projectPath]]; + file = [[files objectAtIndex:0] lastPathComponent]; + projectFile = [activeProject projectFileFromFile:[files objectAtIndex:0] + forKey:categoryKey]; - if (pathRange.length) + if (![projectFile isEqualToString:file]) { [activeProject addFiles:files forKey:categoryKey notify:YES]; } diff --git a/Library/PCProjectWindow.m b/Library/PCProjectWindow.m index adb4e41..3e10fe4 100644 --- a/Library/PCProjectWindow.m +++ b/Library/PCProjectWindow.m @@ -720,12 +720,11 @@ PCProject *changedProject = [notifObject objectForKey:@"Project"]; if (changedProject != project - && changedProject != [project activeSubproject] - && [changedProject superProject] != [project activeSubproject]) + && changedProject != [project activeSubproject]) { return; } - + [self setTitle]; // TODO: if window isn't visible and "edited" attribute set, after ordering diff --git a/Resources/Preferences.gorm/objects.gorm b/Resources/Preferences.gorm/objects.gorm index c1d281d881d3e031f8b22ac0c793f89de315bf59..76d65f84727daa82f94451d4f29ba8bf3ff63393 100644 GIT binary patch delta 3258 zcmY+Hdr;KZ6~}+~f-Lg;Dd4ip%jL0)g0R4EH6qAMd8+|00SPaW1y-vfC=ValimxJE@QzpcX^U0UWsjLX&fK(_6_=4#zr;| zZBpn53L-AD_|Tn*pKvx0{85J@=IOa`Jl6`kGX|Des+bjaTCU;K9sLSRfZs%KWHuYv5zn`I9y*K06?4g6}I1+74hUJrNkb0hVJU;?NbIreJ( zhGV1Y7z6jTGQ+u17jU6E7h2~$!L-eDTO(|GC;Yy!CtB|cQts}Vko;H~(yebWLQcmX z#X581sLr^81o$9s1um5xf7V!P>rC9ecp0}%0dM80gKgfu2(chwVOQ4Si^D zW+;{=l`sW%CJk|{{d#H*lqAPS25tID$b7~MuKAOe7mcb;O=oA{g3Q|D82u%Z1E=&U z+4^Y=FLBgZ&je!@(!MXChkh0_eH;9aAR}?OPnUUV_*T4IJE4}PVQnaR)mch*f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