From 3edc57ef9316a45660c73ae4df351ab77991c8a3 Mon Sep 17 00:00:00 2001 From: Jeff Teunissen Date: Sun, 26 May 2002 11:24:00 +0000 Subject: [PATCH] Forge updates. Compiles with latest GNUstep CVS, may not work with current release (but should). The interface is no longer defined in code -- it loads it from a .gorm file. The code is a lot cleaner, and I'm working on project management again. Generally, I'm having a lot of fun. :) --- tools/Forge/BundleController.h | 2 + tools/Forge/BundleController.m | 2 + tools/Forge/Bundles/MainPrefs/GNUmakefile | 5 +- .../Bundles/MainPrefs/GNUmakefile.preamble | 4 +- tools/Forge/Bundles/MainPrefs/MainPrefs.gorm | Bin 5374 -> 5398 bytes tools/Forge/Bundles/MainPrefs/MainPrefs.m | 30 +- tools/Forge/Bundles/MainPrefs/MainPrefsView.h | 57 -- tools/Forge/Bundles/MainPrefs/MainPrefsView.m | 158 ---- tools/Forge/Controller.h | 6 +- tools/Forge/Controller.m | 157 +--- tools/Forge/Forge.classes | 764 ++++++++++++------ tools/Forge/Forge.gorm | Bin 3457 -> 19419 bytes tools/Forge/GNUmakefile | 2 - tools/Forge/PrefsController.h | 16 +- tools/Forge/PrefsController.m | 86 +- tools/Forge/PrefsPanel.h | 59 -- tools/Forge/PrefsPanel.m | 165 ---- 17 files changed, 618 insertions(+), 895 deletions(-) delete mode 100644 tools/Forge/Bundles/MainPrefs/MainPrefsView.h delete mode 100644 tools/Forge/Bundles/MainPrefs/MainPrefsView.m delete mode 100644 tools/Forge/PrefsPanel.h delete mode 100644 tools/Forge/PrefsPanel.m diff --git a/tools/Forge/BundleController.h b/tools/Forge/BundleController.h index b90d4fbee..78a3f1091 100644 --- a/tools/Forge/BundleController.h +++ b/tools/Forge/BundleController.h @@ -36,6 +36,7 @@ #import #import +#import "PrefsController.h" #import "PrefsView.h" /* @@ -52,6 +53,7 @@ /* Methods for bundles to call */ +- (PrefsController *) prefsController; - (BOOL) registerPrefsController: (id ) aPrefsController; #if 0 - (BOOL) registerFileSubmenu: (NSMenu *) aMenu; diff --git a/tools/Forge/BundleController.m b/tools/Forge/BundleController.m index c4def40e6..4e97ac7db 100644 --- a/tools/Forge/BundleController.m +++ b/tools/Forge/BundleController.m @@ -37,6 +37,8 @@ static const char rcsid[] = #import #import #import +#import + #import #import "BundleController.h" diff --git a/tools/Forge/Bundles/MainPrefs/GNUmakefile b/tools/Forge/Bundles/MainPrefs/GNUmakefile index 041c67b89..b51066f9e 100644 --- a/tools/Forge/Bundles/MainPrefs/GNUmakefile +++ b/tools/Forge/Bundles/MainPrefs/GNUmakefile @@ -5,17 +5,16 @@ BUNDLE_EXTENSION= .forgeb # # We don't install this bundle, it goes inside the app. # -#BUNDLE_INSTALL_DIR= $(GNUSTEP_LOCAL_ROOT)/Library/Forge +BUNDLE_INSTALL_DIR= none +MainPrefs_STANDARD_INSTALL= no MainPrefs_RESOURCE_FILES= \ MainPrefs.gorm MainPrefs_OBJC_FILES= \ - MainPrefsView.m \ MainPrefs.m MainPrefs_HEADERS= \ - MainPrefsView.h \ MainPrefs.h MainPrefs_PRINCIPAL_CLASS= \ diff --git a/tools/Forge/Bundles/MainPrefs/GNUmakefile.preamble b/tools/Forge/Bundles/MainPrefs/GNUmakefile.preamble index 308372d72..f97e93f39 100644 --- a/tools/Forge/Bundles/MainPrefs/GNUmakefile.preamble +++ b/tools/Forge/Bundles/MainPrefs/GNUmakefile.preamble @@ -2,10 +2,10 @@ ADDITIONAL_CPPFLAGS += # Additional flags to pass to the Objective-C compiler -ADDITIONAL_OBJCFLAGS += -DUSING_NIBS +ADDITIONAL_OBJCFLAGS += -DUSING_NIBS -Wall -Werror # Additional flags to pass to the C compiler -ADDITIONAL_CFLAGS += +ADDITIONAL_CFLAGS += -Wall -Werror # Additional include directories the compiler should search ADDITIONAL_INCLUDE_DIRS += -I ../.. diff --git a/tools/Forge/Bundles/MainPrefs/MainPrefs.gorm b/tools/Forge/Bundles/MainPrefs/MainPrefs.gorm index 455617234b18f53cd8ebd8b1891a5d956657c9e8..558695d2055265869c1bf150a27773177eecaad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z3kgHD!knDVo!=;2x9J_v2|P4oUKr3qR>b3H=s?elgBIKscDp2Kb;Tj?K@GzD3Lf2@H!K-@u0 zNO7Or4{@J6^hoY7-V4S9Q;@*FrAy(F2JR?ckxhOKx8))6xEp~JRNfxEFW)c{khFBK zD+}fIa)l}o;9wl*f=eQ}x-*Xb5o1p^c#Gh}dzX7q^$^rWl76wWDe{y3F*93QH2 zIR%e1=WkmE#p$D%85ZLNoWwI~=J=@w&=UkYUC*$|>z`=Q(j?^V?P`tM=csx4Bs}SJ z&m3~YGB0qoJvhtgDVW6vp^QG)K%Xc20{+o#vM}S=8yc5qA?@RyI>Z@#hJh?N$3Rav zfX)->ng4*!!LvT-!VysSVm%+p&qosKLk3yuf4DUbOAYXg)c@z|K5Twi4P+rxEL}?` zlT?Np-WPQIS#7~%p$_~~Qt_A8=x7$6-@h6)$Q`I7w_0LDLAN@;7w+Phu{)fBm4<^~ zpsX&{J%fI*LE%DqtxzqNO9u^Dh8O)rUph?mpaH8m9yR&PcsY_X!fXcHn&-dfxaKs> za`3Vn#EnQd-ir(mT&bTP^m-h0mYuAVauQCz)9L7r1g|i(8Xe?cWyFHFVv@caQ3$Wq zeNE5TglqVHv}1V{?EjZ7n_Jo{*_9f+<{D1kS*^i!5{sUAokYeHMG|K{@dk+*Puw73 zd14(+tw*$-JZ#`;ZD6eAwmG)53g!AqN1M7u4JvQJn{3A-yoGnPM7(0Pb4E6oEneOK zBc-2`y;fyo#&Hyp4R7PG+K^Ip+bJv?Hc`^y#5)wguou7 +#import +#import +#import + #import #import #import -#import "PrefsPanel.h" #import "PrefsController.h" #import "MainPrefs.h" -#import "MainPrefsView.h" @interface MainPrefs (Private) @@ -174,21 +177,12 @@ static id owner = nil; self = [super init]; owner = anOwner; [owner registerPrefsController: self]; - if (![NSBundle loadNibNamed: @"MainPrefs" owner: self]) { - NSLog (@"MainPrefs: Could not load nib \"MainPrefs\", using compiled-in version"); - view = [[MainPrefsView alloc] initWithOwner: self andFrame: PrefsRect]; + if (![NSBundle loadNibNamed: @"MainPrefs" owner: self]) + return nil; - // hook up to our outlet(s) - projectPathField = [view projectPathField]; - bundlesFromUserButton = [view bundlesFromUserButton]; - bundlesFromLocalButton = [view bundlesFromLocalButton]; - bundlesFromNetworkButton = [view bundlesFromNetworkButton]; - bundlesFromSystemButton = [view bundlesFromSystemButton]; - } else { - // window can be any size, as long as it's 486x228 :) - view = [window contentView]; - } - [view retain]; + // window can be any size, as long as it's 486x228 :) + view = [[window contentView] retain]; + [window setExcludedFromWindowsMenu: YES]; [self loadPrefs: self]; @@ -223,7 +217,7 @@ static id owner = nil; - (void) showView: (id) sender; { - [[(PrefsPanel *)[[PrefsController sharedPrefsController] window] prefsViewBox] setContentView: view]; + [[[owner prefsController] prefsViewBox] setContentView: view]; [view setNeedsDisplay: YES]; } diff --git a/tools/Forge/Bundles/MainPrefs/MainPrefsView.h b/tools/Forge/Bundles/MainPrefs/MainPrefsView.h deleted file mode 100644 index 60a3e3b98..000000000 --- a/tools/Forge/Bundles/MainPrefs/MainPrefsView.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - ForgePrefsView.h - - Forge internal preferences view - - Copyright (C) 2001 Dusk to Dawn Computing, Inc. - - Author: Jeff Teunissen - Date: 17 Nov 2001 - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA -*/ - -#ifdef HAVE_CONFIG_H -# include "Config.h" -#endif - -#import "PrefsView.h" - -@interface MainPrefsView: NSView -{ - // for controllers to connect to - id projectPathField; - id projectPathFindButton; - id bundlesFromUserButton; - id bundlesFromLocalButton; - id bundlesFromNetworkButton; - id bundlesFromSystemButton; - - id owner; -} - -- (id) initWithOwner: (id) anOwner andFrame: (NSRect) frameRect; - -- (id) projectPathField; -- (id) bundlesFromUserButton; -- (id) bundlesFromLocalButton; -- (id) bundlesFromNetworkButton; -- (id) bundlesFromSystemButton; - -@end diff --git a/tools/Forge/Bundles/MainPrefs/MainPrefsView.m b/tools/Forge/Bundles/MainPrefs/MainPrefsView.m deleted file mode 100644 index c23ee4128..000000000 --- a/tools/Forge/Bundles/MainPrefs/MainPrefsView.m +++ /dev/null @@ -1,158 +0,0 @@ -/* - MainPrefsView.m - - Forge internal preferences view - - Copyright (C) 2001 Dusk to Dawn Computing, Inc. - - Author: Jeff Teunissen - Date: 17 Nov 2001 - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA -*/ -static const char rcsid[] = - "$Id$"; - -#ifdef HAVE_CONFIG_H -# include "Config.h" -#endif - -#import -#import -#import -#import - -#import "MainPrefsView.h" -#import "MainPrefs.h" - -@implementation MainPrefsView -/* - This class sucks, and shouldn't be necessary. With working "nibs", it isn't. -*/ -- (id) initWithOwner: (id) anOwner andFrame: (NSRect) frameRect -{ - id label = nil; - - owner = anOwner; - - if ((self = [super initWithFrame: frameRect])) { - - label = [[NSTextField alloc] initWithFrame: NSMakeRect (3, 201, 480, 24)]; - [label setEditable: NO]; - [label setSelectable: NO]; - [label setAllowsEditingTextAttributes: NO]; - [label setImportsGraphics: NO]; - [label setTextColor: [NSColor blackColor]]; - [label setBackgroundColor: [NSColor controlColor]]; - [label setBezeled: NO]; - [label setStringValue: @"Project load path"]; - [self addSubview: [label autorelease]]; - - projectPathField = [[NSTextField alloc] initWithFrame: NSMakeRect (3, 174, 409, 24)]; - [projectPathField setEditable: YES]; - [projectPathField setSelectable: YES]; - [projectPathField setAllowsEditingTextAttributes: NO]; - [projectPathField setImportsGraphics: NO]; - [projectPathField setTextColor: [NSColor blackColor]]; - [projectPathField setBackgroundColor: [NSColor whiteColor]]; - [projectPathField setBezeled: YES]; - [projectPathField setTarget: owner]; - [projectPathField setAction: @selector(projectPathChanged:)]; - [self addSubview: [projectPathField autorelease]]; - - projectPathFindButton = [[NSButton alloc] initWithFrame: NSMakeRect (419, 174, 64, 24)]; - [projectPathFindButton setTitle: @"Find..."]; - [projectPathFindButton setButtonType: NSMomentaryPushButton]; - [projectPathFindButton setTarget: owner]; - [projectPathFindButton setAction: @selector(projectPathFindButtonClicked:)]; - [self addSubview: [projectPathFindButton autorelease]]; - - label = [[NSTextField alloc] initWithFrame: NSMakeRect (3, 85, 130, 20)]; - [label setEditable: NO]; - [label setSelectable: NO]; - [label setAllowsEditingTextAttributes: NO]; - [label setImportsGraphics: NO]; - [label setTextColor: [NSColor blackColor]]; - [label setBackgroundColor: [NSColor controlColor]]; - [label setBezeled: NO]; - [label setStringValue: @"Load bundles from:"]; - [self addSubview: [label autorelease]]; - - bundlesFromUserButton = [[NSButton alloc] initWithFrame: NSMakeRect (160, 116, 150, 20)]; - [bundlesFromUserButton setTitle: @"Personal Library path"]; - [bundlesFromUserButton setButtonType: NSSwitchButton]; - [bundlesFromUserButton setImagePosition: NSImageRight]; - [bundlesFromUserButton setTarget: owner]; - [bundlesFromUserButton setAction: @selector(bundlesFromUserButtonChanged:)]; - [self addSubview: [bundlesFromUserButton autorelease]]; - - bundlesFromLocalButton = [[NSButton alloc] initWithFrame: NSMakeRect (160, 93, 150, 20)]; - [bundlesFromLocalButton setTitle: @"Local Library path"]; - [bundlesFromLocalButton setButtonType: NSSwitchButton]; - [bundlesFromLocalButton setImagePosition: NSImageRight]; - [bundlesFromLocalButton setTarget: owner]; - [bundlesFromLocalButton setAction: @selector(bundlesFromLocalButtonChanged:)]; - [self addSubview: [bundlesFromLocalButton autorelease]]; - - bundlesFromNetworkButton = [[NSButton alloc] initWithFrame: NSMakeRect (160, 70, 150, 20)]; - [bundlesFromNetworkButton setTitle: @"Networked Library path"]; - [bundlesFromNetworkButton setButtonType: NSSwitchButton]; - [bundlesFromNetworkButton setImagePosition: NSImageRight]; - [bundlesFromNetworkButton setTarget: owner]; - [bundlesFromNetworkButton setAction: @selector(bundlesFromNetworkButtonChanged:)]; - [self addSubview: [bundlesFromNetworkButton autorelease]]; - - bundlesFromSystemButton = [[NSButton alloc] initWithFrame: NSMakeRect (160, 47, 150, 20)]; - [bundlesFromSystemButton setTitle: @"System Library path"]; - [bundlesFromSystemButton setButtonType: NSSwitchButton]; - [bundlesFromSystemButton setImagePosition: NSImageRight]; - [bundlesFromSystemButton setTarget: owner]; - [bundlesFromSystemButton setAction: @selector(bundlesFromSystemButtonChanged:)]; - [self addSubview: [bundlesFromSystemButton autorelease]]; - - } - return self; -} - -- (id) projectPathField -{ - return projectPathField; -} - -- (id) bundlesFromUserButton -{ - return bundlesFromUserButton; -} - -- (id) bundlesFromLocalButton -{ - return bundlesFromLocalButton; -} - -- (id) bundlesFromNetworkButton -{ - return bundlesFromNetworkButton; -} - -- (id) bundlesFromSystemButton -{ - return bundlesFromSystemButton; -} - -@end diff --git a/tools/Forge/Controller.h b/tools/Forge/Controller.h index 4f666d792..5f721ce5d 100644 --- a/tools/Forge/Controller.h +++ b/tools/Forge/Controller.h @@ -38,9 +38,13 @@ #import #import "BundleController.h" +#import "PrefsController.h" @interface Controller: NSObject { + IBOutlet BundleController *bundleController; + IBOutlet PrefsController *prefsController; + IBOutlet id window; } // App delegate methods @@ -62,7 +66,7 @@ - (IBAction) infoPanel: (id) sender; - (IBAction) open: (id) sender; - (IBAction) openProject: (id) sender; -- (IBAction) saveAll: (id) sender; +- (IBAction) saveProject: (id) sender; - (IBAction) showPreferencesPanel: (id) sender; @end diff --git a/tools/Forge/Controller.m b/tools/Forge/Controller.m index 40ad7fac6..fbbacbccc 100644 --- a/tools/Forge/Controller.m +++ b/tools/Forge/Controller.m @@ -33,8 +33,11 @@ static const char rcsid[] = # include "Config.h" #endif +#import + #import #import + #import "Controller.h" #import "PrefsController.h" @@ -98,7 +101,7 @@ static const char rcsid[] = NSLog (@"This _would_ open a project, but it doesn't."); } -- (void) saveAll: (id) sender; +- (void) saveProject: (id) sender; { NSLog (@"This _would_ save, but it doesn't."); } @@ -106,7 +109,7 @@ static const char rcsid[] = - (void) showPreferencesPanel: (id) sender; { NSDebugLog (@"Showing Preferences panel..."); - [[PrefsController sharedPrefsController] orderFrontPreferencesPanel: self]; + [prefsController orderFrontPreferencesPanel: self]; } /* @@ -120,6 +123,7 @@ static const char rcsid[] = */ - (void) applicationDidFinishLaunching: (NSNotification *) not; { + [bundleController loadBundles]; } /* @@ -130,149 +134,18 @@ static const char rcsid[] = - (void) applicationWillFinishLaunching: (NSNotification *) not; { NSMenu *menu = [NSApp mainMenu]; - NSMenu *info; - NSMenu *project; - NSMenu *file; - NSMenu *edit; - NSMenu *windows; - NSMenu *services; - - [menu addItemWithTitle: _(@"Info") action: NULL keyEquivalent: @""]; - [menu addItemWithTitle: _(@"Project") action: NULL keyEquivalent: @""]; - [menu addItemWithTitle: _(@"File") action: NULL keyEquivalent: @""]; - [menu addItemWithTitle: _(@"Edit") action: NULL keyEquivalent: @""]; - [menu addItemWithTitle: _(@"Windows") action: NULL keyEquivalent: @""]; - [menu addItemWithTitle: _(@"Services") action: NULL keyEquivalent: @""]; - - [menu addItemWithTitle: _(@"Hide") action: @selector(hide:) keyEquivalent: @"h"]; - [menu addItemWithTitle: _(@"Quit") action: @selector(terminate:) keyEquivalent: @"q"]; - - /* - Info - */ - NSDebugLog (@"Info"); - info = [[[NSMenu alloc] init] autorelease]; - [menu setSubmenu: info forItem: [menu itemWithTitle: _(@"Info")]]; - - [info addItemWithTitle: _(@"Info Panel...") - action: @selector (orderFrontStandardAboutPanel:) - keyEquivalent: @""]; - [info addItemWithTitle: _(@"Preferences...") - action: @selector (showPreferencesPanel:) - keyEquivalent: @""]; - [info addItemWithTitle: _(@"Help") - action: @selector (orderFrontHelpPanel:) - keyEquivalent: @"?"]; - - /* - Project - */ - NSDebugLog (@"Project"); - 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 (createNewProject:) - keyEquivalent: @"n"]; - [project addItemWithTitle: _(@"Save...") - action: @selector (saveProject:) - keyEquivalent: @"s"]; - [project addItemWithTitle: _(@"Save As...") - action: @selector (saveProjectAs:) - keyEquivalent: @"S"]; - [project addItemWithTitle: _(@"Close") - action: @selector (closeProject:) - keyEquivalent: @""]; - - /* - File - */ - NSDebugLog (@"File"); - file = [[[NSMenu alloc] init] autorelease]; - [menu setSubmenu: file forItem: [menu itemWithTitle: _(@"File")]]; - - [file addItemWithTitle: _(@"Add File...") - action: @selector (addFileToProject:) - keyEquivalent: @"a"]; - [file addItemWithTitle: _(@"Add New File...") - action: @selector (addNewFileToProject:) - keyEquivalent: @"N"]; - [file addItemWithTitle: _(@"Save File") - action: @selector (saveFile:) - keyEquivalent: @"f"]; - [file addItemWithTitle: _(@"Revert to Saved") - action: @selector (revertToSaved:) - keyEquivalent: @""]; - [file addItemWithTitle: _(@"Close") - action: @selector (close:) - keyEquivalent: @""]; - - /* - Edit - */ - NSDebugLog (@"Edit"); - edit = [[[NSMenu alloc] init] autorelease]; - [menu setSubmenu: edit forItem: [menu itemWithTitle: _(@"Edit")]]; - - [edit addItemWithTitle: _(@"Undo") - action: @selector (undo:) - keyEquivalent: @"z"]; - [edit addItemWithTitle: _(@"Redo") - action: @selector (redo:) - keyEquivalent: @"Z"]; - [edit addItemWithTitle: _(@"Cut") - action: @selector (cut:) - keyEquivalent: @"x"]; - [edit addItemWithTitle: _(@"Copy") - action: @selector (copy:) - keyEquivalent: @"c"]; - [edit addItemWithTitle: _(@"Paste") - action: @selector (paste:) - keyEquivalent: @"v"]; - [edit addItemWithTitle: _(@"Delete") - action: @selector (delete:) - keyEquivalent: @""]; - [edit addItemWithTitle: _(@"Select All") - action: @selector (selectAll:) - keyEquivalent: @"a"]; /* Windows */ NSDebugLog (@"Windows"); - windows = [[[NSMenu alloc] init] autorelease]; - [menu setSubmenu: windows forItem: [menu itemWithTitle: _(@"Windows")]]; - - [windows addItemWithTitle: _(@"Close Window") - action: @selector (performClose:) - keyEquivalent: @"w"]; - [windows addItemWithTitle: _(@"Miniaturize Window") - action: @selector (performMiniaturize:) - keyEquivalent: @"m"]; - [windows addItemWithTitle: _(@"Arrange in Front") - action: @selector (arrangeInFront:) - keyEquivalent: @""]; - - [NSApp setWindowsMenu: windows]; + [NSApp setWindowsMenu: [[menu itemWithTitle: _(@"Windows")] submenu]]; /* Services */ NSDebugLog (@"Services"); - services = [[[NSMenu alloc] init] autorelease]; - - [NSApp setServicesMenu: services]; - [menu setSubmenu: services forItem: [menu itemWithTitle: _(@"Services")]]; - - { // yeah, yeah, shaddap - id controller = [[BundleController alloc] init]; - - [controller setDelegate: self]; - [controller loadBundles]; - } + [NSApp setServicesMenu: [[menu itemWithTitle: _(@"Services")] submenu]]; } /* @@ -284,6 +157,13 @@ static const char rcsid[] = { } +/****** + Nib awakening +******/ +- (void) awakeFromNib +{ +} + /****** Bundle Controller delegate methods ******/ @@ -315,12 +195,17 @@ static const char rcsid[] = [[(id ) [aBundle principalClass] alloc] initWithOwner: self]; } +- (PrefsController *) prefsController; +{ + return prefsController; +} + - (BOOL) registerPrefsController: (id ) aPrefsController { if (!aPrefsController) return NO; - [[PrefsController sharedPrefsController] addPrefsViewController: aPrefsController]; + [prefsController addPrefsViewController: aPrefsController]; return YES; } diff --git a/tools/Forge/Forge.classes b/tools/Forge/Forge.classes index c9f5fdec8..776c3a8ed 100644 --- a/tools/Forge/Forge.classes +++ b/tools/Forge/Forge.classes @@ -8,250 +8,47 @@ ); Super = NSObject; }; - GMArchiver = { + Controller = { Actions = ( + addFileToProject:, + addNewFileToProject:, + closeProject:, + createNewProject:, + infoPanel:, + openProject:, + openSelectedFile:, + saveProject:, + showPreferencesPanel: ); Outlets = ( - lastObjectRepresentation - ); - Super = NSObject; - }; - GSHelpManagerPanel = { - Actions = ( - ); - Outlets = ( - ); - Super = NSPanel; - }; - GSInfoPanel = { - Actions = ( - ); - Outlets = ( - ); - Super = NSPanel; - }; - GSVbox = { - Actions = ( - ); - Outlets = ( - ); - Super = GSTable; - }; - IBInspector = { - Actions = ( - ok:, - revert:, - touch: - ); - Outlets = ( + bundleController, + prefsController, window ); Super = NSObject; }; - IMConnector = { - Actions = ( - ); - Outlets = ( - destination, - source - ); - Super = NSObject; - }; - IMControlConnector = { - Actions = ( - ); - Outlets = ( - ); - Super = IMConnector; - }; - IMCustomObject = { - Actions = ( - ); - Outlets = ( - extension, - realObject - ); - Super = NSObject; - }; - IMCustomView = { - Actions = ( - ); - Outlets = ( - extension, - realObject - ); - Super = NSView; - }; - IMOutletConnector = { - Actions = ( - ); - Outlets = ( - ); - Super = IMConnector; - }; - NSApplication = { + FirstResponder = { Actions = ( + activateContextHelpMode:, + addFileToProject:, + addNewFileToProject:, + alignCenter:, + alignJustified:, + alignLeft:, + alignRight:, arrangeInFront:, - hide:, - hideOtherApplications:, - miniaturiseAll:, - orderFrontDataLinkPanel:, - orderFrontHelpPanel:, - orderFrontStandardAboutPanel:, - orderFrontStandardAboutPanelWithOptions:, - orderFrontcolorPanel:, - removeWindowsItem:, - runPageLayout:, - setAppleMenu:, - setDelegate:, - setMainMenu:, - setServicesMenu:, - setServicesProvider:, - setWindowsMenu:, - terminate:, - unhide:, - unhideAllApplications: - ); - Outlets = ( - delegate - ); - Super = NSResponder; - }; - NSButton = { - Super = NSControl; - }; - NSClipView = { - Actions = ( - ); - Outlets = ( - ); - Super = NSView; - }; - NSControl = { - Actions = ( - takeDoubleValueFrom:, - takeFloatValueFrom:, - takeIntValueFrom:, - takeObjectValueFrom:, - takeStringValueFrom: - ); - Outlets = ( - target - ); - Super = NSView; - }; - NSDocument = { - Actions = ( - canCloseDocumentWithDelegate:, - printDocument:, - revertDocumentToSaved:, - runPageLayout:, - saveDocument:, - saveDocumentAs:, - saveDocumentTo:, - saveDocumentWithDelegate: - ); - Outlets = ( - ); - Super = NSObject; - }; - NSDocumentController = { - Actions = ( - clearRecentDocuments:, - closeAllDocumentsWithDelegate:, - newDocument:, - openDocument:, - saveAllDocuments: - ); - Outlets = ( - ); - Super = NSObject; - }; - NSDrawer = { - Actions = ( - close:, - open:, - setDelegate:, - toggle: - ); - Outlets = ( - ); - Super = NSResponder; - }; - NSFontManager = { - Actions = ( - addFontTrait:, - modifyFont:, - modifyFontViaPanel:, - orderFrontFontPanel:, - removeFontTrait:, - setDelegate: - ); - Outlets = ( - ); - Super = NSObject; - }; - NSGraphicsContext = { - Actions = ( - ); - Outlets = ( - ); - Super = NSObject; - }; - NSHelpManager = { - Actions = ( - removeContextHelpForObject: - ); - Outlets = ( - ); - Super = NSObject; - }; - NSLayoutManager = { - Actions = ( - setDelegate: - ); - Outlets = ( - ); - Super = NSObject; - }; - NSMenu = { - Super = NSObject; - }; - NSMenuItem = { - Outlets = ( - target - ); - Super = NSObject; - }; - NSPageLayout = { - Actions = ( - pickedButton, - pickedOrientation, - pickedPaperSize, - pickedUnits - ); - Outlets = ( - ); - Super = NSPanel; - }; - NSPanel = { - Super = NSWindow; - }; - NSPasteboard = { - Actions = ( - ); - Outlets = ( - owner, - target - ); - Super = NSObject; - }; - NSResponder = { - Actions = ( + cancel:, capitalizeWord:, - centerSelectionInVisibleArea:, - changeCaseOfLetter:, + changeColor:, + changeFont:, + checkSpelling:, + close:, complete:, + copy:, + copyFont:, + copyRuler:, + cut:, + delete:, deleteBackward:, deleteForward:, deleteToBeginningOfLine:, @@ -261,14 +58,18 @@ deleteToMark:, deleteWordBackward:, deleteWordForward:, + deminiaturize:, + deselectAll:, + fax:, + hide:, + hideOtherApplications:, indent:, - insertBacktab:, - insertNewline:, - insertNewlineIgnoringFieldEditor:, - insertParagraphSeparator:, - insertTab:, - insertTabIgnoringFieldEditor:, + loosenKerning:, + lowerBaseline:, lowercaseWord:, + makeKeyAndOrderFront:, + miniaturize:, + miniaturizeAll:, moveBackward:, moveBackwardAndModifySelection:, moveDown:, @@ -289,89 +90,526 @@ moveWordBackwardAndModifySelection:, moveWordForward:, moveWordForwardAndModifySelection:, + ok:, + open:, + openSelectedFile:, + orderBack:, + orderFront:, + orderFrontColorPanel:, + orderFrontDataLinkPanel:, + orderFrontHelpPanel:, + orderFrontStandardAboutPanel:, + orderFrontStandardInfoPanel:, + orderOut:, pageDown:, pageUp:, + paste:, + pasteAsPlainText:, + pasteAsRichText:, + pasteFont:, + pasteRuler:, + performClose:, + performMiniaturize:, + performZoom:, + print:, + raiseBaseline:, + revertToSaved:, + runPageLayout:, + runToolbarCustomizationPalette:, + saveFile:, scrollLineDown:, scrollLineUp:, scrollPageDown:, scrollPageUp:, + scrollViaScroller:, selectAll:, selectLine:, + selectNextKeyView:, selectParagraph:, + selectPreviousKeyView:, + selectText:, + selectText:, selectToMark:, selectWord:, - setNextResponder:, showContextHelp:, + showGuessPanel:, + showHelp:, + showWindow:, + stop:, + subscript:, + superscript:, swapWithMark:, + takeDoubleValueFrom:, + takeFloatValueFrom:, + takeIntValueFrom:, + takeObjectValueFrom:, + takeStringValueFrom:, + terminate:, + tightenKerning:, + toggle:, + toggleContinuousSpellChecking:, + toggleRuler:, + toggleToolbarShown:, + toggleTraditionalCharacterShape:, transpose:, transposeWords:, + turnOffKerning:, + turnOffLigatures:, + underline:, + unhide:, + unhideAllApplications:, + unscript:, uppercaseWord:, - yank: + useAllLigatures:, + useStandardKerning:, + useStandardLigatures:, + yank:, + zoom: ); Super = NSObject; }; - NSRulerView = { + IBInspector = { + Actions = ( + ok:, + revert:, + touch: + ); + Outlets = ( + window + ); + Super = NSObject; + }; + IBPalette = { Actions = ( ); Outlets = ( + originalWindow ); - Super = NSView; + Super = NSObject; }; - NSSecureTextField = { + NSActionCell = { + Super = NSCell; + }; + NSApplication = { Actions = ( + arrangeInFront:, + hide:, + hideOtherApplications:, + miniaturizeAll:, + orderFrontColorPanel:, + orderFrontDataLinkPanel:, + orderFrontHelpPanel:, + orderFrontStandardAboutPanel:, + orderFrontStandardInfoPanel:, + runPageLayout:, + stop:, + terminate:, + unhide:, + unhideAllApplications: ); Outlets = ( + delegate ); - Super = NSTextField; + Super = NSResponder; }; - NSSlider = { - Super = NSControl; + NSArray = { + Super = NSObject; }; - NSStepper = { + NSBrowser = { Actions = ( - ); - Outlets = ( - ); - Super = NSControl; - }; - NSTextField = { - Actions = ( - setDelegate:, - setNextText:, - setPreviousText: + doClick:, + doDoubleClick:, + selectAll: ); Outlets = ( delegate ); Super = NSControl; }; + NSBrowserCell = { + Super = NSCell; + }; + NSButton = { + Actions = ( + performClick: + ); + Super = NSControl; + }; + NSButtonCell = { + Actions = ( + performClick: + ); + Super = NSActionCell; + }; + NSCStringText = { + Actions = ( + clear:, + selectText: + ); + Super = NSText; + }; + NSCell = { + Actions = ( + takeDoubleValueFrom:, + takeFloatValueFrom:, + takeIntValueFrom:, + takeStringValueFrom: + ); + Super = NSObject; + }; + NSColorWell = { + Actions = ( + takeColorFrom: + ); + Super = NSControl; + }; + NSComboBox = { + Outlets = ( + dataSource + ); + Super = NSTextField; + }; + NSControl = { + Actions = ( + takeDoubleValueFrom:, + takeFloatValueFrom:, + takeIntValueFrom:, + takeObjectValueFrom:, + takeStringValueFrom: + ); + Outlets = ( + target + ); + Super = NSView; + }; + NSCursor = { + Super = NSObject; + }; + NSDateFormatter = { + Super = NSFormatter; + }; + NSDictionary = { + Super = NSObject; + }; + NSDocument = { + Actions = ( + printDocument:, + revertDocumentToSaved:, + runPageLayout:, + saveDocument:, + saveDocumentAs:, + saveDocumentTo: + ); + Super = NSObject; + }; + NSDocumentController = { + Actions = ( + clearRecentDocuments:, + newDocument:, + openDocument:, + saveAllDocuments: + ); + Super = NSObject; + }; + NSDrawer = { + Actions = ( + close:, + open:, + toggle: + ); + Outlets = ( + delegate + ); + Super = NSResponder; + }; + NSFontManager = { + Actions = ( + addFontTrait:, + modifyFont:, + modifyFontViaPanel:, + orderFrontFontPanel:, + removeFontTrait: + ); + Outlets = ( + menu + ); + Super = NSResponder; + }; + NSForm = { + Super = NSMatrix; + }; + NSFormCell = { + Super = NSActionCell; + }; + NSFormatter = { + Super = NSObject; + }; + NSHelpManager = { + Actions = ( + activateContextHelpMode:, + showHelp: + ); + Super = NSResponder; + }; + NSImage = { + Super = NSObject; + }; + NSImageView = { + Super = NSControl; + }; + NSMatrix = { + Actions = ( + selectAll:, + selectText: + ); + Outlets = ( + delegate + ); + Super = NSControl; + }; + NSMenu = { + Super = NSObject; + }; + NSMenuItem = { + Outlets = ( + target + ); + Super = NSObject; + }; + NSMutableArray = { + Super = NSArray; + }; + NSMutableDictionary = { + Super = NSDictionary; + }; + NSNumberFormatter = { + Super = NSFormatter; + }; + NSOutlineView = { + Super = NSTableView; + }; + NSPanel = { + Super = NSWindow; + }; + NSPopUpButton = { + Super = NSButton; + }; + NSProgressIndicator = { + Actions = ( + animate:, + startAnimation:, + stopAnimation: + ); + Super = NSObject; + }; + NSResponder = { + Actions = ( + deselectAll:, + selectAll:, + selectText: + ); + Outlets = ( + menu + ); + Super = NSObject; + }; + NSRulerView = { + Super = NSView; + }; + NSScrollView = { + Super = NSView; + }; + NSScroller = { + Super = NSControl; + }; + NSSecureTextField = { + Super = NSTextField; + }; + NSSecureTextFieldCell = { + Super = NSTextFieldCell; + }; + NSSlider = { + Super = NSControl; + }; + NSSliderCell = { + Super = NSActionCell; + }; + NSSplitView = { + Super = NSView; + }; + NSTabView = { + Actions = ( + selectFirstTabViewItem:, + selectLastTabViewItem:, + selectNextTabViewItem:, + selectPreviousTabViewItem:, + takeSelectedTabViewItemFromSender: + ); + Outlets = ( + delegate + ); + Super = NSView; + }; + NSTableColumn = { + Super = NSObject; + }; + NSTableHeaderCell = { + Super = NSTextFieldCell; + }; + NSTableHeaderView = { + Super = NSView; + }; + NSTableView = { + Actions = ( + deselectAll:, + selectAll: + ); + Outlets = ( + dataSource, + delegate + ); + Super = NSControl; + }; + NSText = { + Actions = ( + alignCenter:, + alignLeft:, + alignRight:, + changeFont:, + changeSpelling:, + checkSpelling:, + copy:, + copyFont:, + copyRuler:, + cut:, + delete:, + ignoreSpelling:, + paste:, + pasteFont:, + pasteRuler:, + selectAll:, + showGuessPanel:, + subscript:, + superscript:, + toggleRuler:, + underline:, + unscript: + ); + Outlets = ( + delegate + ); + Super = NSView; + }; + NSTextField = { + Actions = ( + selectText: + ); + Outlets = ( + delegate + ); + Super = NSControl; + }; + NSTextFieldCell = { + Super = NSActionCell; + }; + NSTextView = { + Actions = ( + alignJustified:, + changeColor:, + deleteBackwards:, + insertBacktab:, + insertNewLine:, + insertParagraphSeparator:, + insertTab:, + loosenKerning:, + lowerBaseline:, + moveBackward:, + moveDown:, + moveForward:, + moveLeft:, + moveRight:, + moveUp:, + pasteAsPlainText:, + pasteAsRichText:, + raiseBaseline:, + tightenKerning:, + toggleContinuousSpellChecking:, + toggleTraditionalCharacterShape:, + turnOffKerning:, + turnOffLigatures:, + useAllLigatures:, + useDefaultBaseline:, + useDefaultKerning:, + useDefaultLigatures:, + useStandardBaseline:, + useStandardKerning:, + useStandardLigatures: + ); + Super = NSText; + }; NSView = { + Actions = ( + fax:, + print: + ); + Outlets = ( + nextKeyView + ); Super = NSResponder; }; NSWindow = { Actions = ( deminiaturize:, fax:, + makeKeyAndOrderFront:, + miniaturize:, orderBack:, orderFront:, orderOut:, performClose:, performMiniaturize:, + performZoom:, print:, runToolbarCustomizationPalette:, - setDelegate:, - toggleToolbarShown: + selectNextKeyView:, + selectPreviousKeyView:, + toggleToolbarShown:, + zoom: ); Outlets = ( - delegate + delegate, + initialFirstResponder ); Super = NSResponder; }; - PrefsPanel = { + NSWindowController = { Actions = ( + showWindow: ); Outlets = ( + document, + window ); - Super = NSPanel; + Super = NSResponder; + }; + Object = { + }; + PrefsController = { + Actions = ( + addPrefsViewController:, + loadPreferences:, + orderFrontPreferencesPanel:, + resetToDefaults:, + savePreferences:, + savePreferencesAndCloseWindow: + ); + Outlets = ( + box, + iconList, + owner, + scrollView, + window + ); + Super = NSObject; }; } \ No newline at end of file diff --git a/tools/Forge/Forge.gorm b/tools/Forge/Forge.gorm index 7315295c1b90bf8e5a5ceb412168691fb4ad8ed3..1c8ce1a5fb65ae499d31d3b5c0a186c7640ff955 100644 GIT binary patch literal 19419 zcmd5^34B~txj*M-&tz+xq$?$@EQ(OhopeWRCKFmJG(9ve$j&smZHG=~!px*;@jb2b z*ae1y?8v@8kUItBiGmfBMHGV%1W|k_@W>%o2o^&!AUk^{XdS10RkQFWPr^)~|L!ecZXDhHtz4xjfUWEn*V$t3R z>Jk;i(1;AR*tW5pEn^9mWc@7623d-w;Zr|5l0})thL|ZT%}Q3ctS3B}N+tyIwS!b*#aQ>rgTop^&a; zRS( zBa_Jx*4yj`(M%mw~s#9j~;dyi{Wc)p{#=>I2-|CwSRvjy`(I1x+W z{8+}szGUG9FRUlPoY5WWxB3)Q&p@Qt5}zd|J@$LHz#QE#KIiX+UYapfbFp8x#okwZ zzG(aX>5ZNs($LqcvB6sd9nT)PCeZPW{W#jEf)qxlU2iu)(yO%h5eN7sQ`n0+^hS4V zX(GAaYQt&GN?I^=*H@tq*OHL!F>2UCAk;6o>K^$-7#UC%R_AZPWA4Oq!_ ziDZ8`mPlEPA@?3gsvxTfmnxK10>aG8DnZC9?bN{Vy5BHX9+nYvA$I1`E4^#}A9H7& znD6=~7PwR)FB`5MoCT>Zjs^dmE=u!n-6-zX? z3N3f$!;I503eP-YX%FB`nx zZZMW%KJeD(qB~nDRuY#!L6p22m(*4zJhd7xGhj{;M`S0VPPO>`6jSCZ!pNC2d$cLD z1B3_g4@{Z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cVh4DMU48_G6wMHOSGkf ju{U%zpf8Pmh*@8=<^2YRH1-7pI_xFVa4G+=G z#tavZnj9F8963t-1wC@&Z{oduvMk4eLZ-!@k$2y&-pB8KdawS)anJ6oSl#Ax=hO!L zls7ikw`l<&t!S}sM+?9sO==>)*Qh&(rq}LSPTTGZ{77A7>WwFd-`LF_?FHyEC1&f5 zgOi?h=-N9@v*&nitNT42$}urnZw%AKDjuXECC76%Sae8GcKAOU#YNz8mO^al~_~?Z_uX|K))Vki;F>*-Dw8+L=5+)~zK$dkqR}nHI zU2lBp*k@{&6-K@B)IRQb?UpiJ6C_^vrIJy_UxPL!!~6x8=5t(@6y+jW7wW5#{zc!1 z37Hf57^`ZxYcWiQm_U=FEhCX45K@qllLTR-iF&$y^#;0-8b^bVllR25tGKWT<5TB_3YNuy_&k* z=vYnLczEZ#M zuz=_Xg;yDzI>)Lmf=oFjaw7Y6%VRSJXa%``;9@SXpasJZR9Xv`NOf2aC+VuHttM5g ztJSkN+3cvE-3V2`;DUYi^0g9S32*%;*WL{0Vv{Op+7&%{YsiythXuIJ2_#;dLzjO~ z1vg&qxtq#!tCyQ;{!C89sJ+k?`{ZQ6QvH5s$jou;DPW0mHa`-~0GGeH_Y`j>S9HrUE^?6tHW znYYO&3Q6VbNj`Hx8(qeP87IHHunWUk35jQ&LU zuoEr@4+7JN&v3Cti(R=S<`knRCq38hAx1;&f-Tr%hRHN+*{=NzM=012mjV;-Jo<+_ Lk5SfmQ1<@<2GjBv diff --git a/tools/Forge/GNUmakefile b/tools/Forge/GNUmakefile index cf2950e19..cedc809e1 100644 --- a/tools/Forge/GNUmakefile +++ b/tools/Forge/GNUmakefile @@ -71,7 +71,6 @@ Forge_HEADERS= \ Config.h \ BundleController.h \ Controller.h \ - PrefsPanel.h \ PrefsController.h # @@ -80,7 +79,6 @@ Forge_HEADERS= \ Forge_OBJC_FILES= \ BundleController.m \ Controller.m \ - PrefsPanel.m \ PrefsController.m \ main.m diff --git a/tools/Forge/PrefsController.h b/tools/Forge/PrefsController.h index 982928844..d20415364 100644 --- a/tools/Forge/PrefsController.h +++ b/tools/Forge/PrefsController.h @@ -31,12 +31,23 @@ # include "Config.h" #endif -#import +#import + +#import +#import +#import +#import #import "PrefsView.h" -@interface PrefsController: NSWindowController +@interface PrefsController: NSObject { + IBOutlet NSBox *box; + IBOutlet NSMatrix *iconList; + IBOutlet NSScrollView *scrollView; + IBOutlet id owner; + + IBOutlet NSWindow *window; } + (PrefsController *) sharedPrefsController; @@ -60,4 +71,5 @@ - (void) loadPreferences: (id) sender; - (void) resetToDefaults: (id) sender; +- (NSBox *) prefsViewBox; @end diff --git a/tools/Forge/PrefsController.m b/tools/Forge/PrefsController.m index 417c5d61c..cbbd09e9f 100644 --- a/tools/Forge/PrefsController.m +++ b/tools/Forge/PrefsController.m @@ -33,10 +33,13 @@ static const char rcsid[] = # include "Config.h" #endif +#import +#import + #import +#import #import "PrefsController.h" -#import "PrefsPanel.h" #import "PrefsView.h" @implementation PrefsController @@ -51,34 +54,45 @@ static NSMutableArray *prefsViews = nil; - (id) init { - PrefsPanel *prefsPanel; - if (sharedInstance) { [self dealloc]; } else { - [super init]; + self = [super init]; sharedInstance = self; prefsViews = [[[NSMutableArray alloc] initWithCapacity: 5] retain]; - - prefsPanel = [[PrefsPanel alloc] - initWithContentRect: NSMakeRect (250, 250, 516, 385) - styleMask: NSTitledWindowMask - | NSMiniaturizableWindowMask - | NSClosableWindowMask - backing: NSBackingStoreRetained - defer: NO - ]; - [prefsPanel setTitle: [NSString stringWithFormat: @"%@ %@", _(@"Forge"), _(@"Preferences")]]; - - [super initWithWindow: prefsPanel]; - [prefsPanel initUI]; - [prefsPanel setDelegate: self]; - [prefsPanel release]; } return sharedInstance; } +- (void) awakeFromNib +{ + NSButtonCell *prototype; + + // keep the window out of the menu until it's seen + [window setExcludedFromWindowsMenu: YES]; + + if (iconList) + return; + + /* Prototype button for the matrix */ + prototype = [[[NSButtonCell alloc] init] autorelease]; + [prototype setButtonType: NSPushOnPushOffButton]; + [prototype setImagePosition: NSImageOverlaps]; + + /* What is the matrix? */ + iconList = [[NSMatrix alloc] initWithFrame: NSMakeRect (0, 0, 64, 64)]; + [iconList setCellSize: NSMakeSize (64, 64)]; + [iconList setMode: NSRadioModeMatrix]; + [iconList setPrototype: prototype]; + [iconList setTarget: self]; + [iconList setAction: @selector(cellWasClicked:)]; + + [scrollView setHasHorizontalScroller: YES]; + [scrollView setHasVerticalScroller: NO]; + [scrollView setDocumentView: iconList]; +} + - (void) dealloc { NSDebugLog (@"PrefsController -dealloc"); @@ -93,14 +107,15 @@ static NSMutableArray *prefsViews = nil; - (void) orderFrontPreferencesPanel: (id) sender { - [[self window] makeKeyAndOrderFront: self]; + [window setExcludedFromWindowsMenu: NO]; + [window makeKeyAndOrderFront: self]; return; } - (void) savePreferencesAndCloseWindow: (id) sender { [self savePreferences: self]; - [[self window] close]; + [window close]; } - (void) savePreferences: (id) sender @@ -142,18 +157,31 @@ static NSMutableArray *prefsViews = nil; [[NSUserDefaults standardUserDefaults] synchronize]; } -- (void) addPrefsViewController: (id ) controller; +- (void) addPrefsViewController: (id ) aController; { - PrefsPanel *prefsPanel; + NSButtonCell *button = [[NSButtonCell alloc] init]; - prefsPanel = (PrefsPanel *) [self window]; - - if (! [prefsViews containsObject: controller]) { - [prefsViews addObject: controller]; - [controller autorelease]; + if (! [prefsViews containsObject: aController]) { + [prefsViews addObject: aController]; + [aController autorelease]; } - [prefsPanel addPrefsViewButton: controller]; + [button setTitle: [aController buttonCaption]]; + [button setFont: [NSFont systemFontOfSize: 9]]; + [button setImage: [aController buttonImage]]; + [button setImagePosition: NSImageAbove]; + [button setTarget: aController]; + [button setAction: [aController buttonAction]]; + + [iconList addColumnWithCells: [NSArray arrayWithObject: button]]; + [iconList sizeToCells]; + [iconList setNeedsDisplay: YES]; +// [prefsPanel addPrefsViewButton: controller]; +} + +- (NSBox *) prefsViewBox +{ + return box; } @end diff --git a/tools/Forge/PrefsPanel.h b/tools/Forge/PrefsPanel.h deleted file mode 100644 index b34d47b78..000000000 --- a/tools/Forge/PrefsPanel.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - PrefsPanel.h - - Preferences panel class - - Copyright (C) 2001 Dusk to Dawn Computing, Inc. - - Author: Jeff Teunissen - Date: 11 Nov 2001 - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA -*/ - -#ifdef HAVE_CONFIG_H -# include "Config.h" -#endif - -#import -#import -#import - -@interface PrefsPanel: NSPanel -{ -@private - int _topTag; - -@public - NSBox *prefsViewBox; - NSMatrix *prefsViewList; -} - -- (void) initUI; -- (void) dealloc; -#if 0 -- (NSButtonCell *) addPrefsViewButtonWithTitle: (NSString *) desc andImage: (NSImage *) img; -#else -- (void) addPrefsViewButton: (NSButtonCell *) aButton; -#endif - -- (NSBox *) prefsViewBox; -- (NSMatrix *) prefsViewList; - -@end diff --git a/tools/Forge/PrefsPanel.m b/tools/Forge/PrefsPanel.m deleted file mode 100644 index b8f4102c6..000000000 --- a/tools/Forge/PrefsPanel.m +++ /dev/null @@ -1,165 +0,0 @@ -/* - PrefsPanel.m - - Preferences panel class - - Copyright (C) 2001 Dusk to Dawn Computing, Inc. - - Author: Jeff Teunissen - Date: 11 Nov 2001 - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to: - - Free Software Foundation, Inc. - 59 Temple Place - Suite 330 - Boston, MA 02111-1307, USA -*/ - -static const char rcsid[] = - "$Id$"; - -#ifdef HAVE_CONFIG_H -# include "Config.h" -#endif - -#import -#import -#import -#import -#import -#import - -#import "BundleController.h" -#import "PrefsPanel.h" - -@implementation PrefsPanel - -- (void) initUI -{ - NSButton *ok, *apply, *cancel, *revert; - NSButtonCell *prototype; - NSScrollView *iconScrollView; - - _topTag = 0; // This is for the matrix - -/* - Window dimensions: - - 8-pixel space on all sides - Box is 242 pixels high, 500 wide - Scroll area is 86 pixels tall, 500 wide - content view size: (520, 414) -*/ - - prefsViewBox = [[NSBox alloc] initWithFrame: NSMakeRect (8, 40, 500, 242)]; - [prefsViewBox setTitlePosition: NSNoTitle]; - [prefsViewBox setBorderType: NSGrooveBorder]; - NSDebugLog (@"prefsViewBox bounds: %@", NSStringFromRect ([[prefsViewBox contentView] bounds])); - - [[self contentView] addSubview: prefsViewBox]; - - /* Prototype button for the matrix */ - prototype = [[[NSButtonCell alloc] init] autorelease]; - [prototype setButtonType: NSPushOnPushOffButton]; - [prototype setImagePosition: NSImageOverlaps]; - - /* The matrix itself -- horizontal */ - prefsViewList = [[NSMatrix alloc] initWithFrame: NSMakeRect (8, 290, 500, 86)]; - [prefsViewList setCellSize: NSMakeSize (64, 64)]; - [prefsViewList setMode: NSRadioModeMatrix]; - [prefsViewList setPrototype: prototype]; - [prefsViewList setTarget: [self windowController]]; - [prefsViewList setAction: @selector(cellWasClicked:)]; - - iconScrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect (8, 290, 500, 86)]; - [iconScrollView autorelease]; - [iconScrollView setHasHorizontalScroller: YES]; - [iconScrollView setHasVerticalScroller: NO]; - [iconScrollView setDocumentView: prefsViewList]; - [[self contentView] addSubview: iconScrollView]; - - /* Create the buttons */ - // OK - ok = [[NSButton alloc] initWithFrame: NSMakeRect (244, 8, 60, 24)]; - [ok autorelease]; - - [ok setTitle: _(@"OK")]; - [ok setTarget: [self windowController]]; - [ok setAction: @selector(savePreferencesAndCloseWindow:)]; - [[self contentView] addSubview: ok]; - - // Cancel - cancel = [[NSButton alloc] initWithFrame: NSMakeRect (312, 8, 60, 24)]; - [cancel autorelease]; - - [cancel setTitle: _(@"Cancel")]; - [cancel setTarget: self]; - [cancel setAction: @selector(close)]; - [[self contentView] addSubview: cancel]; - - // Apply - apply = [[NSButton alloc] initWithFrame: NSMakeRect (380, 8, 60, 24)]; - [apply autorelease]; - - [apply setTitle: _(@"Apply")]; - [apply setTarget: [self windowController]]; - [apply setAction: @selector(savePreferences:)]; - [[self contentView] addSubview: apply]; - - // Defaults - revert = [[NSButton alloc] initWithFrame: NSMakeRect (448, 8, 60, 24)]; - [revert autorelease]; - - [revert setTitle: _(@"Default")]; - [revert setTarget: [self windowController]]; - [revert setAction: @selector(resetToDefaults:)]; - [[self contentView] addSubview: revert]; -} - -- (void) dealloc -{ - NSDebugLog (@"PrefsPanel -dealloc"); - [prefsViewBox release]; - - [super dealloc]; -} - -- (void) addPrefsViewButton: (id ) aController -{ - NSButtonCell *button = [[NSButtonCell alloc] init]; - - [button setTag: _topTag++]; - [button setTitle: [aController buttonCaption]]; - [button setFont: [NSFont systemFontOfSize: 9]]; - [button setImage: [aController buttonImage]]; - [button setImagePosition: NSImageAbove]; - [button setTarget: aController]; - [button setAction: [aController buttonAction]]; - [prefsViewList addColumnWithCells: [NSArray arrayWithObject: button]]; - [prefsViewList sizeToCells]; - [prefsViewList setNeedsDisplay: YES]; -} - -- (NSBox *) prefsViewBox -{ - return prefsViewBox; -} - -- (NSMatrix *) prefsViewList -{ - return prefsViewList; -} - -@end