Forge Updates. Menus mostly filled out now, the .gorm file inits the

controller.
This commit is contained in:
Jeff Teunissen 2001-11-06 13:20:23 +00:00
parent de059239fa
commit 5876ba1aba
7 changed files with 91 additions and 201 deletions

View file

@ -12,9 +12,9 @@
as to its fitness for any particular use.
*/
#import <AppKit/AppKit.h>
#import <AppKit/NSApplication.h>
#import <AppKit/NSMenu.h>
#import "Controller.h"
#import "Preferences.h"
@implementation Controller
@ -86,15 +86,26 @@
Notifications
*/
/*
applicationDidFinishLaunching:
Sent when the app has finished starting up
*/
- (void) applicationDidFinishLaunching: (NSNotification *) not;
{
}
/*
applicationWillFinishLaunching:
Sent when the app is just about to complete its startup
*/
- (void) applicationWillFinishLaunching: (NSNotification *) not;
{
NSMenu *menu = [[[NSMenu alloc] init] autorelease];
NSMenu *info;
NSMenu *project;
NSMenu *file;
NSMenu *edit;
NSMenu *bsp;
NSMenu *brush;
@ -103,6 +114,7 @@
[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: @"BSP" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"Brush" action: NULL keyEquivalent: @""];
@ -125,7 +137,7 @@
action: @selector (orderFrontPreferencesPanel:)
keyEquivalent: @""];
[info addItemWithTitle: @"Help"
action: @selector (openFrontHelpPanel:)
action: @selector (orderFrontHelpPanel:)
keyEquivalent: @"?"];
/*
@ -134,13 +146,72 @@
project = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu: project forItem: [menu itemWithTitle: @"Project"]];
[project addItemWithTitle: @"Open"
action: @selector (open:)
keyEquivalent: @"o"];
[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
*/
file = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu: file forItem: [menu itemWithTitle: @"File"]];
[file addItemWithTitle: @"Open..."
action: @selector (open:)
keyEquivalent: @"o"];
[file addItemWithTitle: @"New"
action: @selector (createNew:)
keyEquivalent: @"n"];
[file addItemWithTitle: @"Save..."
action: @selector (save:)
keyEquivalent: @"s"];
[file addItemWithTitle: @"Save As..."
action: @selector (saveAs:)
keyEquivalent: @"S"];
[file addItemWithTitle: @"Save All"
action: @selector (saveAll:)
keyEquivalent: @""];
[file addItemWithTitle: @"Revert to Saved"
action: @selector (revertToSaved:)
keyEquivalent: @""];
[file addItemWithTitle: @"Close"
action: @selector (close:)
keyEquivalent: @""];
/*
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"];
/*
Windows
*/
@ -154,14 +225,17 @@
Services
*/
services = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu: services forItem: [menu itemWithTitle: @"Services"]];
[NSApp setServicesMenu: services];
[menu setSubmenu: services forItem: [menu itemWithTitle: @"Services"]];
[NSApp setMainMenu: menu];
}
/*
applicationWillTerminate:
Sort of like SIGQUIT. App should die now, but has a chance to clean up
*/
- (void) applicationWillTerminate: (NSNotification *) not;
{
}

View file

@ -1,128 +0,0 @@
{
CameraView = {
Actions = (
);
Outlets = (
);
Super = NSView;
};
Forge = {
Actions = (
);
Outlets = (
brushCount,
cmdInput,
cmdOutput,
entityCount,
filterClip,
filterEntities,
filterLights,
filterPaths,
filterWater,
filterWorld,
showCoords,
showNames,
xyDrawMode
);
Super = NSWindow;
};
NSApplication = {
Outlets = (
delegate
);
Super = NSResponder;
};
NSButton = {
Super = NSControl;
};
NSControl = {
Actions = (
takeDoubleValueFrom:,
takeFloatValueFrom:,
takeIntValueFrom:,
takeObjectValueFrom:,
takeStringValueFrom:
);
Outlets = (
target
);
Super = NSView;
};
NSMenu = {
Super = NSObject;
};
NSMenuItem = {
Outlets = (
target
);
Super = NSObject;
};
NSPanel = {
Super = NSWindow;
};
NSResponder = {
Super = NSObject;
};
NSSlider = {
Super = NSControl;
};
NSTextField = {
Outlets = (
delegate
);
Super = NSControl;
};
NSView = {
Super = NSResponder;
};
NSWindow = {
Outlets = (
delegate
);
Super = NSResponder;
};
Preferences = {
Actions = (
commitDisplayedValues:,
discardDisplayedValues:,
loadDefaults:,
objectForKey:key:,
ok:sender:,
preferences:,
prefsChanged:sender:,
revert:sender:,
revertToDefault:sender:,
saveDefaults:,
sharedInstance:,
updateUI:
);
Outlets = (
bspSoundPathField,
offsetBrushCopyButton,
projectPathField,
showBSPOutputButton,
startWadField,
xLightField,
yLightField,
zLightField
);
Super = NSObject;
};
XYView = {
Actions = (
autoresizingMask,
setAutoresizingMask:
);
Outlets = (
target
);
Super = NSView;
};
ZView = {
Actions = (
);
Outlets = (
);
Super = NSView;
};
}

Binary file not shown.

View file

@ -1,11 +1,4 @@
{
CameraView = {
Actions = (
);
Outlets = (
);
Super = NSView;
};
Controller = {
Actions = (
createNew:,
@ -18,26 +11,6 @@
);
Super = NSObject;
};
Forge = {
Actions = (
);
Outlets = (
brushCount,
cmdInput,
cmdOutput,
entityCount,
filterClip,
filterEntities,
filterLights,
filterPaths,
filterWater,
filterWorld,
showCoords,
showNames,
xyDrawMode
);
Super = NSWindow;
};
NSApplication = {
Outlets = (
delegate
@ -95,18 +68,9 @@
};
Preferences = {
Actions = (
commitDisplayedValues:,
discardDisplayedValues:,
loadDefaults:,
objectForKey:key:,
ok:sender:,
preferences:,
prefsChanged:sender:,
revert:sender:,
revertToDefault:sender:,
saveDefaults:,
sharedInstance:,
updateUI:
ok:,
prefsChanged:,
revert:
);
Outlets = (
bspSoundPathField,
@ -120,21 +84,4 @@
);
Super = NSObject;
};
XYView = {
Actions = (
autoresizingMask,
setAutoresizingMask:
);
Outlets = (
target
);
Super = NSView;
};
ZView = {
Actions = (
);
Outlets = (
);
Super = NSView;
};
}

Binary file not shown.

View file

@ -47,10 +47,11 @@ ADDITIONAL_GUI_LIBS +=
#
# Resource files
#
Forge_MAIN_MODEL_FILE= Forge.gorm
Forge_RESOURCE_FILES= \
ForgeInfo.plist \
Forge.tiff
# Forge.gorm \
Forge.gorm \
Forge.tiff \
ForgeInfo.plist
# Languages we're localized for
Forge_LANGUAGES= \

View file

@ -1,12 +1,8 @@
#import <AppKit/AppKit.h>
#import "Controller.h"
#import <AppKit/NSApplication.h>
#define APP_NAME @"GNUstep"
int main(int argc, const char *argv[], const char *env[])
{
[NSApplication sharedApplication];
[NSApp setDelegate: [[Controller alloc] init]];
return NSApplicationMain (argc, argv);
}