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. as to its fitness for any particular use.
*/ */
#import <AppKit/AppKit.h> #import <AppKit/NSApplication.h>
#import <AppKit/NSMenu.h>
#import "Controller.h" #import "Controller.h"
#import "Preferences.h"
@implementation Controller @implementation Controller
@ -86,15 +86,26 @@
Notifications Notifications
*/ */
/*
applicationDidFinishLaunching:
Sent when the app has finished starting up
*/
- (void) applicationDidFinishLaunching: (NSNotification *) not; - (void) applicationDidFinishLaunching: (NSNotification *) not;
{ {
} }
/*
applicationWillFinishLaunching:
Sent when the app is just about to complete its startup
*/
- (void) applicationWillFinishLaunching: (NSNotification *) not; - (void) applicationWillFinishLaunching: (NSNotification *) not;
{ {
NSMenu *menu = [[[NSMenu alloc] init] autorelease]; NSMenu *menu = [[[NSMenu alloc] init] autorelease];
NSMenu *info; NSMenu *info;
NSMenu *project; NSMenu *project;
NSMenu *file;
NSMenu *edit; NSMenu *edit;
NSMenu *bsp; NSMenu *bsp;
NSMenu *brush; NSMenu *brush;
@ -103,6 +114,7 @@
[menu addItemWithTitle: @"Info" action: NULL keyEquivalent: @""]; [menu addItemWithTitle: @"Info" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"Project" action: NULL keyEquivalent: @""]; [menu addItemWithTitle: @"Project" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"File" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"Edit" action: NULL keyEquivalent: @""]; [menu addItemWithTitle: @"Edit" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"BSP" action: NULL keyEquivalent: @""]; [menu addItemWithTitle: @"BSP" action: NULL keyEquivalent: @""];
[menu addItemWithTitle: @"Brush" action: NULL keyEquivalent: @""]; [menu addItemWithTitle: @"Brush" action: NULL keyEquivalent: @""];
@ -125,7 +137,7 @@
action: @selector (orderFrontPreferencesPanel:) action: @selector (orderFrontPreferencesPanel:)
keyEquivalent: @""]; keyEquivalent: @""];
[info addItemWithTitle: @"Help" [info addItemWithTitle: @"Help"
action: @selector (openFrontHelpPanel:) action: @selector (orderFrontHelpPanel:)
keyEquivalent: @"?"]; keyEquivalent: @"?"];
/* /*
@ -134,13 +146,72 @@
project = [[[NSMenu alloc] init] autorelease]; project = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu: project forItem: [menu itemWithTitle: @"Project"]]; [menu setSubmenu: project forItem: [menu itemWithTitle: @"Project"]];
[project addItemWithTitle: @"Open" [project addItemWithTitle: @"Open..."
action: @selector (open:) action: @selector (openProject:)
keyEquivalent: @"o"]; 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" [project addItemWithTitle: @"Close"
action: @selector (closeProject:) action: @selector (closeProject:)
keyEquivalent: @""]; 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 Windows
*/ */
@ -154,14 +225,17 @@
Services Services
*/ */
services = [[[NSMenu alloc] init] autorelease]; services = [[[NSMenu alloc] init] autorelease];
[menu setSubmenu: services forItem: [menu itemWithTitle: @"Services"]];
[NSApp setServicesMenu: services]; [NSApp setServicesMenu: services];
[menu setSubmenu: services forItem: [menu itemWithTitle: @"Services"]];
[NSApp setMainMenu: menu]; [NSApp setMainMenu: menu];
} }
/*
applicationWillTerminate:
Sort of like SIGQUIT. App should die now, but has a chance to clean up
*/
- (void) applicationWillTerminate: (NSNotification *) not; - (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 = { Controller = {
Actions = ( Actions = (
createNew:, createNew:,
@ -18,26 +11,6 @@
); );
Super = NSObject; Super = NSObject;
}; };
Forge = {
Actions = (
);
Outlets = (
brushCount,
cmdInput,
cmdOutput,
entityCount,
filterClip,
filterEntities,
filterLights,
filterPaths,
filterWater,
filterWorld,
showCoords,
showNames,
xyDrawMode
);
Super = NSWindow;
};
NSApplication = { NSApplication = {
Outlets = ( Outlets = (
delegate delegate
@ -95,18 +68,9 @@
}; };
Preferences = { Preferences = {
Actions = ( Actions = (
commitDisplayedValues:, ok:,
discardDisplayedValues:, prefsChanged:,
loadDefaults:, revert:
objectForKey:key:,
ok:sender:,
preferences:,
prefsChanged:sender:,
revert:sender:,
revertToDefault:sender:,
saveDefaults:,
sharedInstance:,
updateUI:
); );
Outlets = ( Outlets = (
bspSoundPathField, bspSoundPathField,
@ -120,21 +84,4 @@
); );
Super = NSObject; 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 # Resource files
# #
Forge_MAIN_MODEL_FILE= Forge.gorm
Forge_RESOURCE_FILES= \ Forge_RESOURCE_FILES= \
ForgeInfo.plist \ Forge.gorm \
Forge.tiff Forge.tiff \
# Forge.gorm \ ForgeInfo.plist
# Languages we're localized for # Languages we're localized for
Forge_LANGUAGES= \ Forge_LANGUAGES= \

View file

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