mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
Updated the AUTHORS file and applied David Ayers' patch.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@14658 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b366475795
commit
6180a9b078
8 changed files with 352 additions and 285 deletions
2
AUTHORS
2
AUTHORS
|
@ -2,3 +2,5 @@ Philippe C.D. Robert
|
|||
Adam Fedor
|
||||
Pierre-Yves Rivaille
|
||||
Nicola Perot
|
||||
Richard Frith-Macdonald
|
||||
David Ayers
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
@interface PCEditor : NSObject
|
||||
{
|
||||
PCEditorView *iView;
|
||||
PCEditorView *eView;
|
||||
NSTextStorage *storage;
|
||||
NSWindow *window;
|
||||
NSMutableString *path;
|
||||
PCEditorView *_iView; // internal (embedded) view
|
||||
PCEditorView *_eView; // external (window) view
|
||||
NSTextStorage *_storage;
|
||||
NSWindow *_window;
|
||||
NSMutableString *_path;
|
||||
|
||||
id delegate;
|
||||
id _delegate;
|
||||
|
||||
BOOL isEdited;
|
||||
BOOL _isEdited;
|
||||
}
|
||||
|
||||
- (id)initWithPath:(NSString*)file;
|
||||
|
|
372
PCLib/PCEditor.m
372
PCLib/PCEditor.m
|
@ -1,3 +1,4 @@
|
|||
|
||||
/*
|
||||
* PCEditor.m created by probert on 2002-01-29 20:37:27 +0000
|
||||
*
|
||||
|
@ -18,6 +19,7 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
@interface PCEditor (InitUI)
|
||||
|
||||
- (void)_initUI;
|
||||
- (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -26,104 +28,110 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
- (void)_initUI
|
||||
{
|
||||
NSScrollView *scrollView;
|
||||
NSLayoutManager *lm;
|
||||
NSTextContainer *tc;
|
||||
unsigned int style = NSTitledWindowMask
|
||||
| NSClosableWindowMask
|
||||
| NSMiniaturizableWindowMask
|
||||
| NSResizableWindowMask;
|
||||
unsigned int style;
|
||||
NSRect rect;
|
||||
|
||||
NSRect rect = NSMakeRect(100,100,512,320);
|
||||
/*
|
||||
* Creating shared text storage
|
||||
*/
|
||||
|
||||
window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:style
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
_storage = [[NSTextStorage alloc] init];
|
||||
|
||||
[window setReleasedWhenClosed:NO];
|
||||
[window setMinSize:NSMakeSize(512,320)];
|
||||
/*
|
||||
* Creating external view's window
|
||||
*
|
||||
* FIXME: this still is untested as I <d.ayers@inode.at>
|
||||
* haven't found the way to display the external window yet. :-(
|
||||
*/
|
||||
|
||||
rect = [[window contentView] frame];
|
||||
rect.origin.x = -1;
|
||||
rect.origin.y = -1;
|
||||
rect.size.width += 2;
|
||||
style = NSTitledWindowMask
|
||||
| NSClosableWindowMask
|
||||
| NSMiniaturizableWindowMask
|
||||
| NSResizableWindowMask;
|
||||
rect = NSMakeRect(100,100,512,320);
|
||||
|
||||
_window = [[NSWindow alloc] initWithContentRect:rect
|
||||
styleMask:style
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES];
|
||||
[_window setReleasedWhenClosed:NO];
|
||||
[_window setMinSize:NSMakeSize(512,320)];
|
||||
rect = [[_window contentView] frame];
|
||||
|
||||
/*
|
||||
* Creating external view's scroll view
|
||||
*/
|
||||
|
||||
scrollView = [[NSScrollView alloc] initWithFrame:rect];
|
||||
[scrollView setHasHorizontalScroller: NO];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
[scrollView setAutoresizingMask: (NSViewWidthSizable|NSViewHeightSizable)];
|
||||
rect = [[scrollView contentView] frame];
|
||||
|
||||
// Now the text editing stuff
|
||||
storage = [[NSTextStorage alloc] init];
|
||||
|
||||
lm = [[NSLayoutManager alloc] init];
|
||||
/*
|
||||
* Creating external view
|
||||
*/
|
||||
|
||||
rect.origin.x = 0;
|
||||
rect.origin.y = 0;
|
||||
rect.size.height -= 24;
|
||||
rect.size.width -= 4;
|
||||
_eView = [self _createEditorViewWithFrame:rect];
|
||||
|
||||
tc = [[NSTextContainer alloc] initWithContainerSize:rect.size];
|
||||
[lm addTextContainer:tc];
|
||||
RELEASE(tc);
|
||||
|
||||
[storage addLayoutManager:lm];
|
||||
RELEASE(lm);
|
||||
|
||||
iView = [[PCEditorView alloc] initWithFrame:rect
|
||||
textContainer:tc];
|
||||
[iView setEditor:self];
|
||||
|
||||
[iView setMinSize:NSMakeSize (0, 0)];
|
||||
[iView setMaxSize:NSMakeSize(1e7, 1e7)];
|
||||
[iView setRichText:YES];
|
||||
[iView setUsesFontPanel:YES];
|
||||
[iView setEditable:YES];
|
||||
[iView setSelectable:YES];
|
||||
[iView setVerticallyResizable:YES];
|
||||
[iView setHorizontallyResizable:NO];
|
||||
[iView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||
[iView setBackgroundColor:[NSColor whiteColor]];
|
||||
[[iView textContainer] setWidthTracksTextView:YES];
|
||||
|
||||
lm = [[NSLayoutManager alloc] init];
|
||||
|
||||
tc = [[NSTextContainer alloc] initWithContainerSize:rect.size];
|
||||
[lm addTextContainer:tc];
|
||||
RELEASE(tc);
|
||||
|
||||
[storage addLayoutManager:lm];
|
||||
RELEASE(lm);
|
||||
|
||||
eView = [[PCEditorView alloc] initWithFrame:rect
|
||||
textContainer:tc];
|
||||
[eView setEditor:self];
|
||||
|
||||
[eView setMinSize: NSMakeSize (0, 0)];
|
||||
[eView setMaxSize:NSMakeSize(1e7, 1e7)];
|
||||
[eView setRichText:YES];
|
||||
[eView setUsesFontPanel:YES];
|
||||
[eView setEditable:YES];
|
||||
[eView setSelectable:YES];
|
||||
[eView setVerticallyResizable:YES];
|
||||
[eView setHorizontallyResizable:NO];
|
||||
[eView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||
[eView setBackgroundColor:[NSColor whiteColor]];
|
||||
[[eView textContainer] setWidthTracksTextView:YES];
|
||||
|
||||
[scrollView setDocumentView:eView];
|
||||
RELEASE(eView);
|
||||
|
||||
rect.size = NSMakeSize([scrollView contentSize].width,1e7);
|
||||
[[eView textContainer] setContainerSize:rect.size];
|
||||
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
[scrollView setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
||||
|
||||
[window setContentView:scrollView];
|
||||
[window setDelegate:self];
|
||||
[window makeFirstResponder:eView];
|
||||
/*
|
||||
* Setting up external view / scroll view / window
|
||||
*/
|
||||
|
||||
[scrollView setDocumentView:_eView];
|
||||
[_window setContentView:scrollView];
|
||||
[_window setDelegate:self];
|
||||
[_window makeFirstResponder:_eView];
|
||||
RELEASE(scrollView);
|
||||
|
||||
/*
|
||||
* Creating internal view
|
||||
*
|
||||
* The width is actually irrelavent here as the the PCProjectEditor
|
||||
* will reset it to the width of the content view if its scroll view.
|
||||
* The height should be large as this will be the height it will be
|
||||
* will be visible.
|
||||
*/
|
||||
|
||||
rect = NSMakeRect( 0, 0, 1e7, 1e7);
|
||||
_iView = [self _createEditorViewWithFrame:rect];
|
||||
RETAIN(_iView);
|
||||
}
|
||||
|
||||
- (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr
|
||||
{
|
||||
PCEditorView *ev;
|
||||
NSTextContainer *tc;
|
||||
NSLayoutManager *lm;
|
||||
|
||||
/*
|
||||
* setting up the objects needed to manage the view but using the
|
||||
* shared textStorage.
|
||||
*/
|
||||
|
||||
lm = [[NSLayoutManager alloc] init];
|
||||
tc = [[NSTextContainer alloc] initWithContainerSize:fr.size];
|
||||
[lm addTextContainer:tc];
|
||||
RELEASE(tc);
|
||||
|
||||
[_storage addLayoutManager:lm];
|
||||
RELEASE(lm);
|
||||
|
||||
ev = [[PCEditorView alloc] initWithFrame:fr
|
||||
textContainer:tc];
|
||||
[ev setEditor:self];
|
||||
|
||||
[ev setMinSize: NSMakeSize( 0, 0)];
|
||||
[ev setMaxSize: NSMakeSize(1e7, 1e7)];
|
||||
[ev setRichText: YES];
|
||||
[ev setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable];
|
||||
[ev setVerticallyResizable: YES];
|
||||
[ev setHorizontallyResizable: NO];
|
||||
[ev setTextContainerInset: NSMakeSize( 5, 5)];
|
||||
[[ev textContainer] setWidthTracksTextView:YES];
|
||||
|
||||
return AUTORELEASE(ev);
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -132,181 +140,187 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
|||
|
||||
- (id)initWithPath:(NSString*)file
|
||||
{
|
||||
if((self = [super init]))
|
||||
{
|
||||
NSString *t = [NSString stringWithContentsOfFile:file];
|
||||
NSAttributedString *as = [[NSAttributedString alloc] initWithString:t];
|
||||
if((self = [super init]))
|
||||
{
|
||||
NSString *t;
|
||||
NSAttributedString *as;
|
||||
NSDictionary *at;
|
||||
NSFont *ft;
|
||||
|
||||
isEdited = NO;
|
||||
path = [file copy];
|
||||
ft = [NSFont userFixedPitchFontOfSize:0.0];
|
||||
at = [NSDictionary dictionaryWithObject:ft forKey:NSFontAttributeName];
|
||||
t = [NSString stringWithContentsOfFile:file];
|
||||
as = [[NSAttributedString alloc] initWithString:t attributes:at];
|
||||
|
||||
[self _initUI];
|
||||
_isEdited = NO;
|
||||
_path = [file copy];
|
||||
|
||||
[window setTitle:file];
|
||||
[storage setAttributedString:as];
|
||||
RELEASE(as);
|
||||
[self _initUI];
|
||||
|
||||
[iView setNeedsDisplay:YES];
|
||||
[eView setNeedsDisplay:YES];
|
||||
[_window setTitle:file];
|
||||
[_storage setAttributedString:as];
|
||||
RELEASE(as);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textDidChange:)
|
||||
name:NSTextDidChangeNotification
|
||||
object:eView];
|
||||
[_iView setNeedsDisplay:YES];
|
||||
[_eView setNeedsDisplay:YES];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textDidChange:)
|
||||
name:NSTextDidChangeNotification
|
||||
object:iView];
|
||||
}
|
||||
return self;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textDidChange:)
|
||||
name:NSTextDidChangeNotification
|
||||
object:_eView];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(textDidChange:)
|
||||
name:NSTextDidChangeNotification
|
||||
object:_iView];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
|
||||
RELEASE(window);
|
||||
RELEASE(path);
|
||||
RELEASE(_window);
|
||||
RELEASE(_path);
|
||||
|
||||
RELEASE(iView);
|
||||
RELEASE(storage);
|
||||
RELEASE(_iView);
|
||||
RELEASE(_storage);
|
||||
|
||||
[super dealloc];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setDelegate:(id)aDelegate
|
||||
{
|
||||
delegate = aDelegate;
|
||||
_delegate = aDelegate;
|
||||
}
|
||||
|
||||
- (id)delegate
|
||||
{
|
||||
return delegate;
|
||||
return _delegate;
|
||||
}
|
||||
|
||||
- (NSWindow *)editorWindow
|
||||
{
|
||||
return window;
|
||||
return _window;
|
||||
}
|
||||
|
||||
- (NSString *)path
|
||||
{
|
||||
return path;
|
||||
return _path;
|
||||
}
|
||||
|
||||
- (void)setIsEdited:(BOOL)yn
|
||||
{
|
||||
[window setDocumentEdited:yn];
|
||||
isEdited = yn;
|
||||
[_window setDocumentEdited:yn];
|
||||
_isEdited = yn;
|
||||
}
|
||||
|
||||
- (void)showInProjectEditor:(PCProjectEditor *)pe
|
||||
{
|
||||
[pe setEditorView:iView];
|
||||
[pe setEditorView:_iView];
|
||||
}
|
||||
|
||||
- (void)show
|
||||
{
|
||||
[window makeKeyAndOrderFront:self];
|
||||
[_window makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
- (void)close
|
||||
{
|
||||
if( isEdited )
|
||||
if( _isEdited )
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
if( [_window isVisible] )
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
if( [window isVisible] )
|
||||
{
|
||||
[window makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
ret = NSRunAlertPanel(@"Edited File!",
|
||||
@"Should '%@' be saved before closing?",
|
||||
@"Yes",@"No",nil,path);
|
||||
|
||||
if( ret == YES )
|
||||
{
|
||||
ret = [self saveFile];
|
||||
|
||||
if( ret == NO )
|
||||
{
|
||||
NSRunAlertPanel(@"Save Failed!",
|
||||
@"Could not save file '%@'!",
|
||||
@"OK",nil,nil,path);
|
||||
}
|
||||
}
|
||||
|
||||
[self setIsEdited:NO];
|
||||
[_window makeKeyAndOrderFront:self];
|
||||
}
|
||||
|
||||
if( delegate && [delegate respondsToSelector:@selector(editorDidClose:)] )
|
||||
ret = NSRunAlertPanel(@"Edited File!",
|
||||
@"Should '%@' be saved before closing?",
|
||||
@"Yes",@"No",nil,_path);
|
||||
|
||||
if( ret == YES )
|
||||
{
|
||||
[delegate editorDidClose:self];
|
||||
ret = [self saveFile];
|
||||
|
||||
if((ret == NO))
|
||||
{
|
||||
NSRunAlertPanel(@"Save Failed!",
|
||||
@"Could not save file '%@'!",
|
||||
@"OK",nil,nil,_path);
|
||||
}
|
||||
}
|
||||
|
||||
[self setIsEdited:NO];
|
||||
}
|
||||
|
||||
if( _delegate && [_delegate respondsToSelector:@selector(editorDidClose:)] )
|
||||
{
|
||||
[_delegate editorDidClose:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)saveFileIfNeeded
|
||||
{
|
||||
if( isEdited )
|
||||
{
|
||||
return [self saveFile];
|
||||
}
|
||||
if((_isEdited))
|
||||
{
|
||||
return [self saveFile];
|
||||
}
|
||||
|
||||
return YES;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)saveFile
|
||||
{
|
||||
[self setIsEdited:NO];
|
||||
[self setIsEdited:NO];
|
||||
|
||||
// Operate on the text storage!
|
||||
return [[storage string] writeToFile:path atomically:YES];
|
||||
// Operate on the text storage!
|
||||
return [[_storage string] writeToFile:_path atomically:YES];
|
||||
}
|
||||
|
||||
- (BOOL)revertFile
|
||||
{
|
||||
NSString *text = [NSString stringWithContentsOfFile:path];
|
||||
NSAttributedString *as = [[NSAttributedString alloc] initWithString:text];
|
||||
NSString *text = [NSString stringWithContentsOfFile:_path];
|
||||
NSAttributedString *as = [[NSAttributedString alloc] initWithString:text];
|
||||
|
||||
[self setIsEdited:NO];
|
||||
[self setIsEdited:NO];
|
||||
|
||||
// Operate on the text storage!
|
||||
[storage setAttributedString:as];
|
||||
RELEASE(as);
|
||||
// Operate on the text storage!
|
||||
[_storage setAttributedString:as];
|
||||
RELEASE(as);
|
||||
|
||||
[iView setNeedsDisplay:YES];
|
||||
[eView setNeedsDisplay:YES];
|
||||
[_iView setNeedsDisplay:YES];
|
||||
[_eView setNeedsDisplay:YES];
|
||||
}
|
||||
|
||||
- (void)windowWillClose:(NSNotification *)aNotification
|
||||
{
|
||||
if( [[aNotification object] isEqual:window] )
|
||||
{
|
||||
[self close];
|
||||
}
|
||||
if( [[aNotification object] isEqual:_window] )
|
||||
{
|
||||
[self close];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification *)aNotification
|
||||
{
|
||||
if( [[aNotification object] isEqual:window] )
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCEditorDidBecomeKeyNotification object:self];
|
||||
}
|
||||
if( [[aNotification object] isEqual:_window] )
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCEditorDidBecomeKeyNotification object:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)windowDidResignKey:(NSNotification *)aNotification
|
||||
{
|
||||
if( [[aNotification object] isEqual:window] )
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCEditorDidResignKeyNotification object:self];
|
||||
}
|
||||
if( [[aNotification object] isEqual:_window] )
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCEditorDidResignKeyNotification object:self];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)textDidChange:(NSNotification *)aNotification
|
||||
{
|
||||
[self setIsEdited:YES];
|
||||
[self setIsEdited:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -61,18 +61,21 @@ static int _tabFlags = PCTab4Sp;
|
|||
|
||||
_keywords = [[NSArray alloc] initWithObjects:@"@class",
|
||||
@"@selector",
|
||||
@"#import",
|
||||
@"#include",
|
||||
@"#ifndef",
|
||||
@"#if defined",
|
||||
@"#define",
|
||||
@"#endif",
|
||||
@"#pragma",
|
||||
@"#warning",
|
||||
@"@interface",
|
||||
@"@implementation",
|
||||
@"@end",
|
||||
@"@protocol",
|
||||
@"#import",
|
||||
@"#include",
|
||||
@"#define",
|
||||
@"#ifdef",
|
||||
@"#ifndef",
|
||||
@"#if defined",
|
||||
@"#else",
|
||||
@"#elif",
|
||||
@"#endif",
|
||||
@"#pragma",
|
||||
@"#warning",
|
||||
nil];
|
||||
}
|
||||
return self;
|
||||
|
@ -208,3 +211,17 @@ static int _tabFlags = PCTab4Sp;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
|
||||
@interface PCProjectEditor : NSObject <ProjectComponent>
|
||||
{
|
||||
NSBox *componentView;
|
||||
PCProject *currentProject;
|
||||
PCEditorView *editor;
|
||||
NSScrollView *scrollView;
|
||||
NSBox *_componentView;
|
||||
PCProject *_currentProject;
|
||||
PCEditorView *_editorView;
|
||||
NSScrollView *_scrollView;
|
||||
}
|
||||
|
||||
- (id)initWithProject:(PCProject *)aProject;
|
||||
|
|
|
@ -25,11 +25,12 @@
|
|||
NSRect frame;
|
||||
NSTextView *etv;
|
||||
|
||||
componentView = [[NSBox alloc] initWithFrame:NSMakeRect(-1,-1,562,248)];
|
||||
[componentView setTitlePosition:NSNoTitle];
|
||||
[componentView setBorderType:NSNoBorder];
|
||||
[componentView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
|
||||
[componentView setContentViewMargins: NSMakeSize(0.0,0.0)];
|
||||
frame = NSMakeRect(0,0,562,248);
|
||||
_componentView = [[NSBox alloc] initWithFrame:frame];
|
||||
[_componentView setTitlePosition: NSNoTitle];
|
||||
[_componentView setBorderType: NSNoBorder];
|
||||
[_componentView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
|
||||
[_componentView setContentViewMargins: NSMakeSize(0.0,0.0)];
|
||||
|
||||
frame = NSMakeRect(20,16,240,16);
|
||||
methods = [[NSPopUpButton alloc] initWithFrame:frame];
|
||||
|
@ -37,38 +38,38 @@
|
|||
[methods setPullsDown:YES];
|
||||
[methods setTarget:self];
|
||||
[methods setAction:@selector(pullDownSelected:)];
|
||||
[componentView addSubview:methods];
|
||||
[_componentView addSubview:methods];
|
||||
RELEASE(methods);
|
||||
|
||||
frame = NSMakeRect (-1,32,562,40);
|
||||
scrollView = [[NSScrollView alloc] initWithFrame:frame];
|
||||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: YES];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
[scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||
frame = NSMakeRect (0,32,562,40);
|
||||
_scrollView = [[NSScrollView alloc] initWithFrame:frame];
|
||||
[_scrollView setHasHorizontalScroller: YES];
|
||||
[_scrollView setHasVerticalScroller: YES];
|
||||
[_scrollView setBorderType: NSBezelBorder];
|
||||
[_scrollView setAutoresizingMask:(NSViewWidthSizable|NSViewHeightSizable)];
|
||||
|
||||
// This is a placeholder!
|
||||
frame = [[scrollView contentView] frame];
|
||||
etv = [[NSTextView alloc] initWithFrame:frame];
|
||||
frame = [[_scrollView contentView] frame];
|
||||
etv = [[NSTextView alloc] initWithFrame:frame];
|
||||
[etv setMinSize: NSMakeSize (0, 0)];
|
||||
[etv setMaxSize:NSMakeSize(1e7, 1e7)];
|
||||
[etv setRichText:NO];
|
||||
[etv setEditable:NO];
|
||||
[etv setSelectable:YES];
|
||||
[etv setVerticallyResizable:YES];
|
||||
[etv setHorizontallyResizable:NO];
|
||||
[etv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||
[[etv textContainer] setWidthTracksTextView:YES];
|
||||
[scrollView setDocumentView:etv];
|
||||
[etv setMaxSize: NSMakeSize(1e7, 1e7)];
|
||||
[etv setRichText: NO];
|
||||
[etv setEditable: NO];
|
||||
[etv setSelectable: YES];
|
||||
[etv setVerticallyResizable: YES];
|
||||
[etv setHorizontallyResizable: NO];
|
||||
[etv setAutoresizingMask:(NSViewWidthSizable|NSViewHeightSizable)];
|
||||
[[etv textContainer] setWidthTracksTextView: YES];
|
||||
[_scrollView setDocumentView: etv];
|
||||
RELEASE(etv);
|
||||
|
||||
frame.size = NSMakeSize([scrollView contentSize].width,1e7);
|
||||
frame.size = NSMakeSize([_scrollView contentSize].width,1e7);
|
||||
[[etv textContainer] setContainerSize:frame.size];
|
||||
|
||||
[componentView addSubview:scrollView];
|
||||
RELEASE(scrollView);
|
||||
[_componentView addSubview:_scrollView];
|
||||
RELEASE(_scrollView);
|
||||
|
||||
[componentView sizeToFit];
|
||||
[_componentView sizeToFit];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -81,46 +82,47 @@
|
|||
|
||||
if((self = [super init]))
|
||||
{
|
||||
currentProject = aProject;
|
||||
componentView = nil;
|
||||
_currentProject = aProject;
|
||||
_componentView = nil;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
if( componentView ) RELEASE(componentView);
|
||||
if( _componentView ) RELEASE(_componentView);
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (NSView *)componentView
|
||||
{
|
||||
if (componentView == nil)
|
||||
if (_componentView == nil)
|
||||
{
|
||||
[self _createComponentView];
|
||||
}
|
||||
|
||||
return componentView;
|
||||
return _componentView;
|
||||
}
|
||||
|
||||
- (void)setEditorView:(PCEditorView *)ev
|
||||
{
|
||||
NSRect frame;
|
||||
|
||||
editor = ev;
|
||||
[scrollView setDocumentView:editor];
|
||||
_editorView = ev;
|
||||
|
||||
frame = [[scrollView contentView] frame];
|
||||
frame.size = NSMakeSize([scrollView contentSize].width,1e7);
|
||||
[[editor textContainer] setContainerSize:frame.size];
|
||||
[_scrollView setDocumentView:_editorView];
|
||||
|
||||
[editor setNeedsDisplay:YES];
|
||||
frame = [[_scrollView contentView] frame];
|
||||
frame.size = NSMakeSize([_scrollView contentSize].width,1e7);
|
||||
[_editorView setFrame:frame];
|
||||
[_editorView sizeToFit];
|
||||
}
|
||||
|
||||
- (PCEditorView *)editorView
|
||||
{
|
||||
return editor;
|
||||
return _editorView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
ApplicationName = "ProjectCenter";
|
||||
ApplicationDescription = "GNUstep IDE";
|
||||
ApplicationIcon = "ProjectCenter.tiff";
|
||||
ApplicationRelease = "ProjectCenter 0.3.0";
|
||||
FullVersionID = "0.3.0";
|
||||
Authors = ("Philippe C.D. Robert <phr@3dkit.org>");
|
||||
ApplicationRelease = "ProjectCenter 0.3.1";
|
||||
FullVersionID = "0.3.1";
|
||||
Authors = ("Philippe C.D. Robert <probert@siggraph.org>");
|
||||
URL = "http://www.gnustep.org";
|
||||
Copyright = "Copyright (C) 2001 - 2002 Free Software Foundation";
|
||||
CopyrightDescription = "Released under the GNU General Public License 2.0";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
Copyright (C) 2001 Free Software Foundation
|
||||
|
||||
Author: Philippe C.D. Robert <phr@3dkit.org>
|
||||
Author: Philippe C.D. Robert <probert@siggraph.org>
|
||||
|
||||
This file is part of GNUstep.
|
||||
|
||||
|
@ -85,9 +85,12 @@ void createMenu()
|
|||
|
||||
info = [[[NSMenu alloc] init] autorelease];
|
||||
[menu setSubmenu:info forItem:[menu itemWithTitle:@"Info"]];
|
||||
[info addItemWithTitle:@"Info Panel..." action:@selector(showInfoPanel:) keyEquivalent:@""];
|
||||
[info addItemWithTitle:@"Preferences" action:@selector(showPrefWindow:) keyEquivalent:@""];
|
||||
[info addItemWithTitle:@"Help" action:action keyEquivalent:@"?"];
|
||||
[info addItemWithTitle:@"Info Panel..."
|
||||
action:@selector(showInfoPanel:) keyEquivalent:@""];
|
||||
[info addItemWithTitle:@"Preferences"
|
||||
action:@selector(showPrefWindow:) keyEquivalent:@""];
|
||||
[info addItemWithTitle:@"Help"
|
||||
action:action keyEquivalent:@"?"];
|
||||
|
||||
/*
|
||||
* Project submenu
|
||||
|
@ -95,18 +98,31 @@ void createMenu()
|
|||
|
||||
project = [[[NSMenu alloc] init] autorelease];
|
||||
[menu setSubmenu:project forItem:[menu itemWithTitle:@"Project"]];
|
||||
[project addItemWithTitle:@"Open" action:@selector(openProject:) keyEquivalent:@"o"];
|
||||
[project addItemWithTitle:@"New" action:@selector(newProject:) keyEquivalent:@"n"];
|
||||
[project addItemWithTitle:@"Save..." action:@selector(saveProject:) keyEquivalent:@"s"];
|
||||
[project addItemWithTitle:@"Save As..." action:@selector(saveProjectAs:) keyEquivalent:@"S"];
|
||||
[project addItemWithTitle:@"Subprojects" action:action keyEquivalent:@""];
|
||||
[project addItemWithTitle:@"Close" action:@selector(closeProject:) keyEquivalent:@""];
|
||||
[project addItemWithTitle:@"Open"
|
||||
action:@selector(openProject:) keyEquivalent:@"o"];
|
||||
[project addItemWithTitle:@"New"
|
||||
action:@selector(newProject:) keyEquivalent:@"n"];
|
||||
[project addItemWithTitle:@"Save..."
|
||||
action:@selector(saveProject:) keyEquivalent:@"s"];
|
||||
[project addItemWithTitle:@"Save As..."
|
||||
action:@selector(saveProjectAs:) keyEquivalent:@"S"];
|
||||
[project addItemWithTitle:@"Subprojects"
|
||||
action:action keyEquivalent:@""];
|
||||
[project addItemWithTitle:@"Close"
|
||||
action:@selector(closeProject:) keyEquivalent:@""];
|
||||
|
||||
subprojects = [[[NSMenu alloc] init] autorelease];
|
||||
[project setSubmenu:subprojects forItem:[project itemWithTitle:@"Subprojects"]];
|
||||
[subprojects addItemWithTitle:@"New..." action:@selector(newSubproject:) keyEquivalent:@""];
|
||||
[subprojects addItemWithTitle:@"Add..." action:@selector(addSubproject:) keyEquivalent:@""];
|
||||
[subprojects addItemWithTitle:@"Remove..." action:@selector(removeSubproject:) keyEquivalent:@""];
|
||||
[project setSubmenu:subprojects
|
||||
forItem:[project itemWithTitle:@"Subprojects"]];
|
||||
[subprojects addItemWithTitle:@"New..."
|
||||
action:@selector(newSubproject:)
|
||||
keyEquivalent:@""];
|
||||
[subprojects addItemWithTitle:@"Add..."
|
||||
action:@selector(addSubproject:)
|
||||
keyEquivalent:@""];
|
||||
[subprojects addItemWithTitle:@"Remove..."
|
||||
action:@selector(removeSubproject:)
|
||||
keyEquivalent:@""];
|
||||
|
||||
/*
|
||||
* File submenu
|
||||
|
@ -114,13 +130,20 @@ void createMenu()
|
|||
|
||||
file = [[[NSMenu alloc] init] autorelease];
|
||||
[menu setSubmenu:file forItem:[menu itemWithTitle:@"File"]];
|
||||
[file addItemWithTitle:@"Open File" action:@selector(openFile:) keyEquivalent:@"O"];
|
||||
[file addItemWithTitle:@"Add File" action:@selector(addFile:) keyEquivalent:@"A"];
|
||||
[file addItemWithTitle:@"New in Project" action:@selector(newFile:) keyEquivalent:@"N"];
|
||||
[file addItemWithTitle:@"Remove File" action:@selector(removeFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Save File" action:@selector(saveFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Revert" action:@selector(revertFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Rename" action:@selector(renameFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Open File"
|
||||
action:@selector(openFile:) keyEquivalent:@"O"];
|
||||
[file addItemWithTitle:@"Add File"
|
||||
action:@selector(addFile:) keyEquivalent:@"A"];
|
||||
[file addItemWithTitle:@"New in Project"
|
||||
action:@selector(newFile:) keyEquivalent:@"N"];
|
||||
[file addItemWithTitle:@"Remove File"
|
||||
action:@selector(removeFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Save File"
|
||||
action:@selector(saveFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Revert"
|
||||
action:@selector(revertFile:) keyEquivalent:@""];
|
||||
[file addItemWithTitle:@"Rename"
|
||||
action:@selector(renameFile:) keyEquivalent:@""];
|
||||
|
||||
/*
|
||||
* Edit submenu
|
||||
|
@ -129,20 +152,20 @@ void createMenu()
|
|||
edit = [[[NSMenu alloc] init] autorelease];
|
||||
[menu setSubmenu:edit forItem:[menu itemWithTitle:@"Edit"]];
|
||||
[edit addItemWithTitle: @"Cut"
|
||||
action: @selector(cut:)
|
||||
keyEquivalent: @"x"];
|
||||
action: @selector(cut:)
|
||||
keyEquivalent: @"x"];
|
||||
[edit addItemWithTitle: @"Copy"
|
||||
action: @selector(copy:)
|
||||
keyEquivalent: @"c"];
|
||||
action: @selector(copy:)
|
||||
keyEquivalent: @"c"];
|
||||
[edit addItemWithTitle: @"Paste"
|
||||
action: @selector(paste:)
|
||||
keyEquivalent: @"v"];
|
||||
action: @selector(paste:)
|
||||
keyEquivalent: @"v"];
|
||||
[edit addItemWithTitle: @"Delete"
|
||||
action: @selector(delete:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(delete:)
|
||||
keyEquivalent: @""];
|
||||
[edit addItemWithTitle: @"Select All"
|
||||
action: @selector(selectAll:)
|
||||
keyEquivalent: @"a"];
|
||||
action: @selector(selectAll:)
|
||||
keyEquivalent: @"a"];
|
||||
|
||||
/*
|
||||
* Tools submenu
|
||||
|
@ -150,14 +173,22 @@ void createMenu()
|
|||
|
||||
tools = [[[NSMenu alloc] init] autorelease];
|
||||
[menu setSubmenu:tools forItem:[menu itemWithTitle:@"Tools"]];
|
||||
[tools addItemWithTitle:@"Launch Panel" action:@selector(showRunPanel:) keyEquivalent:@"L"];
|
||||
[tools addItemWithTitle:@"Build Panel" action:@selector(showBuildPanel:) keyEquivalent:@"B"];
|
||||
[tools addItemWithTitle:@"Editor Panel" action:@selector(showEditorPanel:) keyEquivalent:@"E"];
|
||||
[tools addItemWithTitle:@"Inspector Panel" action:@selector(showInspector:) keyEquivalent:@""];
|
||||
[tools addItemWithTitle:@"Find" action:action keyEquivalent:@""];
|
||||
[tools addItemWithTitle:@"Fonts" action:NULL keyEquivalent:@""];
|
||||
[tools setSubmenu:[[NSFontManager sharedFontManager] fontMenu: YES] forItem:[tools itemWithTitle:@"Fonts"]];
|
||||
[tools addItemWithTitle:@"Run..." action:@selector(runTarget:) keyEquivalent:@"r"];
|
||||
[tools addItemWithTitle:@"Launch Panel"
|
||||
action:@selector(showRunPanel:) keyEquivalent:@"L"];
|
||||
[tools addItemWithTitle:@"Build Panel"
|
||||
action:@selector(showBuildPanel:) keyEquivalent:@"B"];
|
||||
[tools addItemWithTitle:@"Editor Panel"
|
||||
action:@selector(showEditorPanel:) keyEquivalent:@"E"];
|
||||
[tools addItemWithTitle:@"Inspector Panel"
|
||||
action:@selector(showInspector:) keyEquivalent:@""];
|
||||
[tools addItemWithTitle:@"Find"
|
||||
action:action keyEquivalent:@""];
|
||||
[tools addItemWithTitle:@"Fonts"
|
||||
action:NULL keyEquivalent:@""];
|
||||
[tools setSubmenu:[[NSFontManager sharedFontManager] fontMenu: YES]
|
||||
forItem:[tools itemWithTitle:@"Fonts"]];
|
||||
[tools addItemWithTitle:@"Run..."
|
||||
action:@selector(runTarget:) keyEquivalent:@"r"];
|
||||
|
||||
/*
|
||||
* Find submenu
|
||||
|
@ -165,9 +196,12 @@ void createMenu()
|
|||
|
||||
find = [[[NSMenu alloc] init] autorelease];
|
||||
[tools setSubmenu:find forItem:[tools itemWithTitle:@"Find"]];
|
||||
[find addItemWithTitle:@"Find Panel..." action:@selector(showFindPanel:) keyEquivalent:@""];
|
||||
[find addItemWithTitle:@"Find Next" action:@selector(findNext:) keyEquivalent:@""];
|
||||
[find addItemWithTitle:@"Find Previous" action:@selector(findPrevious:) keyEquivalent:@""];
|
||||
[find addItemWithTitle:@"Find Panel..."
|
||||
action:@selector(showFindPanel:) keyEquivalent:@"f"];
|
||||
[find addItemWithTitle:@"Find Next"
|
||||
action:@selector(findNext:) keyEquivalent:@"g"];
|
||||
[find addItemWithTitle:@"Find Previous"
|
||||
action:@selector(findPrevious:) keyEquivalent:@"d"];
|
||||
|
||||
/*
|
||||
* Windows submenu
|
||||
|
@ -194,7 +228,5 @@ void createMenu()
|
|||
|
||||
[[NSApplication sharedApplication] setMainMenu:menu];
|
||||
[[NSApplication sharedApplication] setServicesMenu: services];
|
||||
|
||||
// [menu update];
|
||||
// [menu display];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue