Improvements to test mode and enhancements to the palettes manager.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19631 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-06-27 12:34:40 +00:00
parent 5067b75ff7
commit 60ac2cab0d
3 changed files with 32 additions and 2 deletions

View file

@ -1,3 +1,14 @@
2004-06-27 08:45 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: -[Gorm testInterface:] removed NSWindowsMenu and
NSServicesMenu from the nameTable of the .gorm being tested.
This prevents an exception because of problems re-setting
these on the fly.
* GormPalettesManager.m: The beginnings of getting the
palettes from a default rather than being hardcoded. This
allows greater flexibility in adding custom palettes to
Gorm later on.
2004-06-26 18:10 Gregory John Casamento <greg_casamento@yahoo.com>
* GormPalettesManager.m: Removed line in -init which observes

3
Gorm.m
View file

@ -721,6 +721,9 @@ NSString *GormResizeCellNotification = @"GormResizeCellNotification";
testContainer = [NSUnarchiver unarchiveObjectWithData: data];
if (testContainer != nil)
{
NSMutableDictionary *nameTable = [testContainer nameTable];
[nameTable removeObjectForKey: @"NSServicesMenu"];
[nameTable removeObjectForKey: @"NSWindowsMenu"];
[testContainer awakeWithContext: nil
topLevelItems: nil]; // FIXME: Top level items will leak...
RETAIN(testContainer); // released in endTesting:

View file

@ -23,6 +23,10 @@
*/
#include "GormPrivate.h"
#include <Foundation/NSArray.h>
#define BUILTIN_PALETTES @"BuiltinPalettes"
#define USER_PALETTES @"UserPalettes"
@interface GormPalettePanel : NSPanel
@end
@ -261,8 +265,20 @@ static NSImage *dragImage = nil;
NSRect dragRect = {{0, 0}, {272, 192}};
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *builtinPalettes = [defaults arrayForKey: @"BuiltinPalettes"];
NSArray *builtinPalettes = [defaults arrayForKey: BUILTIN_PALETTES];
NSArray *userPalettes = [defaults arrayForKey: USER_PALETTES];
// set the default, if not already set...
if(builtinPalettes == nil)
{
builtinPalettes = [NSArray arrayWithObjects: @"0Menus.palette",
@"1Windows.palette",
@"2Controls.palette",
@"3Containers.palette",
@"4Data.palette", nil];
[defaults setObject: builtinPalettes forKey: BUILTIN_PALETTES];
}
NSLog(@"builtin = %@",builtinPalettes);
panel = [[GormPalettePanel alloc] initWithContentRect: contentRect
styleMask: style