mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-22 11:21:29 +00:00
Extracted the hardcoded UI into separated categories
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@15150 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
95d546188b
commit
42cea681ef
16 changed files with 1179 additions and 913 deletions
16
PCLib/PCEditor+UInterface.h
Normal file
16
PCLib/PCEditor+UInterface.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// PCEditor+UInterface.h
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCEditor.h"
|
||||||
|
|
||||||
|
@interface PCEditor (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI;
|
||||||
|
- (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr;
|
||||||
|
|
||||||
|
@end
|
124
PCLib/PCEditor+UInterface.m
Normal file
124
PCLib/PCEditor+UInterface.m
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
//
|
||||||
|
// PCEditor+UInterface.m
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCEditor+UInterface.h"
|
||||||
|
#import "PCEditorView.h"
|
||||||
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
@implementation PCEditor (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI
|
||||||
|
{
|
||||||
|
NSScrollView *scrollView;
|
||||||
|
unsigned int style;
|
||||||
|
NSRect rect;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Creating shared text storage
|
||||||
|
*/
|
||||||
|
|
||||||
|
_storage = [[NSTextStorage alloc] init];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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. :-(
|
||||||
|
*/
|
||||||
|
|
||||||
|
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];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Creating external view
|
||||||
|
*/
|
||||||
|
|
||||||
|
_eView = [self _createEditorViewWithFrame:rect];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
122
PCLib/PCEditor.m
122
PCLib/PCEditor.m
|
@ -15,129 +15,11 @@
|
||||||
#import "ProjectComponent.h"
|
#import "ProjectComponent.h"
|
||||||
#import "PCProjectEditor.h"
|
#import "PCProjectEditor.h"
|
||||||
|
|
||||||
|
#import "PCEditor+UInterface.h"
|
||||||
|
|
||||||
NSString *PCEditorDidBecomeKeyNotification=@"PCEditorDidBecomeKeyNotification";
|
NSString *PCEditorDidBecomeKeyNotification=@"PCEditorDidBecomeKeyNotification";
|
||||||
NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
|
||||||
|
|
||||||
@interface PCEditor (InitUI)
|
|
||||||
|
|
||||||
- (void)_initUI;
|
|
||||||
- (PCEditorView *)_createEditorViewWithFrame:(NSRect)fr;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCEditor (InitUI)
|
|
||||||
|
|
||||||
- (void)_initUI
|
|
||||||
{
|
|
||||||
NSScrollView *scrollView;
|
|
||||||
unsigned int style;
|
|
||||||
NSRect rect;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Creating shared text storage
|
|
||||||
*/
|
|
||||||
|
|
||||||
_storage = [[NSTextStorage alloc] init];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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. :-(
|
|
||||||
*/
|
|
||||||
|
|
||||||
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];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Creating external view
|
|
||||||
*/
|
|
||||||
|
|
||||||
_eView = [self _createEditorViewWithFrame:rect];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
|
|
||||||
@implementation PCEditor
|
@implementation PCEditor
|
||||||
|
|
||||||
- (id)initWithPath:(NSString*)file
|
- (id)initWithPath:(NSString*)file
|
||||||
|
|
16
PCLib/PCFileManager+UInterface.h
Normal file
16
PCLib/PCFileManager+UInterface.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// PCFileManager+UInterface.h
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCFileManager.h"
|
||||||
|
|
||||||
|
@interface PCFileManager (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
154
PCLib/PCFileManager+UInterface.m
Normal file
154
PCLib/PCFileManager+UInterface.m
Normal file
|
@ -0,0 +1,154 @@
|
||||||
|
//
|
||||||
|
// PCFileManager+UInterface.m
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCFileManager+UInterface.h"
|
||||||
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@implementation PCFileManager (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI
|
||||||
|
{
|
||||||
|
NSView *_c_view;
|
||||||
|
unsigned int style = NSTitledWindowMask
|
||||||
|
| NSClosableWindowMask
|
||||||
|
| NSMiniaturizableWindowMask;
|
||||||
|
NSBox *box;
|
||||||
|
NSRect _w_frame;
|
||||||
|
NSMatrix* matrix;
|
||||||
|
id button;
|
||||||
|
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
|
||||||
|
id textField;
|
||||||
|
NSScrollView *scrollView;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* the file creation window
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
_w_frame = NSMakeRect(100,100,320,240);
|
||||||
|
newFileWindow = [[NSWindow alloc] initWithContentRect:_w_frame
|
||||||
|
styleMask:style
|
||||||
|
backing:NSBackingStoreBuffered
|
||||||
|
defer:NO];
|
||||||
|
[newFileWindow setMinSize:NSMakeSize(320,160)];
|
||||||
|
[newFileWindow setTitle:@"New File..."];
|
||||||
|
|
||||||
|
box = [[NSBox alloc] init];
|
||||||
|
[box setFrame:NSMakeRect(16,172,288,56)];
|
||||||
|
fileTypePopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(32,2,216,20)
|
||||||
|
pullsDown:NO];
|
||||||
|
[fileTypePopup setAutoresizingMask: (NSViewWidthSizable)];
|
||||||
|
[fileTypePopup setTarget:self];
|
||||||
|
[fileTypePopup setAction:@selector(popupChanged:)];
|
||||||
|
[box setTitle:@"File Type"];
|
||||||
|
[box setTitlePosition:NSAtTop];
|
||||||
|
[box setBorderType:NSGrooveBorder];
|
||||||
|
[box setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)];
|
||||||
|
|
||||||
|
[box addSubview:fileTypePopup];
|
||||||
|
RELEASE(fileTypePopup);
|
||||||
|
|
||||||
|
_c_view = [newFileWindow contentView];
|
||||||
|
|
||||||
|
_w_frame = NSMakeRect (16,96,288,68);
|
||||||
|
scrollView = [[NSScrollView alloc] initWithFrame:_w_frame];
|
||||||
|
[scrollView setHasHorizontalScroller:NO];
|
||||||
|
[scrollView setHasVerticalScroller: YES];
|
||||||
|
[scrollView setBorderType: NSBezelBorder];
|
||||||
|
[scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
|
||||||
|
// This is a placeholder!
|
||||||
|
_w_frame = [[scrollView contentView] frame];
|
||||||
|
descrView = [[NSTextView alloc] initWithFrame:_w_frame];
|
||||||
|
[descrView setMinSize: NSMakeSize (0, 0)];
|
||||||
|
[descrView setMaxSize:NSMakeSize(1e7, 1e7)];
|
||||||
|
[descrView setRichText:NO];
|
||||||
|
#ifdef GNUSTEP_BASE_VERSION
|
||||||
|
[descrView setEditable:NO];
|
||||||
|
#endif
|
||||||
|
[descrView setSelectable:YES];
|
||||||
|
[descrView setVerticallyResizable:YES];
|
||||||
|
[descrView setHorizontallyResizable:NO];
|
||||||
|
[descrView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||||
|
[[descrView textContainer] setWidthTracksTextView:YES];
|
||||||
|
[scrollView setDocumentView:descrView];
|
||||||
|
RELEASE(descrView);
|
||||||
|
|
||||||
|
_w_frame.size = NSMakeSize([scrollView contentSize].width,1e7);
|
||||||
|
[[descrView textContainer] setContainerSize:_w_frame.size];
|
||||||
|
|
||||||
|
[_c_view addSubview:scrollView];
|
||||||
|
RELEASE(scrollView);
|
||||||
|
|
||||||
|
[_c_view addSubview:box];
|
||||||
|
RELEASE(box);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Button matrix
|
||||||
|
*/
|
||||||
|
|
||||||
|
_w_frame = NSMakeRect(188,16,116,24);
|
||||||
|
matrix = [[NSMatrix alloc] initWithFrame: _w_frame
|
||||||
|
mode: NSHighlightModeMatrix
|
||||||
|
prototype: buttonCell
|
||||||
|
numberOfRows: 1
|
||||||
|
numberOfColumns: 2];
|
||||||
|
[matrix setSelectionByRect:YES];
|
||||||
|
[matrix setAutoresizingMask: (NSViewMinXMargin | NSViewMaxYMargin)];
|
||||||
|
[matrix setTarget:self];
|
||||||
|
[matrix setAction:@selector(buttonsPressed:)];
|
||||||
|
[matrix setIntercellSpacing: NSMakeSize(2,2)];
|
||||||
|
[_c_view addSubview:matrix];
|
||||||
|
RELEASE(matrix);
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:0];
|
||||||
|
[button setTag:0];
|
||||||
|
[button setStringValue:@"Cancel"];
|
||||||
|
[button setBordered:YES];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:1];
|
||||||
|
[button setTag:1];
|
||||||
|
[button setStringValue:@"OK"];
|
||||||
|
[button setBordered:YES];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The name of the new file...
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Status message
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,56,48,21)];
|
||||||
|
[textField setAlignment: NSLeftTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Name:"];
|
||||||
|
[textField setAutoresizingMask: (NSViewMaxXMargin |
|
||||||
|
NSViewWidthSizable |
|
||||||
|
NSViewMinYMargin)];
|
||||||
|
[_c_view addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
// Target
|
||||||
|
newFileName = [[NSTextField alloc] initWithFrame:NSMakeRect(56,56,248,21)];
|
||||||
|
[newFileName setAlignment: NSLeftTextAlignment];
|
||||||
|
[newFileName setBordered: YES];
|
||||||
|
[newFileName setBezeled: YES];
|
||||||
|
[newFileName setEditable: YES];
|
||||||
|
[newFileName setDrawsBackground: YES];
|
||||||
|
[newFileName setStringValue:@"NewFile"];
|
||||||
|
[newFileName setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)];
|
||||||
|
[_c_view addSubview:newFileName];
|
||||||
|
RELEASE(newFileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -30,158 +30,12 @@
|
||||||
#import "PCServer.h"
|
#import "PCServer.h"
|
||||||
#import "FileCreator.h"
|
#import "FileCreator.h"
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import "PCFileManager+UInterface.h"
|
||||||
|
|
||||||
#if defined(GNUSTEP)
|
#if defined(GNUSTEP)
|
||||||
#import <AppKit/IMLoading.h>
|
#import <AppKit/IMLoading.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@interface PCFileManager (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCFileManager (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI
|
|
||||||
{
|
|
||||||
NSView *_c_view;
|
|
||||||
unsigned int style = NSTitledWindowMask
|
|
||||||
| NSClosableWindowMask
|
|
||||||
| NSMiniaturizableWindowMask;
|
|
||||||
NSBox *box;
|
|
||||||
NSRect _w_frame;
|
|
||||||
NSMatrix* matrix;
|
|
||||||
id button;
|
|
||||||
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
|
|
||||||
id textField;
|
|
||||||
NSScrollView *scrollView;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* the file creation window
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
_w_frame = NSMakeRect(100,100,320,240);
|
|
||||||
newFileWindow = [[NSWindow alloc] initWithContentRect:_w_frame
|
|
||||||
styleMask:style
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:NO];
|
|
||||||
[newFileWindow setMinSize:NSMakeSize(320,160)];
|
|
||||||
[newFileWindow setTitle:@"New File..."];
|
|
||||||
|
|
||||||
box = [[NSBox alloc] init];
|
|
||||||
[box setFrame:NSMakeRect(16,172,288,56)];
|
|
||||||
fileTypePopup = [[NSPopUpButton alloc] initWithFrame:NSMakeRect(32,2,216,20)
|
|
||||||
pullsDown:NO];
|
|
||||||
[fileTypePopup setAutoresizingMask: (NSViewWidthSizable)];
|
|
||||||
[fileTypePopup setTarget:self];
|
|
||||||
[fileTypePopup setAction:@selector(popupChanged:)];
|
|
||||||
[box setTitle:@"File Type"];
|
|
||||||
[box setTitlePosition:NSAtTop];
|
|
||||||
[box setBorderType:NSGrooveBorder];
|
|
||||||
[box setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)];
|
|
||||||
|
|
||||||
[box addSubview:fileTypePopup];
|
|
||||||
RELEASE(fileTypePopup);
|
|
||||||
|
|
||||||
_c_view = [newFileWindow contentView];
|
|
||||||
|
|
||||||
_w_frame = NSMakeRect (16,96,288,68);
|
|
||||||
scrollView = [[NSScrollView alloc] initWithFrame:_w_frame];
|
|
||||||
[scrollView setHasHorizontalScroller:NO];
|
|
||||||
[scrollView setHasVerticalScroller: YES];
|
|
||||||
[scrollView setBorderType: NSBezelBorder];
|
|
||||||
[scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
|
||||||
|
|
||||||
// This is a placeholder!
|
|
||||||
_w_frame = [[scrollView contentView] frame];
|
|
||||||
descrView = [[NSTextView alloc] initWithFrame:_w_frame];
|
|
||||||
[descrView setMinSize: NSMakeSize (0, 0)];
|
|
||||||
[descrView setMaxSize:NSMakeSize(1e7, 1e7)];
|
|
||||||
[descrView setRichText:NO];
|
|
||||||
[descrView setEditable:NO];
|
|
||||||
[descrView setSelectable:YES];
|
|
||||||
[descrView setVerticallyResizable:YES];
|
|
||||||
[descrView setHorizontallyResizable:NO];
|
|
||||||
[descrView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
|
||||||
[[descrView textContainer] setWidthTracksTextView:YES];
|
|
||||||
[scrollView setDocumentView:descrView];
|
|
||||||
RELEASE(descrView);
|
|
||||||
|
|
||||||
_w_frame.size = NSMakeSize([scrollView contentSize].width,1e7);
|
|
||||||
[[descrView textContainer] setContainerSize:_w_frame.size];
|
|
||||||
|
|
||||||
[_c_view addSubview:scrollView];
|
|
||||||
RELEASE(scrollView);
|
|
||||||
|
|
||||||
[_c_view addSubview:box];
|
|
||||||
RELEASE(box);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Button matrix
|
|
||||||
*/
|
|
||||||
|
|
||||||
_w_frame = NSMakeRect(188,16,116,24);
|
|
||||||
matrix = [[NSMatrix alloc] initWithFrame: _w_frame
|
|
||||||
mode: NSHighlightModeMatrix
|
|
||||||
prototype: buttonCell
|
|
||||||
numberOfRows: 1
|
|
||||||
numberOfColumns: 2];
|
|
||||||
[matrix setSelectionByRect:YES];
|
|
||||||
[matrix setAutoresizingMask: (NSViewMinXMargin | NSViewMaxYMargin)];
|
|
||||||
[matrix setTarget:self];
|
|
||||||
[matrix setAction:@selector(buttonsPressed:)];
|
|
||||||
[matrix setIntercellSpacing: NSMakeSize(2,2)];
|
|
||||||
[_c_view addSubview:matrix];
|
|
||||||
RELEASE(matrix);
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:0];
|
|
||||||
[button setTag:0];
|
|
||||||
[button setStringValue:@"Cancel"];
|
|
||||||
[button setBordered:YES];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:1];
|
|
||||||
[button setTag:1];
|
|
||||||
[button setStringValue:@"OK"];
|
|
||||||
[button setBordered:YES];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The name of the new file...
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Status message
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,56,48,21)];
|
|
||||||
[textField setAlignment: NSLeftTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Name:"];
|
|
||||||
[textField setAutoresizingMask: (NSViewMaxXMargin |
|
|
||||||
NSViewWidthSizable |
|
|
||||||
NSViewMinYMargin)];
|
|
||||||
[_c_view addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
// Target
|
|
||||||
newFileName = [[NSTextField alloc] initWithFrame:NSMakeRect(56,56,248,21)];
|
|
||||||
[newFileName setAlignment: NSLeftTextAlignment];
|
|
||||||
[newFileName setBordered: YES];
|
|
||||||
[newFileName setBezeled: YES];
|
|
||||||
[newFileName setEditable: YES];
|
|
||||||
[newFileName setDrawsBackground: YES];
|
|
||||||
[newFileName setStringValue:@"NewFile"];
|
|
||||||
[newFileName setAutoresizingMask: (NSViewWidthSizable | NSViewMinYMargin)];
|
|
||||||
[_c_view addSubview:newFileName];
|
|
||||||
RELEASE(newFileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCFileManager
|
@implementation PCFileManager
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
@ -392,11 +246,14 @@ static PCFileManager *_mgr = nil;
|
||||||
- (void)popupChanged:(id)sender
|
- (void)popupChanged:(id)sender
|
||||||
{
|
{
|
||||||
NSString *k = [sender titleOfSelectedItem];
|
NSString *k = [sender titleOfSelectedItem];
|
||||||
NSString *t = [typeDescr objectForKey:k];
|
|
||||||
|
|
||||||
if( k )
|
if( k )
|
||||||
{
|
{
|
||||||
[descrView setText:t];
|
#ifdef GNUSTEP_BASE_VERSION
|
||||||
|
[descrView setText:[typeDescr objectForKey:k]];
|
||||||
|
#else
|
||||||
|
[descrView setString:[typeDescr objectForKey:k]];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
15
PCLib/PCProject+UInterface.h
Normal file
15
PCLib/PCProject+UInterface.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//
|
||||||
|
// PCProject+UInterface.h
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCProject.h"
|
||||||
|
|
||||||
|
@interface PCProject (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI;
|
||||||
|
|
||||||
|
@end
|
398
PCLib/PCProject+UInterface.m
Normal file
398
PCLib/PCProject+UInterface.m
Normal file
|
@ -0,0 +1,398 @@
|
||||||
|
//
|
||||||
|
// PCProject+UInterface.m
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCProject+UInterface.h"
|
||||||
|
#import "PCSplitView.h"
|
||||||
|
#import "PCHistoryController.h"
|
||||||
|
#import "PCBrowserController.h"
|
||||||
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
#define ENABLE_HISTORY
|
||||||
|
|
||||||
|
@implementation PCProject (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI
|
||||||
|
{
|
||||||
|
NSView *_c_view;
|
||||||
|
unsigned int style = NSTitledWindowMask | NSClosableWindowMask |
|
||||||
|
NSMiniaturizableWindowMask | NSResizableWindowMask;
|
||||||
|
NSBrowser *browser;
|
||||||
|
NSRect rect;
|
||||||
|
NSMatrix* matrix;
|
||||||
|
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
|
||||||
|
id textField;
|
||||||
|
id button;
|
||||||
|
PCSplitView *split;
|
||||||
|
|
||||||
|
#ifdef ENABLE_HISTORY
|
||||||
|
NSBrowser *history;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
browserController = [[PCBrowserController alloc] init];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Project Window
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
rect = NSMakeRect(100,100,560,440);
|
||||||
|
projectWindow = [[NSWindow alloc] initWithContentRect:rect
|
||||||
|
styleMask:style
|
||||||
|
backing:NSBackingStoreBuffered
|
||||||
|
defer:YES];
|
||||||
|
[projectWindow setDelegate:self];
|
||||||
|
[projectWindow setMinSize:NSMakeSize(560,448)];
|
||||||
|
|
||||||
|
browser = [[NSBrowser alloc] initWithFrame:NSMakeRect(-1,251,562,128)];
|
||||||
|
[browser setDelegate:browserController];
|
||||||
|
[browser setMaxVisibleColumns:3];
|
||||||
|
[browser setAllowsMultipleSelection:NO];
|
||||||
|
[browser setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
|
||||||
|
|
||||||
|
[browserController setBrowser:browser];
|
||||||
|
[browserController setProject:self];
|
||||||
|
|
||||||
|
box = [[NSBox alloc] initWithFrame:NSMakeRect (-1,-1,562,252)];
|
||||||
|
[box setTitlePosition:NSNoTitle];
|
||||||
|
[box setBorderType:NSNoBorder];
|
||||||
|
[box setContentViewMargins: NSMakeSize(0.0,0.0)];
|
||||||
|
[box setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
||||||
|
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,200,500,21)];
|
||||||
|
[textField setAlignment: NSLeftTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Welcome to ProjectCenter.app"];
|
||||||
|
[box addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
rect = [[projectWindow contentView] frame];
|
||||||
|
rect.size.height -= 76;
|
||||||
|
rect.size.width -= 16;
|
||||||
|
rect.origin.x += 8;
|
||||||
|
split = [[PCSplitView alloc] initWithFrame:rect];
|
||||||
|
[split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
|
||||||
|
_c_view = [projectWindow contentView];
|
||||||
|
|
||||||
|
[split addSubview:browser];
|
||||||
|
[split addSubview:box];
|
||||||
|
[split adjustSubviews];
|
||||||
|
[_c_view addSubview:split];
|
||||||
|
|
||||||
|
RELEASE(split);
|
||||||
|
RELEASE(browser);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File Browser
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef ENABLE_HISTORY
|
||||||
|
historyController = [[PCHistoryController alloc] initWithProject:self];
|
||||||
|
|
||||||
|
history = [[NSBrowser alloc] initWithFrame:NSMakeRect(320,372,232,60)];
|
||||||
|
|
||||||
|
[history setDelegate:historyController];
|
||||||
|
[history setMaxVisibleColumns:1];
|
||||||
|
[history setAllowsMultipleSelection:NO];
|
||||||
|
[history setHasHorizontalScroller:NO];
|
||||||
|
[history setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
|
||||||
|
|
||||||
|
[historyController setBrowser:history];
|
||||||
|
|
||||||
|
[_c_view addSubview:history];
|
||||||
|
RELEASE(history);
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* Left button matrix
|
||||||
|
*/
|
||||||
|
|
||||||
|
rect = NSMakeRect(8,372,300,60);
|
||||||
|
matrix = [[NSMatrix alloc] initWithFrame: rect
|
||||||
|
mode: NSHighlightModeMatrix
|
||||||
|
prototype: buttonCell
|
||||||
|
numberOfRows: 1
|
||||||
|
numberOfColumns: 5];
|
||||||
|
[matrix setTarget:self];
|
||||||
|
[matrix setAction:@selector(topButtonsPressed:)];
|
||||||
|
[matrix setSelectionByRect:YES];
|
||||||
|
[matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
||||||
|
[_c_view addSubview:matrix];
|
||||||
|
RELEASE(matrix);
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:0];
|
||||||
|
[button setTag:BUILD_TAG];
|
||||||
|
[button setImagePosition:NSImageAbove];
|
||||||
|
[button setTitle:@"Build"];
|
||||||
|
[button setImage:IMAGE(@"ProjectCentre_build")];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:1];
|
||||||
|
[button setTag:LAUNCH_TAG];
|
||||||
|
[button setImagePosition:NSImageAbove];
|
||||||
|
[button setTitle:@"Run"];
|
||||||
|
[button setImage:IMAGE(@"ProjectCentre_run.tiff")];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:2];
|
||||||
|
[button setTag:SETTINGS_TAG];
|
||||||
|
[button setImagePosition:NSImageAbove];
|
||||||
|
[button setTitle:@"Settings"];
|
||||||
|
[button setImage:IMAGE(@"ProjectCentre_settings.tiff")];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:3];
|
||||||
|
[button setTag:EDITOR_TAG];
|
||||||
|
[button setImagePosition:NSImageAbove];
|
||||||
|
[button setTitle:@"Editor"];
|
||||||
|
[button setImage:IMAGE(@"ProjectCentre_files.tiff")];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
button = [matrix cellAtRow:0 column:4];
|
||||||
|
[button setTag:PREFS_TAG];
|
||||||
|
[button setImagePosition:NSImageAbove];
|
||||||
|
[button setTitle:@"Options"];
|
||||||
|
[button setImage:IMAGE(@"ProjectCentre_prefs.tiff")];
|
||||||
|
[button setButtonType:NSMomentaryPushButton];
|
||||||
|
|
||||||
|
[matrix sizeToCells];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build Options Panel
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
rect = NSMakeRect(100,100,272,80);
|
||||||
|
style = NSTitledWindowMask | NSClosableWindowMask;
|
||||||
|
buildTargetPanel = [[NSWindow alloc] initWithContentRect:rect
|
||||||
|
styleMask:style
|
||||||
|
backing:NSBackingStoreBuffered
|
||||||
|
defer:YES];
|
||||||
|
[buildTargetPanel setDelegate:self];
|
||||||
|
[buildTargetPanel setReleasedWhenClosed:NO];
|
||||||
|
[buildTargetPanel setTitle:@"Build Options"];
|
||||||
|
_c_view = [buildTargetPanel contentView];
|
||||||
|
|
||||||
|
// Host
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Host:"];
|
||||||
|
[_c_view addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
// Host message
|
||||||
|
buildTargetHostField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,184,21)];
|
||||||
|
[buildTargetHostField setAlignment: NSLeftTextAlignment];
|
||||||
|
[buildTargetHostField setBordered: NO];
|
||||||
|
[buildTargetHostField setEditable: YES];
|
||||||
|
[buildTargetHostField setBezeled: YES];
|
||||||
|
[buildTargetHostField setDrawsBackground: YES];
|
||||||
|
[buildTargetHostField setStringValue:@"localhost"];
|
||||||
|
[buildTargetHostField setDelegate:self];
|
||||||
|
[buildTargetHostField setTarget:self];
|
||||||
|
[buildTargetHostField setAction:@selector(setHost:)];
|
||||||
|
[_c_view addSubview:buildTargetHostField];
|
||||||
|
|
||||||
|
// Args
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,44,60,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Arguments:"];
|
||||||
|
[_c_view addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
// Args message
|
||||||
|
buildTargetArgsField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,44,184,21)];
|
||||||
|
[buildTargetArgsField setAlignment: NSLeftTextAlignment];
|
||||||
|
[buildTargetArgsField setBordered: NO];
|
||||||
|
[buildTargetArgsField setEditable: YES];
|
||||||
|
[buildTargetArgsField setBezeled: YES];
|
||||||
|
[buildTargetArgsField setDrawsBackground: YES];
|
||||||
|
[buildTargetArgsField setStringValue:@""];
|
||||||
|
[buildTargetArgsField setDelegate:self];
|
||||||
|
[buildTargetArgsField setTarget:self];
|
||||||
|
[buildTargetArgsField setAction:@selector(setArguments:)];
|
||||||
|
[_c_view addSubview:buildTargetArgsField];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Model the standard inspector UI
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
projectAttributeInspectorView = [[NSBox alloc] init];
|
||||||
|
[projectAttributeInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
||||||
|
[projectAttributeInspectorView setTitlePosition:NSNoTitle];
|
||||||
|
[projectAttributeInspectorView setBorderType:NSNoBorder];
|
||||||
|
[projectAttributeInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Install in:"];
|
||||||
|
[projectAttributeInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
installPathField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
||||||
|
[installPathField setAlignment: NSLeftTextAlignment];
|
||||||
|
[installPathField setBordered: YES];
|
||||||
|
[installPathField setEditable: YES];
|
||||||
|
[installPathField setBezeled: YES];
|
||||||
|
[installPathField setDrawsBackground: YES];
|
||||||
|
[installPathField setStringValue:@""];
|
||||||
|
[installPathField setAction:@selector(changeCommonProjectEntry:)];
|
||||||
|
[installPathField setTarget:self];
|
||||||
|
[projectAttributeInspectorView addSubview:installPathField];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,256,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Build tool:"];
|
||||||
|
[projectAttributeInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
toolField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,256,176,21)];
|
||||||
|
[toolField setAlignment: NSLeftTextAlignment];
|
||||||
|
[toolField setBordered: YES];
|
||||||
|
[toolField setEditable: YES];
|
||||||
|
[toolField setBezeled: YES];
|
||||||
|
[toolField setDrawsBackground: YES];
|
||||||
|
[toolField setStringValue:@""];
|
||||||
|
[toolField setAction:@selector(changeCommonProjectEntry:)];
|
||||||
|
[toolField setTarget:self];
|
||||||
|
[projectAttributeInspectorView addSubview:toolField];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,232,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"CC options:"];
|
||||||
|
[projectAttributeInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
ccOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,232,176,21)];
|
||||||
|
[ccOptField setAlignment: NSLeftTextAlignment];
|
||||||
|
[ccOptField setBordered: YES];
|
||||||
|
[ccOptField setEditable: YES];
|
||||||
|
[ccOptField setBezeled: YES];
|
||||||
|
[ccOptField setDrawsBackground: YES];
|
||||||
|
[ccOptField setStringValue:@""];
|
||||||
|
[ccOptField setAction:@selector(changeCommonProjectEntry:)];
|
||||||
|
[ccOptField setTarget:self];
|
||||||
|
[projectAttributeInspectorView addSubview:ccOptField];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,204,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"LD options:"];
|
||||||
|
[projectAttributeInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
ldOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
|
||||||
|
[ldOptField setAlignment: NSLeftTextAlignment];
|
||||||
|
[ldOptField setBordered: YES];
|
||||||
|
[ldOptField setEditable: NO];
|
||||||
|
[ldOptField setBezeled: YES];
|
||||||
|
[ldOptField setDrawsBackground: YES];
|
||||||
|
[ldOptField setStringValue:@""];
|
||||||
|
[ldOptField setAction:@selector(changeCommonProjectEntry:)];
|
||||||
|
[ldOptField setTarget:self];
|
||||||
|
[projectAttributeInspectorView addSubview:ldOptField];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Project View
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
projectProjectInspectorView = [[NSBox alloc] init];
|
||||||
|
[projectProjectInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
||||||
|
[projectProjectInspectorView setTitlePosition:NSNoTitle];
|
||||||
|
[projectProjectInspectorView setBorderType:NSNoBorder];
|
||||||
|
[projectProjectInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Type:"];
|
||||||
|
[projectProjectInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
projectTypeField = [[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
||||||
|
[projectTypeField setAlignment: NSLeftTextAlignment];
|
||||||
|
[projectTypeField setBordered: NO];
|
||||||
|
[projectTypeField setEditable: NO];
|
||||||
|
[projectTypeField setBezeled: NO];
|
||||||
|
[projectTypeField setDrawsBackground: NO];
|
||||||
|
[projectTypeField setStringValue:@""];
|
||||||
|
[projectProjectInspectorView addSubview:projectTypeField];
|
||||||
|
|
||||||
|
projectFileInspectorView = [[NSBox alloc] init];
|
||||||
|
[projectFileInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
||||||
|
[projectFileInspectorView setTitlePosition:NSNoTitle];
|
||||||
|
[projectFileInspectorView setBorderType:NSNoBorder];
|
||||||
|
[projectFileInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
||||||
|
|
||||||
|
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Filename:"];
|
||||||
|
[projectFileInspectorView addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
fileNameField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
||||||
|
[fileNameField setAlignment: NSLeftTextAlignment];
|
||||||
|
[fileNameField setBordered: NO];
|
||||||
|
[fileNameField setEditable: NO];
|
||||||
|
[fileNameField setBezeled: NO];
|
||||||
|
[fileNameField setDrawsBackground: NO];
|
||||||
|
[fileNameField setStringValue:@""];
|
||||||
|
[projectFileInspectorView addSubview:fileNameField];
|
||||||
|
|
||||||
|
changeFileNameButton = [[NSButton alloc] initWithFrame:NSMakeRect(84,240,104,21)];
|
||||||
|
[changeFileNameButton setTitle:@"Rename..."];
|
||||||
|
[changeFileNameButton setTarget:self];
|
||||||
|
[changeFileNameButton setAction:@selector(renameFile:)];
|
||||||
|
[projectFileInspectorView addSubview:changeFileNameButton];
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
[browser loadColumnZero];
|
||||||
|
|
||||||
|
#ifdef ENABLE_HISTORY
|
||||||
|
[history loadColumnZero];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -27,399 +27,16 @@
|
||||||
#import "PCProject.h"
|
#import "PCProject.h"
|
||||||
#import "PCDefines.h"
|
#import "PCDefines.h"
|
||||||
#import "ProjectBuilder.h"
|
#import "ProjectBuilder.h"
|
||||||
#import "PCBrowserController.h"
|
|
||||||
#import "PCProject+ComponentHandling.h"
|
#import "PCProject+ComponentHandling.h"
|
||||||
#import "PCProjectBuilder.h"
|
#import "PCProjectBuilder.h"
|
||||||
#import "PCProjectEditor.h"
|
#import "PCProjectEditor.h"
|
||||||
#import "PCProjectDebugger.h"
|
#import "PCProjectDebugger.h"
|
||||||
#import "PCSplitView.h"
|
|
||||||
#import "PCEditor.h"
|
#import "PCEditor.h"
|
||||||
#import "PCEditorController.h"
|
#import "PCEditorController.h"
|
||||||
#import "PCHistoryController.h"
|
#import "PCHistoryController.h"
|
||||||
|
#import "PCBrowserController.h"
|
||||||
|
|
||||||
#define ENABLE_HISTORY
|
#import "PCProject+UInterface.h"
|
||||||
|
|
||||||
@interface PCProject (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCProject (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI
|
|
||||||
{
|
|
||||||
NSView *_c_view;
|
|
||||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask |
|
|
||||||
NSMiniaturizableWindowMask | NSResizableWindowMask;
|
|
||||||
NSBrowser *browser;
|
|
||||||
NSBrowser *history;
|
|
||||||
NSRect rect;
|
|
||||||
NSMatrix* matrix;
|
|
||||||
NSButtonCell* buttonCell = [[[NSButtonCell alloc] init] autorelease];
|
|
||||||
id textField;
|
|
||||||
id button;
|
|
||||||
PCSplitView *split;
|
|
||||||
|
|
||||||
browserController = [[PCBrowserController alloc] init];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Project Window
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
rect = NSMakeRect(100,100,560,440);
|
|
||||||
projectWindow = [[NSWindow alloc] initWithContentRect:rect
|
|
||||||
styleMask:style
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:YES];
|
|
||||||
[projectWindow setDelegate:self];
|
|
||||||
[projectWindow setMinSize:NSMakeSize(560,448)];
|
|
||||||
|
|
||||||
browser = [[NSBrowser alloc] initWithFrame:NSMakeRect(-1,251,562,128)];
|
|
||||||
[browser setDelegate:browserController];
|
|
||||||
[browser setMaxVisibleColumns:3];
|
|
||||||
[browser setAllowsMultipleSelection:NO];
|
|
||||||
[browser setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
|
|
||||||
|
|
||||||
[browserController setBrowser:browser];
|
|
||||||
[browserController setProject:self];
|
|
||||||
|
|
||||||
box = [[NSBox alloc] initWithFrame:NSMakeRect (-1,-1,562,252)];
|
|
||||||
[box setTitlePosition:NSNoTitle];
|
|
||||||
[box setBorderType:NSNoBorder];
|
|
||||||
[box setContentViewMargins: NSMakeSize(0.0,0.0)];
|
|
||||||
[box setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
|
|
||||||
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,200,500,21)];
|
|
||||||
[textField setAlignment: NSLeftTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Welcome to ProjectCenter.app"];
|
|
||||||
[box addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
rect = [[projectWindow contentView] frame];
|
|
||||||
rect.size.height -= 76;
|
|
||||||
rect.size.width -= 16;
|
|
||||||
rect.origin.x += 8;
|
|
||||||
split = [[PCSplitView alloc] initWithFrame:rect];
|
|
||||||
[split setAutoresizingMask: (NSViewWidthSizable | NSViewHeightSizable)];
|
|
||||||
|
|
||||||
_c_view = [projectWindow contentView];
|
|
||||||
|
|
||||||
[split addSubview:browser];
|
|
||||||
[split addSubview:box];
|
|
||||||
[split adjustSubviews];
|
|
||||||
[_c_view addSubview:split];
|
|
||||||
|
|
||||||
RELEASE(split);
|
|
||||||
RELEASE(browser);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* File Browser
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef ENABLE_HISTORY
|
|
||||||
historyController = [[PCHistoryController alloc] initWithProject:self];
|
|
||||||
|
|
||||||
history = [[NSBrowser alloc] initWithFrame:NSMakeRect(320,372,232,60)];
|
|
||||||
|
|
||||||
[history setDelegate:historyController];
|
|
||||||
[history setMaxVisibleColumns:1];
|
|
||||||
[history setAllowsMultipleSelection:NO];
|
|
||||||
[history setHasHorizontalScroller:NO];
|
|
||||||
[history setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
|
|
||||||
|
|
||||||
[historyController setBrowser:history];
|
|
||||||
|
|
||||||
[_c_view addSubview:history];
|
|
||||||
RELEASE(history);
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
* Left button matrix
|
|
||||||
*/
|
|
||||||
|
|
||||||
rect = NSMakeRect(8,372,300,60);
|
|
||||||
matrix = [[NSMatrix alloc] initWithFrame: rect
|
|
||||||
mode: NSHighlightModeMatrix
|
|
||||||
prototype: buttonCell
|
|
||||||
numberOfRows: 1
|
|
||||||
numberOfColumns: 5];
|
|
||||||
[matrix sizeToCells];
|
|
||||||
[matrix setTarget:self];
|
|
||||||
[matrix setAction:@selector(topButtonsPressed:)];
|
|
||||||
[matrix setSelectionByRect:YES];
|
|
||||||
[matrix setAutoresizingMask: (NSViewMaxXMargin | NSViewMinYMargin)];
|
|
||||||
[_c_view addSubview:matrix];
|
|
||||||
RELEASE(matrix);
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:0];
|
|
||||||
[button setTag:BUILD_TAG];
|
|
||||||
[button setImagePosition:NSImageAbove];
|
|
||||||
[button setTitle:@"Build"];
|
|
||||||
[button setImage:IMAGE(@"ProjectCentre_build")];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:1];
|
|
||||||
[button setTag:LAUNCH_TAG];
|
|
||||||
[button setImagePosition:NSImageAbove];
|
|
||||||
[button setTitle:@"Run"];
|
|
||||||
[button setImage:IMAGE(@"ProjectCentre_run.tiff")];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:2];
|
|
||||||
[button setTag:SETTINGS_TAG];
|
|
||||||
[button setImagePosition:NSImageAbove];
|
|
||||||
[button setTitle:@"Settings"];
|
|
||||||
[button setImage:IMAGE(@"ProjectCentre_settings.tiff")];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:3];
|
|
||||||
[button setTag:EDITOR_TAG];
|
|
||||||
[button setImagePosition:NSImageAbove];
|
|
||||||
[button setTitle:@"Editor"];
|
|
||||||
[button setImage:IMAGE(@"ProjectCentre_files.tiff")];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
button = [matrix cellAtRow:0 column:4];
|
|
||||||
[button setTag:PREFS_TAG];
|
|
||||||
[button setImagePosition:NSImageAbove];
|
|
||||||
[button setTitle:@"Options"];
|
|
||||||
[button setImage:IMAGE(@"ProjectCentre_prefs.tiff")];
|
|
||||||
[button setButtonType:NSMomentaryPushButton];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Build Options Panel
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
rect = NSMakeRect(100,100,272,80);
|
|
||||||
style = NSTitledWindowMask | NSClosableWindowMask;
|
|
||||||
buildTargetPanel = [[NSWindow alloc] initWithContentRect:rect
|
|
||||||
styleMask:style
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:YES];
|
|
||||||
[buildTargetPanel setDelegate:self];
|
|
||||||
[buildTargetPanel setReleasedWhenClosed:NO];
|
|
||||||
[buildTargetPanel setTitle:@"Build Options"];
|
|
||||||
_c_view = [buildTargetPanel contentView];
|
|
||||||
|
|
||||||
// Host
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,24,56,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Host:"];
|
|
||||||
[_c_view addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
// Host message
|
|
||||||
buildTargetHostField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,24,184,21)];
|
|
||||||
[buildTargetHostField setAlignment: NSLeftTextAlignment];
|
|
||||||
[buildTargetHostField setBordered: NO];
|
|
||||||
[buildTargetHostField setEditable: YES];
|
|
||||||
[buildTargetHostField setBezeled: YES];
|
|
||||||
[buildTargetHostField setDrawsBackground: YES];
|
|
||||||
[buildTargetHostField setStringValue:@"localhost"];
|
|
||||||
[buildTargetHostField setDelegate:self];
|
|
||||||
[buildTargetHostField setTarget:self];
|
|
||||||
[buildTargetHostField setAction:@selector(setHost:)];
|
|
||||||
[_c_view addSubview:buildTargetHostField];
|
|
||||||
|
|
||||||
// Args
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(12,44,60,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Arguments:"];
|
|
||||||
[_c_view addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
// Args message
|
|
||||||
buildTargetArgsField = [[NSTextField alloc] initWithFrame:NSMakeRect(72,44,184,21)];
|
|
||||||
[buildTargetArgsField setAlignment: NSLeftTextAlignment];
|
|
||||||
[buildTargetArgsField setBordered: NO];
|
|
||||||
[buildTargetArgsField setEditable: YES];
|
|
||||||
[buildTargetArgsField setBezeled: YES];
|
|
||||||
[buildTargetArgsField setDrawsBackground: YES];
|
|
||||||
[buildTargetArgsField setStringValue:@""];
|
|
||||||
[buildTargetArgsField setDelegate:self];
|
|
||||||
[buildTargetArgsField setTarget:self];
|
|
||||||
[buildTargetArgsField setAction:@selector(setArguments:)];
|
|
||||||
[_c_view addSubview:buildTargetArgsField];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Model the standard inspector UI
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
projectAttributeInspectorView = [[NSBox alloc] init];
|
|
||||||
[projectAttributeInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
|
||||||
[projectAttributeInspectorView setTitlePosition:NSNoTitle];
|
|
||||||
[projectAttributeInspectorView setBorderType:NSNoBorder];
|
|
||||||
[projectAttributeInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Install in:"];
|
|
||||||
[projectAttributeInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
installPathField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
|
||||||
[installPathField setAlignment: NSLeftTextAlignment];
|
|
||||||
[installPathField setBordered: YES];
|
|
||||||
[installPathField setEditable: YES];
|
|
||||||
[installPathField setBezeled: YES];
|
|
||||||
[installPathField setDrawsBackground: YES];
|
|
||||||
[installPathField setStringValue:@""];
|
|
||||||
[installPathField setAction:@selector(changeCommonProjectEntry:)];
|
|
||||||
[installPathField setTarget:self];
|
|
||||||
[projectAttributeInspectorView addSubview:installPathField];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,256,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Build tool:"];
|
|
||||||
[projectAttributeInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
toolField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,256,176,21)];
|
|
||||||
[toolField setAlignment: NSLeftTextAlignment];
|
|
||||||
[toolField setBordered: YES];
|
|
||||||
[toolField setEditable: YES];
|
|
||||||
[toolField setBezeled: YES];
|
|
||||||
[toolField setDrawsBackground: YES];
|
|
||||||
[toolField setStringValue:@""];
|
|
||||||
[toolField setAction:@selector(changeCommonProjectEntry:)];
|
|
||||||
[toolField setTarget:self];
|
|
||||||
[projectAttributeInspectorView addSubview:toolField];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,232,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"CC options:"];
|
|
||||||
[projectAttributeInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
ccOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,232,176,21)];
|
|
||||||
[ccOptField setAlignment: NSLeftTextAlignment];
|
|
||||||
[ccOptField setBordered: YES];
|
|
||||||
[ccOptField setEditable: YES];
|
|
||||||
[ccOptField setBezeled: YES];
|
|
||||||
[ccOptField setDrawsBackground: YES];
|
|
||||||
[ccOptField setStringValue:@""];
|
|
||||||
[ccOptField setAction:@selector(changeCommonProjectEntry:)];
|
|
||||||
[ccOptField setTarget:self];
|
|
||||||
[projectAttributeInspectorView addSubview:ccOptField];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,204,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"LD options:"];
|
|
||||||
[projectAttributeInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
ldOptField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,204,176,21)];
|
|
||||||
[ldOptField setAlignment: NSLeftTextAlignment];
|
|
||||||
[ldOptField setBordered: YES];
|
|
||||||
[ldOptField setEditable: NO];
|
|
||||||
[ldOptField setBezeled: YES];
|
|
||||||
[ldOptField setDrawsBackground: YES];
|
|
||||||
[ldOptField setStringValue:@""];
|
|
||||||
[ldOptField setAction:@selector(changeCommonProjectEntry:)];
|
|
||||||
[ldOptField setTarget:self];
|
|
||||||
[projectAttributeInspectorView addSubview:ldOptField];
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Project View
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
projectProjectInspectorView = [[NSBox alloc] init];
|
|
||||||
[projectProjectInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
|
||||||
[projectProjectInspectorView setTitlePosition:NSNoTitle];
|
|
||||||
[projectProjectInspectorView setBorderType:NSNoBorder];
|
|
||||||
[projectProjectInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Type:"];
|
|
||||||
[projectProjectInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
projectTypeField = [[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
|
||||||
[projectTypeField setAlignment: NSLeftTextAlignment];
|
|
||||||
[projectTypeField setBordered: NO];
|
|
||||||
[projectTypeField setEditable: NO];
|
|
||||||
[projectTypeField setBezeled: NO];
|
|
||||||
[projectTypeField setDrawsBackground: NO];
|
|
||||||
[projectTypeField setStringValue:@""];
|
|
||||||
[projectProjectInspectorView addSubview:projectTypeField];
|
|
||||||
|
|
||||||
projectFileInspectorView = [[NSBox alloc] init];
|
|
||||||
[projectFileInspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
|
||||||
[projectFileInspectorView setTitlePosition:NSNoTitle];
|
|
||||||
[projectFileInspectorView setBorderType:NSNoBorder];
|
|
||||||
[projectFileInspectorView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
|
|
||||||
|
|
||||||
textField =[[NSTextField alloc] initWithFrame:NSMakeRect(16,280,64,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Filename:"];
|
|
||||||
[projectFileInspectorView addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
fileNameField =[[NSTextField alloc] initWithFrame:NSMakeRect(84,280,176,21)];
|
|
||||||
[fileNameField setAlignment: NSLeftTextAlignment];
|
|
||||||
[fileNameField setBordered: NO];
|
|
||||||
[fileNameField setEditable: NO];
|
|
||||||
[fileNameField setBezeled: NO];
|
|
||||||
[fileNameField setDrawsBackground: NO];
|
|
||||||
[fileNameField setStringValue:@""];
|
|
||||||
[projectFileInspectorView addSubview:fileNameField];
|
|
||||||
|
|
||||||
changeFileNameButton = [[NSButton alloc] initWithFrame:NSMakeRect(84,240,104,21)];
|
|
||||||
[changeFileNameButton setTitle:@"Rename..."];
|
|
||||||
[changeFileNameButton setTarget:self];
|
|
||||||
[changeFileNameButton setAction:@selector(renameFile:)];
|
|
||||||
[projectFileInspectorView addSubview:changeFileNameButton];
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
[browser loadColumnZero];
|
|
||||||
[history loadColumnZero];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCProject
|
@implementation PCProject
|
||||||
|
|
||||||
|
|
15
PCLib/PCProjectManager+UInterface.h
Normal file
15
PCLib/PCProjectManager+UInterface.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//
|
||||||
|
// PCProjectManager+UInterface.h
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCProjectManager.h"
|
||||||
|
|
||||||
|
@interface PCProjectManager (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI;
|
||||||
|
|
||||||
|
@end
|
58
PCLib/PCProjectManager+UInterface.m
Normal file
58
PCLib/PCProjectManager+UInterface.m
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
//
|
||||||
|
// PCProjectManager+UInterface.m
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCProjectManager+UInterface.h"
|
||||||
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
@implementation PCProjectManager (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI
|
||||||
|
{
|
||||||
|
NSView *_c_view;
|
||||||
|
unsigned int style = NSTitledWindowMask | NSClosableWindowMask;
|
||||||
|
NSRect _w_frame;
|
||||||
|
NSBox *line;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Inspector Window
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
_w_frame = NSMakeRect(200,300,280,384);
|
||||||
|
inspector = [[NSWindow alloc] initWithContentRect:_w_frame
|
||||||
|
styleMask:style
|
||||||
|
backing:NSBackingStoreBuffered
|
||||||
|
defer:YES];
|
||||||
|
[inspector setMinSize:NSMakeSize(280,384)];
|
||||||
|
[inspector setTitle:@"Inspector"];
|
||||||
|
[inspector setReleasedWhenClosed:NO];
|
||||||
|
[inspector setFrameAutosaveName:@"Inspector"];
|
||||||
|
_c_view = [inspector contentView];
|
||||||
|
|
||||||
|
_w_frame = NSMakeRect(80,352,128,20);
|
||||||
|
inspectorPopup = [[NSPopUpButton alloc] initWithFrame:_w_frame];
|
||||||
|
[inspectorPopup addItemWithTitle:@"None"];
|
||||||
|
[inspectorPopup setTarget:self];
|
||||||
|
[inspectorPopup setAction:@selector(inspectorPopupDidChange:)];
|
||||||
|
[_c_view addSubview:inspectorPopup];
|
||||||
|
|
||||||
|
line = [[[NSBox alloc] init] autorelease];
|
||||||
|
[line setTitlePosition:NSNoTitle];
|
||||||
|
[line setFrame:NSMakeRect(0,336,280,2)];
|
||||||
|
[_c_view addSubview:line];
|
||||||
|
|
||||||
|
inspectorView = [[NSBox alloc] init];
|
||||||
|
[inspectorView setTitlePosition:NSNoTitle];
|
||||||
|
[inspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
||||||
|
[inspectorView setBorderType:NSNoBorder];
|
||||||
|
[_c_view addSubview:inspectorView];
|
||||||
|
|
||||||
|
_needsReleasing = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -34,6 +34,8 @@
|
||||||
#import "PCProject+ComponentHandling.h"
|
#import "PCProject+ComponentHandling.h"
|
||||||
#import "ProjectBuilder.h"
|
#import "ProjectBuilder.h"
|
||||||
|
|
||||||
|
#import "PCProjectManager+UInterface.h"
|
||||||
|
|
||||||
#if defined(GNUSTEP)
|
#if defined(GNUSTEP)
|
||||||
#import <AppKit/IMLoading.h>
|
#import <AppKit/IMLoading.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -42,60 +44,6 @@
|
||||||
|
|
||||||
NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
|
||||||
|
|
||||||
@interface PCProjectManager (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCProjectManager (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI
|
|
||||||
{
|
|
||||||
NSView *_c_view;
|
|
||||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask;
|
|
||||||
NSRect _w_frame;
|
|
||||||
NSBox *line;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Inspector Window
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
_w_frame = NSMakeRect(200,300,280,384);
|
|
||||||
inspector = [[NSWindow alloc] initWithContentRect:_w_frame
|
|
||||||
styleMask:style
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:YES];
|
|
||||||
[inspector setMinSize:NSMakeSize(280,384)];
|
|
||||||
[inspector setTitle:@"Inspector"];
|
|
||||||
[inspector setReleasedWhenClosed:NO];
|
|
||||||
[inspector setFrameAutosaveName:@"Inspector"];
|
|
||||||
_c_view = [inspector contentView];
|
|
||||||
|
|
||||||
_w_frame = NSMakeRect(80,352,128,20);
|
|
||||||
inspectorPopup = [[NSPopUpButton alloc] initWithFrame:_w_frame];
|
|
||||||
[inspectorPopup addItemWithTitle:@"None"];
|
|
||||||
[inspectorPopup setTarget:self];
|
|
||||||
[inspectorPopup setAction:@selector(inspectorPopupDidChange:)];
|
|
||||||
[_c_view addSubview:inspectorPopup];
|
|
||||||
|
|
||||||
line = [[[NSBox alloc] init] autorelease];
|
|
||||||
[line setTitlePosition:NSNoTitle];
|
|
||||||
[line setFrame:NSMakeRect(0,336,280,2)];
|
|
||||||
[_c_view addSubview:line];
|
|
||||||
|
|
||||||
inspectorView = [[NSBox alloc] init];
|
|
||||||
[inspectorView setTitlePosition:NSNoTitle];
|
|
||||||
[inspectorView setFrame:NSMakeRect(-2,-2,284,334)];
|
|
||||||
[inspectorView setBorderType:NSNoBorder];
|
|
||||||
[_c_view addSubview:inspectorView];
|
|
||||||
|
|
||||||
_needsReleasing = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCProjectManager
|
@implementation PCProjectManager
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
15
PCLib/PCTextFinder+UInterface.h
Normal file
15
PCLib/PCTextFinder+UInterface.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
//
|
||||||
|
// PCTextFinder+UInterface.h
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCTextFinder.h"
|
||||||
|
|
||||||
|
@interface PCTextFinder (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI;
|
||||||
|
|
||||||
|
@end
|
208
PCLib/PCTextFinder+UInterface.m
Normal file
208
PCLib/PCTextFinder+UInterface.m
Normal file
|
@ -0,0 +1,208 @@
|
||||||
|
//
|
||||||
|
// PCTextFinder+UInterface.m
|
||||||
|
// ProjectCenter
|
||||||
|
//
|
||||||
|
// Created by Philippe C.D. Robert on Wed Nov 27 2002.
|
||||||
|
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "PCTextFinder+UInterface.h"
|
||||||
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
@implementation PCTextFinder (UInterface)
|
||||||
|
|
||||||
|
- (void)_initUI
|
||||||
|
{
|
||||||
|
int mask = (NSTitledWindowMask | NSClosableWindowMask);
|
||||||
|
NSRect rect = NSMakeRect( 100, 100, 440, 184 );
|
||||||
|
NSTextField *textField;
|
||||||
|
NSBox *box;
|
||||||
|
NSButtonCell *cell;
|
||||||
|
NSMatrix *borderMatrix;
|
||||||
|
|
||||||
|
panel = [[NSPanel alloc] initWithContentRect:rect
|
||||||
|
styleMask:mask
|
||||||
|
backing:NSBackingStoreBuffered
|
||||||
|
defer:YES];
|
||||||
|
[panel setTitle: @"Find Panel"];
|
||||||
|
[panel setReleasedWhenClosed: NO];
|
||||||
|
|
||||||
|
// Find textfield
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,148,88,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Find:"];
|
||||||
|
[[panel contentView] addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
rect = NSMakeRect(104,148,328 ,21);
|
||||||
|
findTextField = [[NSTextField alloc] initWithFrame:rect];
|
||||||
|
[findTextField setAlignment: NSLeftTextAlignment];
|
||||||
|
[findTextField setBordered: NO];
|
||||||
|
[findTextField setEditable: YES];
|
||||||
|
[findTextField setBezeled: YES];
|
||||||
|
[findTextField setDrawsBackground: YES];
|
||||||
|
[findTextField setStringValue:@""];
|
||||||
|
[findTextField setDelegate:self];
|
||||||
|
[findTextField setTarget:self];
|
||||||
|
[findTextField setAction:@selector(setHost:)];
|
||||||
|
[[panel contentView] addSubview:findTextField];
|
||||||
|
RELEASE(findTextField);
|
||||||
|
|
||||||
|
[panel makeFirstResponder:findTextField];
|
||||||
|
|
||||||
|
// Replace field
|
||||||
|
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,120,88,21)];
|
||||||
|
[textField setAlignment: NSRightTextAlignment];
|
||||||
|
[textField setBordered: NO];
|
||||||
|
[textField setEditable: NO];
|
||||||
|
[textField setBezeled: NO];
|
||||||
|
[textField setDrawsBackground: NO];
|
||||||
|
[textField setStringValue:@"Replace with:"];
|
||||||
|
[[panel contentView] addSubview:textField];
|
||||||
|
RELEASE(textField);
|
||||||
|
|
||||||
|
rect = NSMakeRect(104,120,328 ,21);
|
||||||
|
replaceTextField = [[NSTextField alloc] initWithFrame:rect];
|
||||||
|
[replaceTextField setAlignment: NSLeftTextAlignment];
|
||||||
|
[replaceTextField setBordered: NO];
|
||||||
|
[replaceTextField setEditable: YES];
|
||||||
|
[replaceTextField setBezeled: YES];
|
||||||
|
[replaceTextField setDrawsBackground: YES];
|
||||||
|
[replaceTextField setStringValue:@""];
|
||||||
|
[replaceTextField setDelegate:self];
|
||||||
|
[replaceTextField setTarget:self];
|
||||||
|
[replaceTextField setAction:@selector(setHost:)];
|
||||||
|
[[panel contentView] addSubview:replaceTextField];
|
||||||
|
RELEASE(replaceTextField);
|
||||||
|
|
||||||
|
[findTextField setNextResponder:replaceTextField];
|
||||||
|
|
||||||
|
// Options
|
||||||
|
rect = NSMakeRect(104,40,144 ,80);
|
||||||
|
box = [[NSBox alloc] initWithFrame:rect];
|
||||||
|
[box setTitle:@"Replace All Scope"];
|
||||||
|
[[panel contentView] addSubview:box];
|
||||||
|
RELEASE(box);
|
||||||
|
|
||||||
|
cell = [[NSButtonCell alloc] init];
|
||||||
|
[cell setButtonType: NSRadioButton];
|
||||||
|
[cell setBordered: NO];
|
||||||
|
[cell setImagePosition: NSImageLeft];
|
||||||
|
|
||||||
|
rect = NSMakeRect(16,8,112 ,48);
|
||||||
|
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
||||||
|
mode: NSRadioModeMatrix
|
||||||
|
prototype: cell
|
||||||
|
numberOfRows: 2
|
||||||
|
numberOfColumns: 1];
|
||||||
|
|
||||||
|
[borderMatrix setIntercellSpacing: NSMakeSize (0, 4) ];
|
||||||
|
[borderMatrix setTarget: self];
|
||||||
|
[borderMatrix setAutosizesCells: NO];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow: 0 column: 0];
|
||||||
|
[cell setTitle: @"Entire File"];
|
||||||
|
[cell setTag:0];
|
||||||
|
[cell setAction: @selector(setReplaceAllScope:)];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow: 1 column: 0];
|
||||||
|
[cell setTitle: @"Selection"];
|
||||||
|
[cell setTag:1];
|
||||||
|
[cell setAction: @selector(setReplaceAllScope:)];
|
||||||
|
|
||||||
|
[borderMatrix sizeToFit];
|
||||||
|
[box addSubview:borderMatrix];
|
||||||
|
RELEASE(borderMatrix);
|
||||||
|
|
||||||
|
rect = NSMakeRect(252,40,180 ,80);
|
||||||
|
box = [[NSBox alloc] initWithFrame:rect];
|
||||||
|
[box setTitle:@"Find Options"];
|
||||||
|
[[panel contentView] addSubview:box];
|
||||||
|
RELEASE(box);
|
||||||
|
|
||||||
|
cell = [[NSButtonCell alloc] init];
|
||||||
|
[cell setButtonType: NSSwitchButton];
|
||||||
|
[cell setBordered: NO];
|
||||||
|
[cell setImagePosition: NSImageLeft];
|
||||||
|
|
||||||
|
rect = NSMakeRect(16,8,140 ,48);
|
||||||
|
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
||||||
|
mode: NSHighlightModeMatrix
|
||||||
|
prototype: cell
|
||||||
|
numberOfRows: 2
|
||||||
|
numberOfColumns: 1];
|
||||||
|
|
||||||
|
[borderMatrix setIntercellSpacing: NSMakeSize (0, 4) ];
|
||||||
|
[borderMatrix setTarget: self];
|
||||||
|
[borderMatrix setAutosizesCells: NO];
|
||||||
|
|
||||||
|
ignoreCaseButton = [borderMatrix cellAtRow: 0 column: 0];
|
||||||
|
[ignoreCaseButton setTitle: @"Ignore Case"];
|
||||||
|
[ignoreCaseButton setState: YES];
|
||||||
|
[ignoreCaseButton setAction: @selector(setIgnoreCase:)];
|
||||||
|
|
||||||
|
regexpButton = [borderMatrix cellAtRow: 1 column: 0];
|
||||||
|
[regexpButton setTitle: @"Regular Expression"];
|
||||||
|
[regexpButton setState: NO];
|
||||||
|
//[regexpButton setAction: @selector(setIsRegExp:)];
|
||||||
|
|
||||||
|
[borderMatrix sizeToFit];
|
||||||
|
[box addSubview:borderMatrix];
|
||||||
|
RELEASE(borderMatrix);
|
||||||
|
|
||||||
|
cell = [[NSButtonCell alloc] init];
|
||||||
|
[cell setImagePosition: NSNoImage];
|
||||||
|
|
||||||
|
rect = NSMakeRect(8,8,412,24);
|
||||||
|
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
||||||
|
mode: NSHighlightModeMatrix
|
||||||
|
prototype: cell
|
||||||
|
numberOfRows: 1
|
||||||
|
numberOfColumns: 4];
|
||||||
|
|
||||||
|
[borderMatrix setIntercellSpacing: NSMakeSize (4, 0) ];
|
||||||
|
[borderMatrix setTarget: self];
|
||||||
|
[borderMatrix setAction: @selector(buttonPressed:)];
|
||||||
|
[borderMatrix setAutosizesCells: NO];
|
||||||
|
[replaceTextField setNextResponder:borderMatrix];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow:0 column:0];
|
||||||
|
[cell setTitle: @"Replace All"];
|
||||||
|
[cell setTag:0];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow:0 column:1];
|
||||||
|
[cell setTitle: @"Replace"];
|
||||||
|
[cell setTag:1];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow:0 column:2];
|
||||||
|
[cell setTitle: @"Previous"];
|
||||||
|
[cell setTag:2];
|
||||||
|
|
||||||
|
cell = [borderMatrix cellAtRow:0 column:3];
|
||||||
|
[cell setTitle: @"Next"];
|
||||||
|
[cell setTag:3];
|
||||||
|
|
||||||
|
[[panel contentView] addSubview:borderMatrix];
|
||||||
|
RELEASE(borderMatrix);
|
||||||
|
|
||||||
|
rect = NSMakeRect(16,64,80,24);
|
||||||
|
statusField = [[NSTextField alloc] initWithFrame:rect];
|
||||||
|
[statusField setAlignment: NSLeftTextAlignment];
|
||||||
|
[statusField setBordered: NO];
|
||||||
|
[statusField setEditable: NO];
|
||||||
|
[statusField setBezeled: NO];
|
||||||
|
[statusField setDrawsBackground: NO];
|
||||||
|
[statusField setStringValue:@""];
|
||||||
|
[statusField setDelegate:self];
|
||||||
|
[[panel contentView] addSubview:statusField];
|
||||||
|
RELEASE(statusField);
|
||||||
|
|
||||||
|
[panel setDelegate: self];
|
||||||
|
[panel center];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -17,6 +17,8 @@
|
||||||
#import "PCTextFinder.h"
|
#import "PCTextFinder.h"
|
||||||
#import "PCDefines.h"
|
#import "PCDefines.h"
|
||||||
|
|
||||||
|
#import "PCTextFinder+UInterface.h"
|
||||||
|
|
||||||
#define Forward YES
|
#define Forward YES
|
||||||
#define Backward NO
|
#define Backward NO
|
||||||
|
|
||||||
|
@ -74,210 +76,6 @@
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface PCTextFinder (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCTextFinder (CreateUI)
|
|
||||||
|
|
||||||
- (void)_initUI
|
|
||||||
{
|
|
||||||
int mask = (NSTitledWindowMask | NSClosableWindowMask);
|
|
||||||
NSRect rect = NSMakeRect( 100, 100, 440, 184 );
|
|
||||||
NSTextField *textField;
|
|
||||||
NSBox *box;
|
|
||||||
NSButtonCell *cell;
|
|
||||||
NSMatrix *borderMatrix;
|
|
||||||
|
|
||||||
panel = [[NSPanel alloc] initWithContentRect:rect
|
|
||||||
styleMask:mask
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:YES];
|
|
||||||
[panel setTitle: @"Find Panel"];
|
|
||||||
[panel setReleasedWhenClosed: NO];
|
|
||||||
|
|
||||||
// Find textfield
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,148,88,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Find:"];
|
|
||||||
[[panel contentView] addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
rect = NSMakeRect(104,148,328 ,21);
|
|
||||||
findTextField = [[NSTextField alloc] initWithFrame:rect];
|
|
||||||
[findTextField setAlignment: NSLeftTextAlignment];
|
|
||||||
[findTextField setBordered: NO];
|
|
||||||
[findTextField setEditable: YES];
|
|
||||||
[findTextField setBezeled: YES];
|
|
||||||
[findTextField setDrawsBackground: YES];
|
|
||||||
[findTextField setStringValue:@""];
|
|
||||||
[findTextField setDelegate:self];
|
|
||||||
[findTextField setTarget:self];
|
|
||||||
[findTextField setAction:@selector(setHost:)];
|
|
||||||
[[panel contentView] addSubview:findTextField];
|
|
||||||
RELEASE(findTextField);
|
|
||||||
|
|
||||||
[panel makeFirstResponder:findTextField];
|
|
||||||
|
|
||||||
// Replace field
|
|
||||||
textField = [[NSTextField alloc] initWithFrame:NSMakeRect(16,120,88,21)];
|
|
||||||
[textField setAlignment: NSRightTextAlignment];
|
|
||||||
[textField setBordered: NO];
|
|
||||||
[textField setEditable: NO];
|
|
||||||
[textField setBezeled: NO];
|
|
||||||
[textField setDrawsBackground: NO];
|
|
||||||
[textField setStringValue:@"Replace with:"];
|
|
||||||
[[panel contentView] addSubview:textField];
|
|
||||||
RELEASE(textField);
|
|
||||||
|
|
||||||
rect = NSMakeRect(104,120,328 ,21);
|
|
||||||
replaceTextField = [[NSTextField alloc] initWithFrame:rect];
|
|
||||||
[replaceTextField setAlignment: NSLeftTextAlignment];
|
|
||||||
[replaceTextField setBordered: NO];
|
|
||||||
[replaceTextField setEditable: YES];
|
|
||||||
[replaceTextField setBezeled: YES];
|
|
||||||
[replaceTextField setDrawsBackground: YES];
|
|
||||||
[replaceTextField setStringValue:@""];
|
|
||||||
[replaceTextField setDelegate:self];
|
|
||||||
[replaceTextField setTarget:self];
|
|
||||||
[replaceTextField setAction:@selector(setHost:)];
|
|
||||||
[[panel contentView] addSubview:replaceTextField];
|
|
||||||
RELEASE(replaceTextField);
|
|
||||||
|
|
||||||
[findTextField setNextResponder:replaceTextField];
|
|
||||||
|
|
||||||
// Options
|
|
||||||
rect = NSMakeRect(104,40,144 ,80);
|
|
||||||
box = [[NSBox alloc] initWithFrame:rect];
|
|
||||||
[box setTitle:@"Replace All Scope"];
|
|
||||||
[[panel contentView] addSubview:box];
|
|
||||||
RELEASE(box);
|
|
||||||
|
|
||||||
cell = [[NSButtonCell alloc] init];
|
|
||||||
[cell setButtonType: NSRadioButton];
|
|
||||||
[cell setBordered: NO];
|
|
||||||
[cell setImagePosition: NSImageLeft];
|
|
||||||
|
|
||||||
rect = NSMakeRect(16,8,112 ,48);
|
|
||||||
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
|
||||||
mode: NSRadioModeMatrix
|
|
||||||
prototype: cell
|
|
||||||
numberOfRows: 2
|
|
||||||
numberOfColumns: 1];
|
|
||||||
|
|
||||||
[borderMatrix setIntercellSpacing: NSMakeSize (0, 4) ];
|
|
||||||
[borderMatrix setTarget: self];
|
|
||||||
[borderMatrix setAutosizesCells: NO];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow: 0 column: 0];
|
|
||||||
[cell setTitle: @"Entire File"];
|
|
||||||
[cell setTag:0];
|
|
||||||
[cell setAction: @selector(setReplaceAllScope:)];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow: 1 column: 0];
|
|
||||||
[cell setTitle: @"Selection"];
|
|
||||||
[cell setTag:1];
|
|
||||||
[cell setAction: @selector(setReplaceAllScope:)];
|
|
||||||
|
|
||||||
[borderMatrix sizeToFit];
|
|
||||||
[box addSubview:borderMatrix];
|
|
||||||
RELEASE(borderMatrix);
|
|
||||||
|
|
||||||
rect = NSMakeRect(252,40,180 ,80);
|
|
||||||
box = [[NSBox alloc] initWithFrame:rect];
|
|
||||||
[box setTitle:@"Find Options"];
|
|
||||||
[[panel contentView] addSubview:box];
|
|
||||||
RELEASE(box);
|
|
||||||
|
|
||||||
cell = [[NSButtonCell alloc] init];
|
|
||||||
[cell setButtonType: NSSwitchButton];
|
|
||||||
[cell setBordered: NO];
|
|
||||||
[cell setImagePosition: NSImageLeft];
|
|
||||||
|
|
||||||
rect = NSMakeRect(16,8,140 ,48);
|
|
||||||
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
|
||||||
mode: NSHighlightModeMatrix
|
|
||||||
prototype: cell
|
|
||||||
numberOfRows: 2
|
|
||||||
numberOfColumns: 1];
|
|
||||||
|
|
||||||
[borderMatrix setIntercellSpacing: NSMakeSize (0, 4) ];
|
|
||||||
[borderMatrix setTarget: self];
|
|
||||||
[borderMatrix setAutosizesCells: NO];
|
|
||||||
|
|
||||||
ignoreCaseButton = [borderMatrix cellAtRow: 0 column: 0];
|
|
||||||
[ignoreCaseButton setTitle: @"Ignore Case"];
|
|
||||||
[ignoreCaseButton setState: YES];
|
|
||||||
[ignoreCaseButton setAction: @selector(setIgnoreCase:)];
|
|
||||||
|
|
||||||
regexpButton = [borderMatrix cellAtRow: 1 column: 0];
|
|
||||||
[regexpButton setTitle: @"Regular Expression"];
|
|
||||||
[regexpButton setState: NO];
|
|
||||||
//[regexpButton setAction: @selector(setIsRegExp:)];
|
|
||||||
|
|
||||||
[borderMatrix sizeToFit];
|
|
||||||
[box addSubview:borderMatrix];
|
|
||||||
RELEASE(borderMatrix);
|
|
||||||
|
|
||||||
cell = [[NSButtonCell alloc] init];
|
|
||||||
[cell setImagePosition: NSNoImage];
|
|
||||||
|
|
||||||
rect = NSMakeRect(8,8,412,24);
|
|
||||||
borderMatrix = [[NSMatrix alloc] initWithFrame: rect
|
|
||||||
mode: NSHighlightModeMatrix
|
|
||||||
prototype: cell
|
|
||||||
numberOfRows: 1
|
|
||||||
numberOfColumns: 4];
|
|
||||||
|
|
||||||
[borderMatrix setIntercellSpacing: NSMakeSize (4, 0) ];
|
|
||||||
[borderMatrix setTarget: self];
|
|
||||||
[borderMatrix setAction: @selector(buttonPressed:)];
|
|
||||||
[borderMatrix setAutosizesCells: NO];
|
|
||||||
[replaceTextField setNextResponder:borderMatrix];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow:0 column:0];
|
|
||||||
[cell setTitle: @"Replace All"];
|
|
||||||
[cell setTag:0];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow:0 column:1];
|
|
||||||
[cell setTitle: @"Replace"];
|
|
||||||
[cell setTag:1];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow:0 column:2];
|
|
||||||
[cell setTitle: @"Previous"];
|
|
||||||
[cell setTag:2];
|
|
||||||
|
|
||||||
cell = [borderMatrix cellAtRow:0 column:3];
|
|
||||||
[cell setTitle: @"Next"];
|
|
||||||
[cell setTag:3];
|
|
||||||
|
|
||||||
[[panel contentView] addSubview:borderMatrix];
|
|
||||||
RELEASE(borderMatrix);
|
|
||||||
|
|
||||||
rect = NSMakeRect(16,64,80,24);
|
|
||||||
statusField = [[NSTextField alloc] initWithFrame:rect];
|
|
||||||
[statusField setAlignment: NSLeftTextAlignment];
|
|
||||||
[statusField setBordered: NO];
|
|
||||||
[statusField setEditable: NO];
|
|
||||||
[statusField setBezeled: NO];
|
|
||||||
[statusField setDrawsBackground: NO];
|
|
||||||
[statusField setStringValue:@""];
|
|
||||||
[statusField setDelegate:self];
|
|
||||||
[[panel contentView] addSubview:statusField];
|
|
||||||
RELEASE(statusField);
|
|
||||||
|
|
||||||
[panel setDelegate: self];
|
|
||||||
[panel center];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation PCTextFinder
|
@implementation PCTextFinder
|
||||||
|
|
||||||
static PCTextFinder *_finder = nil;
|
static PCTextFinder *_finder = nil;
|
||||||
|
|
|
@ -187,6 +187,11 @@
|
||||||
F58C0A7C0390DFFD01000102,
|
F58C0A7C0390DFFD01000102,
|
||||||
F58C0A7D0390DFFD01000102,
|
F58C0A7D0390DFFD01000102,
|
||||||
F58C0A7E0390DFFD01000102,
|
F58C0A7E0390DFFD01000102,
|
||||||
|
F56CA061039534DC01000102,
|
||||||
|
F56CA0650395376801000102,
|
||||||
|
F56CA0690395378001000102,
|
||||||
|
F56CA06D0395379601000102,
|
||||||
|
F56CA071039537A901000102,
|
||||||
);
|
);
|
||||||
isa = PBXHeadersBuildPhase;
|
isa = PBXHeadersBuildPhase;
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -221,6 +226,11 @@
|
||||||
F58C0A720390DFFD01000102,
|
F58C0A720390DFFD01000102,
|
||||||
F58C0A740390DFFD01000102,
|
F58C0A740390DFFD01000102,
|
||||||
F58C0A760390DFFD01000102,
|
F58C0A760390DFFD01000102,
|
||||||
|
F56CA062039534DC01000102,
|
||||||
|
F56CA0660395376801000102,
|
||||||
|
F56CA06A0395378001000102,
|
||||||
|
F56CA06E0395379601000102,
|
||||||
|
F56CA072039537A901000102,
|
||||||
);
|
);
|
||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -287,6 +297,8 @@
|
||||||
F58C0A260390DFFD01000102,
|
F58C0A260390DFFD01000102,
|
||||||
F58C0A270390DFFD01000102,
|
F58C0A270390DFFD01000102,
|
||||||
F58C0A280390DFFD01000102,
|
F58C0A280390DFFD01000102,
|
||||||
|
F56CA0630395376801000102,
|
||||||
|
F56CA0640395376801000102,
|
||||||
F58C0A290390DFFD01000102,
|
F58C0A290390DFFD01000102,
|
||||||
F58C0A2A0390DFFD01000102,
|
F58C0A2A0390DFFD01000102,
|
||||||
F58C0A2B0390DFFD01000102,
|
F58C0A2B0390DFFD01000102,
|
||||||
|
@ -295,6 +307,8 @@
|
||||||
F58C0A2E0390DFFD01000102,
|
F58C0A2E0390DFFD01000102,
|
||||||
F58C0A2F0390DFFD01000102,
|
F58C0A2F0390DFFD01000102,
|
||||||
F58C0A300390DFFD01000102,
|
F58C0A300390DFFD01000102,
|
||||||
|
F56CA0670395378001000102,
|
||||||
|
F56CA0680395378001000102,
|
||||||
F58C0A310390DFFD01000102,
|
F58C0A310390DFFD01000102,
|
||||||
F58C0A320390DFFD01000102,
|
F58C0A320390DFFD01000102,
|
||||||
F58C0A330390DFFD01000102,
|
F58C0A330390DFFD01000102,
|
||||||
|
@ -303,6 +317,8 @@
|
||||||
F58C0A360390DFFD01000102,
|
F58C0A360390DFFD01000102,
|
||||||
F58C0A370390DFFD01000102,
|
F58C0A370390DFFD01000102,
|
||||||
F58C0A380390DFFD01000102,
|
F58C0A380390DFFD01000102,
|
||||||
|
F56CA05F039534DC01000102,
|
||||||
|
F56CA060039534DC01000102,
|
||||||
F58C0A390390DFFD01000102,
|
F58C0A390390DFFD01000102,
|
||||||
F58C0A3A0390DFFD01000102,
|
F58C0A3A0390DFFD01000102,
|
||||||
F58C0A3B0390DFFD01000102,
|
F58C0A3B0390DFFD01000102,
|
||||||
|
@ -311,12 +327,16 @@
|
||||||
F58C0A3E0390DFFD01000102,
|
F58C0A3E0390DFFD01000102,
|
||||||
F58C0A3F0390DFFD01000102,
|
F58C0A3F0390DFFD01000102,
|
||||||
F58C0A400390DFFD01000102,
|
F58C0A400390DFFD01000102,
|
||||||
|
F56CA06B0395379601000102,
|
||||||
|
F56CA06C0395379601000102,
|
||||||
F58C0A410390DFFD01000102,
|
F58C0A410390DFFD01000102,
|
||||||
F58C0A420390DFFD01000102,
|
F58C0A420390DFFD01000102,
|
||||||
F58C0A430390DFFD01000102,
|
F58C0A430390DFFD01000102,
|
||||||
F58C0A440390DFFD01000102,
|
F58C0A440390DFFD01000102,
|
||||||
F58C0A450390DFFD01000102,
|
F58C0A450390DFFD01000102,
|
||||||
F58C0A460390DFFD01000102,
|
F58C0A460390DFFD01000102,
|
||||||
|
F56CA06F039537A901000102,
|
||||||
|
F56CA070039537A901000102,
|
||||||
F58C0A470390DFFD01000102,
|
F58C0A470390DFFD01000102,
|
||||||
F58C0A480390DFFD01000102,
|
F58C0A480390DFFD01000102,
|
||||||
F58C0A490390DFFD01000102,
|
F58C0A490390DFFD01000102,
|
||||||
|
@ -379,6 +399,131 @@
|
||||||
//F52
|
//F52
|
||||||
//F53
|
//F53
|
||||||
//F54
|
//F54
|
||||||
|
F56CA05F039534DC01000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCProject+UInterface.h";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA060039534DC01000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCProject+UInterface.m";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA061039534DC01000102 = {
|
||||||
|
fileRef = F56CA05F039534DC01000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
ATTRIBUTES = (
|
||||||
|
Private,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA062039534DC01000102 = {
|
||||||
|
fileRef = F56CA060039534DC01000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA0630395376801000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCEditor+UInterface.h";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA0640395376801000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCEditor+UInterface.m";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA0650395376801000102 = {
|
||||||
|
fileRef = F56CA0630395376801000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
ATTRIBUTES = (
|
||||||
|
Private,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA0660395376801000102 = {
|
||||||
|
fileRef = F56CA0640395376801000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA0670395378001000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCFileManager+UInterface.h";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA0680395378001000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCFileManager+UInterface.m";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA0690395378001000102 = {
|
||||||
|
fileRef = F56CA0670395378001000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
ATTRIBUTES = (
|
||||||
|
Private,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA06A0395378001000102 = {
|
||||||
|
fileRef = F56CA0680395378001000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA06B0395379601000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCProjectManager+UInterface.h";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA06C0395379601000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCProjectManager+UInterface.m";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA06D0395379601000102 = {
|
||||||
|
fileRef = F56CA06B0395379601000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
ATTRIBUTES = (
|
||||||
|
Private,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA06E0395379601000102 = {
|
||||||
|
fileRef = F56CA06C0395379601000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA06F039537A901000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCTextFinder+UInterface.h";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA070039537A901000102 = {
|
||||||
|
isa = PBXFileReference;
|
||||||
|
path = "PCTextFinder+UInterface.m";
|
||||||
|
refType = 4;
|
||||||
|
};
|
||||||
|
F56CA071039537A901000102 = {
|
||||||
|
fileRef = F56CA06F039537A901000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
ATTRIBUTES = (
|
||||||
|
Private,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
F56CA072039537A901000102 = {
|
||||||
|
fileRef = F56CA070039537A901000102;
|
||||||
|
isa = PBXBuildFile;
|
||||||
|
settings = {
|
||||||
|
};
|
||||||
|
};
|
||||||
F58C0A1F0390DFFD01000102 = {
|
F58C0A1F0390DFFD01000102 = {
|
||||||
isa = PBXFileReference;
|
isa = PBXFileReference;
|
||||||
path = FileCreator.h;
|
path = FileCreator.h;
|
||||||
|
|
Loading…
Reference in a new issue