Added new class and interface

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20351 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-11-13 05:08:29 +00:00
parent c09be7be05
commit 007501ef56
6 changed files with 181 additions and 0 deletions

View file

@ -6,6 +6,8 @@
NSObject now that NSObject is part of the classInformation plist.
* GormFunctions.[hm]: Added parameter to pass in the current list of
classes from the calling document.
* GormClassPanelController.[hm]: New class.
* GormClassPanel.gorm: Added interface.
2004-11-12 17:08 Gregory John Casamento <greg_casamento@yahoo.com>

View file

@ -0,0 +1,42 @@
/* GormClassPanelController.h
*
* Copyright (C) 2004 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2004
*
* This file is part of GNUstep.
*
* 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 the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* All Rights reserved */
#include <AppKit/AppKit.h>
@class NSMutableArray;
@interface GormClassPanelController : NSObject
{
id okButton;
id classBrowser;
id panel;
NSString *className;
NSMutableArray *allClasses;
}
- (id) initWithTitle: (NSString *)title classList: (NSArray *)classes;
- (void) okButton: (id)sender;
- (NSString *)runModal;
@end

100
GormClassPanelController.m Normal file
View file

@ -0,0 +1,100 @@
/* GormClassPanelController.m
*
* Copyright (C) 2004 Free Software Foundation, Inc.
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2004
*
* This file is part of GNUstep.
*
* 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 the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* All Rights reserved */
#include <AppKit/AppKit.h>
#include "GormClassPanelController.h"
#include "GormPrivate.h"
@implementation GormClassPanelController
- (id) initWithTitle: (NSString *)title classList: (NSArray *)classes
{
self = [super init];
if(self != nil)
{
if ( ![NSBundle loadNibNamed:@"GormClassPanel" owner:self] )
{
NSLog(@"Can not load bundle GormClassPanel");
return nil;
}
}
ASSIGN(allClasses, [classes mutableCopy]);
[allClasses removeObject: @"FirstResponder"];
[panel setTitle: title];
return self;
}
- (NSString *)runModal
{
[NSApp runModalForWindow: panel];
[panel orderOut: self];
return className;
}
- (void) dealloc
{
RELEASE(allClasses);
RELEASE(className);
RELEASE(panel);
[super dealloc];
}
- (void) okButton: (id)sender
{
ASSIGN(className, [[classBrowser selectedCell] stringValue]);
[NSApp stopModal];
}
- (int) browser: (NSBrowser*)sender numberOfRowsInColumn: (int)column
{
return [allClasses count];
}
- (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column
{
return @"Class";
}
- (void) browser: (NSBrowser*)sender
willDisplayCell: (id)aCell
atRow: (int)row
column: (int)col
{
if (row >= 0 && row < [allClasses count])
{
[aCell setStringValue: [allClasses objectAtIndex: row]];
[aCell setEnabled: YES];
}
else
{
[aCell setStringValue: @""];
[aCell setEnabled: NO];
}
[aCell setLeaf: YES];
}
@end

View file

@ -0,0 +1,37 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"capitalizeWord:",
"cut:",
"deleteToMark:",
"indent:",
"moveBackwardAndModifySelection:",
"moveToBeginningOfLine:",
"moveWordBackwardAndModifySelection:",
"orderFront:",
"pageUp:",
"performZoom:",
"saveDocument:",
"selectAll:",
"showContextHelp:",
"takeDoubleValueFrom:",
"toggleContinuousSpellChecking:",
"underline:",
"useStandardLigatures:",
"okButton:"
);
Super = NSObject;
};
GormClassPanelController = {
Actions = (
"okButton:"
);
Outlets = (
okButton,
classBrowser,
panel
);
Super = NSObject;
};
}

Binary file not shown.

Binary file not shown.