mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Updated gorm file version to handle window autopositioning.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f5d58d88ac
commit
4d39d97c82
22 changed files with 295 additions and 163 deletions
32
ChangeLog
32
ChangeLog
|
@ -1,3 +1,35 @@
|
|||
2005-06-04 07:41 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* English.lproj/GormClassInspector.gorm: Updated to new .gorm file
|
||||
version
|
||||
* English.lproj/GormDocument.gorm: Added new profile to drop down.
|
||||
* English.lproj/GormViewSizeInspector.gorm: Updated to new .gorm
|
||||
file version
|
||||
* GormCore/GormDocument.m: Change to _replaceObjectsWithTemplates: to
|
||||
always replace windows with a GSWindowTemplate. This allows the
|
||||
autoposition and defered logic to work properly when loading this
|
||||
.gorm file in an application.
|
||||
* GormCore/GormFilePrefsManager.m: Bumped version to 0.10.1
|
||||
* GormCore/GormViewSizeInspector.m: Minor changes.
|
||||
* GormInfo.plist: Bumped version to 0.10.1
|
||||
* Palettes/0Menus/GormMenuEditor.m: Removed uneeded code.
|
||||
* Palettes/0Menus/GormNSMenu.h: Added +menuWithMenu declaration.
|
||||
* Palettes/0Menus/GormNSMenu.m: Added +menuWithMenu: to initialize
|
||||
one menu from another.
|
||||
* Palettes/0Menus/main.m: Change to use the fontMenu: method in
|
||||
the NSFontManager to build the menu in Gorm's palette.
|
||||
* Palettes/1Windows/GormNSPanel.h: Declarations for new methods.
|
||||
* Palettes/1Windows/GormNSPanel.m: setAutoPositionMask: and
|
||||
autoPositionMask methods added.
|
||||
* Palettes/1Windows/GormNSWindow.h: Declarations for new methods.
|
||||
* Palettes/1Windows/GormNSWindow.m: setAutoPositionMask: and
|
||||
autoPositionMask methods added.
|
||||
* Palettes/1Windows/GormNSWindowSizeInspector.gorm: Additions to handle
|
||||
window positioning and maxsize.
|
||||
* Palettes/1Windows/main.m: Additions to the window inspector
|
||||
to handle maxSize and window position.
|
||||
* Resources/VersionProfiles.plist: New profile entry
|
||||
|
||||
2005-05-25 23:38 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GModelDecoder.m
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -657,7 +657,7 @@ static NSImage *fileImage = nil;
|
|||
|
||||
// if the connection needs to be made with the font manager, replace
|
||||
// it with our proxy object and proceed with creating the connection.
|
||||
if(destination == nil &&
|
||||
if((destination == nil || destination == [NSFontManager sharedFontManager]) &&
|
||||
[classManager isAction: label ofClass: @"NSFontManager"])
|
||||
{
|
||||
if(!fontManager)
|
||||
|
@ -1933,6 +1933,7 @@ static NSImage *fileImage = nil;
|
|||
NSDictionary *substituteClasses = [palettesManager substituteClasses];
|
||||
NSEnumerator *en = [substituteClasses keyEnumerator];
|
||||
NSString *subClassName = nil;
|
||||
unsigned int version = NSNotFound;
|
||||
|
||||
// If someone attempts to open a .gmodel using open or in a
|
||||
// workspace manager, open it.. otherwise open the .gorm file.
|
||||
|
@ -1994,7 +1995,7 @@ static NSImage *fileImage = nil;
|
|||
*/
|
||||
u = [[NSUnarchiver alloc] initForReadingWithData: data];
|
||||
|
||||
// classes
|
||||
// special internal classes
|
||||
[u decodeClassName: @"GSNibContainer"
|
||||
asClassName: @"GormDocument"];
|
||||
[u decodeClassName: @"GSNibItem"
|
||||
|
@ -2002,25 +2003,6 @@ static NSImage *fileImage = nil;
|
|||
[u decodeClassName: @"GSCustomView"
|
||||
asClassName: @"GormCustomView"];
|
||||
|
||||
/*
|
||||
[u decodeClassName: @"NSMenu"
|
||||
asClassName: @"GormNSMenu"];
|
||||
[u decodeClassName: @"NSWindow"
|
||||
asClassName: @"GormNSWindow"];
|
||||
[u decodeClassName: @"NSPanel"
|
||||
asClassName: @"GormNSPanel"];
|
||||
[u decodeClassName: @"NSPopUpButton"
|
||||
asClassName: @"GormNSPopUpButton"];
|
||||
[u decodeClassName: @"NSPopUpButtonCell"
|
||||
asClassName: @"GormNSPopUpButtonCell"];
|
||||
[u decodeClassName: @"NSBrowser"
|
||||
asClassName: @"GormNSBrowser"];
|
||||
[u decodeClassName: @"NSTableView"
|
||||
asClassName: @"GormNSTableView"];
|
||||
[u decodeClassName: @"NSOutlineView"
|
||||
asClassName: @"GormNSOutlineView"];
|
||||
*/
|
||||
|
||||
while((subClassName = [en nextObject]) != nil)
|
||||
{
|
||||
NSString *realClassName = [substituteClasses objectForKey: subClassName];
|
||||
|
@ -2134,7 +2116,7 @@ static NSImage *fileImage = nil;
|
|||
}
|
||||
|
||||
/*
|
||||
* If the .gorm file is version 0, we need to add the top level objects
|
||||
* If the GSNibContainer version is 0, we need to add the top level objects
|
||||
* to the list so that they can be properly processed.
|
||||
*/
|
||||
if([u versionForClassName: NSStringFromClass([GSNibContainer class])] == 0)
|
||||
|
@ -2154,6 +2136,17 @@ static NSImage *fileImage = nil;
|
|||
isOlderArchive = YES;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the GSWindowTemplate version is 0, we need to let Gorm know that this is
|
||||
* an older archive. Also, if the window template is not in the archive we know
|
||||
* it was made by an older version of Gorm.
|
||||
*/
|
||||
version = [u versionForClassName: NSStringFromClass([GSWindowTemplate class])];
|
||||
if(version == 0 || version == NSNotFound)
|
||||
{
|
||||
isOlderArchive = YES;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we merge the objects from the nib container into our own data
|
||||
* structures, taking care not to overwrite our NSOwner and NSFirst.
|
||||
|
@ -2951,27 +2944,52 @@ static NSImage *fileImage = nil;
|
|||
- (void) _replaceObjectsWithTemplates: (NSArchiver *)archiver
|
||||
{
|
||||
GormClassManager *cm = [self classManager];
|
||||
NSEnumerator *en = [[cm customClassMap] keyEnumerator];
|
||||
NSEnumerator *en = [[self nameTable] keyEnumerator];
|
||||
id key = nil;
|
||||
|
||||
// loop through all objects.
|
||||
// loop through all custom objects and windows
|
||||
while((key = [en nextObject]) != nil)
|
||||
{
|
||||
id customClass = AUTORELEASE([[cm customClassForName: key] copy]);
|
||||
id customClass = [cm customClassForName: key];
|
||||
id object = [self objectForName: key];
|
||||
NSString *superClass = [cm nonCustomSuperClassOf: customClass];
|
||||
id template = [GSTemplateFactory templateForObject: object
|
||||
withClassName: customClass
|
||||
withSuperClassName: superClass]; // autoreleased
|
||||
|
||||
// if the object is deferrable, then set the flag appropriately.
|
||||
if([template respondsToSelector: @selector(setDeferFlag:)])
|
||||
id template = nil;
|
||||
if(customClass != nil)
|
||||
{
|
||||
[template setDeferFlag: [self objectIsDeferred: object]];
|
||||
NSString *superClass = [cm nonCustomSuperClassOf: customClass];
|
||||
template = [GSTemplateFactory templateForObject: object
|
||||
withClassName: customClass
|
||||
withSuperClassName: superClass];
|
||||
}
|
||||
else if([object isKindOfClass: [NSWindow class]])
|
||||
{
|
||||
template = [GSTemplateFactory templateForObject: object
|
||||
withClassName: [object className]
|
||||
withSuperClassName: [object className]];
|
||||
|
||||
}
|
||||
|
||||
// replace the object with the template.
|
||||
[archiver replaceObject: object withObject: template];
|
||||
// if the template has been created, replace the object with it.
|
||||
if(template != nil)
|
||||
{
|
||||
// if the object is deferrable, then set the flag appropriately.
|
||||
if([template respondsToSelector: @selector(setDeferFlag:)])
|
||||
{
|
||||
[template setDeferFlag: [self objectIsDeferred: object]];
|
||||
}
|
||||
|
||||
// if the object can accept autoposition information
|
||||
if([object respondsToSelector: @selector(autoPositionMask)])
|
||||
{
|
||||
int mask = [object autoPositionMask];
|
||||
if([template respondsToSelector: @selector(setAutoPositionMask:)])
|
||||
{
|
||||
[template setAutoPositionMask: mask];
|
||||
}
|
||||
}
|
||||
|
||||
// replace the object with the template.
|
||||
[archiver replaceObject: object withObject: template];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3008,7 +3026,7 @@ static NSImage *fileImage = nil;
|
|||
if(isOlderArchive && [filePrefsManager isLatest])
|
||||
{
|
||||
retval = NSRunAlertPanel(_(@"Compatibility Warning"),
|
||||
_(@"Saving will update this gorm to the latest version, which is not compatible with GNUstep's gui 0.9.3 Release or CVS prior to Jun 28 2004."),
|
||||
_(@"Saving will update this gorm to the latest version, which is not compatible with GNUstep's gui 0.9.5 (or earlier) Release or CVS prior to June 2 2005."),
|
||||
_(@"Save"),
|
||||
_(@"Don't Save"), nil, nil);
|
||||
if (retval != NSAlertDefaultReturn)
|
||||
|
@ -3036,31 +3054,12 @@ static NSImage *fileImage = nil;
|
|||
archiver = [[NSArchiver alloc] initForWritingWithMutableData: archiverData];
|
||||
|
||||
/* Special gorm classes to their archive equivalents. */
|
||||
// see implementation of classForCoder for GSNibContainer.
|
||||
// NOTE: GSNibContainer replaces GormDocument using classforCoder
|
||||
[archiver encodeClassName: @"GormObjectProxy"
|
||||
intoClassName: @"GSNibItem"];
|
||||
[archiver encodeClassName: @"GormCustomView"
|
||||
intoClassName: @"GSCustomView"];
|
||||
|
||||
/*
|
||||
[archiver encodeClassName: @"GormNSMenu"
|
||||
intoClassName: @"NSMenu"];
|
||||
[archiver encodeClassName: @"GormNSWindow"
|
||||
intoClassName: @"NSWindow"];
|
||||
[archiver encodeClassName: @"GormNSPanel"
|
||||
intoClassName: @"NSPanel"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButton"
|
||||
intoClassName: @"NSPopUpButton"];
|
||||
[archiver encodeClassName: @"GormNSPopUpButtonCell"
|
||||
intoClassName: @"NSPopUpButtonCell"];
|
||||
[archiver encodeClassName: @"GormNSBrowser"
|
||||
intoClassName: @"NSBrowser"];
|
||||
[archiver encodeClassName: @"GormNSTableView"
|
||||
intoClassName: @"NSTableView"];
|
||||
[archiver encodeClassName: @"GormNSOutlineView"
|
||||
intoClassName: @"NSOutlineView"];
|
||||
*/
|
||||
|
||||
while((subClassName = [en nextObject]) != nil)
|
||||
{
|
||||
NSString *realClassName = [substituteClasses objectForKey: subClassName];
|
||||
|
@ -3073,7 +3072,6 @@ static NSImage *fileImage = nil;
|
|||
|
||||
[archiver encodeRootObject: self];
|
||||
NSDebugLog(@"nameTable = %@",nameTable);
|
||||
|
||||
NSDebugLog(@"customClasses = %@", [classManager customClassMap]);
|
||||
|
||||
fileExists = [mgr fileExistsAtPath: documentPath isDirectory: &isDir];
|
||||
|
|
|
@ -83,7 +83,7 @@ NSString *formatVersion(int version)
|
|||
|
||||
+ (int) currentVersion
|
||||
{
|
||||
return appVersion(0,10,0);
|
||||
return appVersion(0,10,1);
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
|
|
|
@ -119,6 +119,7 @@ NSImage *mVLine = nil;
|
|||
}
|
||||
}
|
||||
|
||||
// set the tags...
|
||||
[top setTag: NSViewMaxYMargin];
|
||||
[bottom setTag: NSViewMinYMargin];
|
||||
[right setTag: NSViewMaxXMargin];
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
ApplicationDescription = "[GNUstep | Graphical] Object Relationship Modeller";
|
||||
ApplicationIcon = "Gorm.tiff";
|
||||
ApplicationName = "Gorm";
|
||||
ApplicationRelease = "Gorm 0.10.0 (Alpha)";
|
||||
ApplicationRelease = "Gorm 0.10.1 (Alpha)";
|
||||
Authors = ("Gregory John Casamento <greg_casamento@yahoo.com>","Richard Frith-Macdonald <rfm@gnu.org>","Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>");
|
||||
Copyright = "Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 FSF";
|
||||
CopyrightDescription = "Released under the GNU General Public License 2.0";
|
||||
NSBuildVersion = "0.10.0 May 20 2005";
|
||||
NSBuildVersion = "0.10.1 May 20 2005";
|
||||
}
|
||||
|
|
29
NOTICE
Normal file
29
NOTICE
Normal file
|
@ -0,0 +1,29 @@
|
|||
Here is an email which was sent to the list Jun 4, 2005:
|
||||
|
||||
Hey,
|
||||
|
||||
As promised here's a detailed report of what's happening. As many of you know
|
||||
one problem with moving .gorm files from one machine to another is that
|
||||
sometimes, when the machine which is running the app has a considerably smaller
|
||||
screen than the one on which the app was created, the window will be created
|
||||
against the edge of the screen. This is somewhat annoying.
|
||||
|
||||
I decided to add information to the GSWindowTemplate in gui and also make it so
|
||||
that all windows in Gorm are archived using the template (whether they are
|
||||
custom or not) so that this information is present in when the window is
|
||||
unarchived and can be used to autoposition the window on the screen.
|
||||
|
||||
I have also added backwards compatibility changes to Gorm so that it will
|
||||
notify users when the file is going to be updated as well as a new entry in the
|
||||
"File" section of the main window so that it is possible to save it using the
|
||||
previous version.
|
||||
|
||||
I have tested this extensively for the last couple of days, so I don't expect
|
||||
any issues. I will notify all of you if there are any other changes which
|
||||
might have some impact.
|
||||
|
||||
Thanks, GJC
|
||||
|
||||
Gregory John Casamento
|
||||
-- CEO/President Open Logic Corp. (A MD Corp.)
|
||||
## Maintainer of Gorm (IB Equiv.) for GNUstep.
|
|
@ -108,17 +108,6 @@
|
|||
- (NSWindow*) window;
|
||||
@end
|
||||
|
||||
@interface NSResponder (GormMenuEditorPrivate)
|
||||
- (NSMenu *) _menu;
|
||||
@end
|
||||
|
||||
@implementation NSResponder (GormMenuEditorPrivate)
|
||||
- (NSMenu *) _menu
|
||||
{
|
||||
return _menu;
|
||||
}
|
||||
@end
|
||||
|
||||
@interface GormMenuEditor (Private)
|
||||
- (NSEvent *) editTextField: view withEvent: (NSEvent *)theEvent;
|
||||
@end
|
||||
|
|
|
@ -26,11 +26,8 @@
|
|||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
@class GormDocument;
|
||||
@interface GormNSMenu : NSMenu
|
||||
{
|
||||
NSMenu *_menu;
|
||||
}
|
||||
+ (GormNSMenu *) menuWithMenu: (NSMenu *)menu;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
#include "GormNSMenu.h"
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
#include <AppKit/NSPopUpButtonCell.h>
|
||||
#include <InterfaceBuilder/InterfaceBuilder.h>
|
||||
|
@ -80,6 +81,22 @@
|
|||
@end
|
||||
|
||||
@implementation GormNSMenu
|
||||
+ (GormNSMenu *) menuWithMenu: (NSMenu *)menu
|
||||
{
|
||||
GormNSMenu *newMenu = [GormNSMenu new];
|
||||
NSEnumerator *en = [[menu itemArray] objectEnumerator];
|
||||
NSMenuItem *item = nil;
|
||||
|
||||
while((item = [en nextObject]) != nil)
|
||||
{
|
||||
[newMenu addItem: [item copy]];
|
||||
}
|
||||
|
||||
[newMenu setTitle: [menu title]];
|
||||
|
||||
return newMenu;
|
||||
}
|
||||
|
||||
- (id) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
if((self = [super initWithCoder: coder]) != nil)
|
||||
|
|
|
@ -118,35 +118,27 @@
|
|||
/*
|
||||
* The Font menu
|
||||
*/
|
||||
m = [GormNSMenu new];
|
||||
[m addItemWithTitle: @"Font Panel..."
|
||||
action: @selector(orderFrontFontPanel:)
|
||||
keyEquivalent: @"t"];
|
||||
[m addItemWithTitle: @"Bold"
|
||||
action: @selector(addFontTrait:)
|
||||
keyEquivalent: @"b"];
|
||||
[m addItemWithTitle: @"Italic"
|
||||
action: @selector(addFontTrait:)
|
||||
keyEquivalent: @"i"];
|
||||
m = [GormNSMenu menuWithMenu: [[NSFontManager sharedFontManager] fontMenu: YES]];
|
||||
// Other font menu items
|
||||
[m addItemWithTitle: @"Underline"
|
||||
action: @selector(underline:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(underline:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Superscript"
|
||||
action: @selector(superscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(superscript:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Subscript"
|
||||
action: @selector(subscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(subscript:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Unscript"
|
||||
action: @selector(unscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(unscript:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Copy Font"
|
||||
action: @selector(copyFont:)
|
||||
keyEquivalent: @"3"];
|
||||
action: @selector(copyFont:)
|
||||
keyEquivalent: @"3"];
|
||||
[m addItemWithTitle: @"Paste Font"
|
||||
action: @selector(pasteFont:)
|
||||
keyEquivalent: @"4"];
|
||||
[m setTitle: @"Font"];
|
||||
action: @selector(pasteFont:)
|
||||
keyEquivalent: @"4"];
|
||||
|
||||
i = [[NSMenuItem alloc] initWithTitle: @"Font"
|
||||
action: @selector(submenuAction:)
|
||||
keyEquivalent: @""];
|
||||
|
@ -341,35 +333,28 @@
|
|||
i = (NSMenuItem *)[m addItemWithTitle: @"Font"
|
||||
action: NULL
|
||||
keyEquivalent: @""];
|
||||
s = [GormNSMenu new];
|
||||
[s addItemWithTitle: @"Font Panel..."
|
||||
action: @selector(orderFrontFontPanel:)
|
||||
keyEquivalent: @"t"];
|
||||
[s addItemWithTitle: @"Bold"
|
||||
action: @selector(addFontTrait:)
|
||||
keyEquivalent: @"b"];
|
||||
[s addItemWithTitle: @"Italic"
|
||||
action: @selector(addFontTrait:)
|
||||
keyEquivalent: @"i"];
|
||||
|
||||
s = [GormNSMenu menuWithMenu: [[NSFontManager sharedFontManager] fontMenu: YES]];
|
||||
|
||||
// Other font menu items
|
||||
[s addItemWithTitle: @"Underline"
|
||||
action: @selector(underline:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(underline:)
|
||||
keyEquivalent: @""];
|
||||
[s addItemWithTitle: @"Superscript"
|
||||
action: @selector(superscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(superscript:)
|
||||
keyEquivalent: @""];
|
||||
[s addItemWithTitle: @"Subscript"
|
||||
action: @selector(subscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(subscript:)
|
||||
keyEquivalent: @""];
|
||||
[s addItemWithTitle: @"Unscript"
|
||||
action: @selector(unscript:)
|
||||
keyEquivalent: @""];
|
||||
action: @selector(unscript:)
|
||||
keyEquivalent: @""];
|
||||
[s addItemWithTitle: @"Copy Font"
|
||||
action: @selector(copyFont:)
|
||||
keyEquivalent: @"3"];
|
||||
action: @selector(copyFont:)
|
||||
keyEquivalent: @"3"];
|
||||
[s addItemWithTitle: @"Paste Font"
|
||||
action: @selector(pasteFont:)
|
||||
keyEquivalent: @"4"];
|
||||
[s setTitle: @"Font"];
|
||||
action: @selector(pasteFont:)
|
||||
keyEquivalent: @"4"];
|
||||
[m setSubmenu: s forItem: i];
|
||||
|
||||
/*
|
||||
|
|
|
@ -31,11 +31,14 @@
|
|||
{
|
||||
unsigned _gormStyleMask;
|
||||
BOOL _gormReleasedWhenClosed;
|
||||
unsigned int autoPositionMask;
|
||||
}
|
||||
- (void) _setStyleMask: (unsigned int)newStyleMask;
|
||||
- (unsigned int) _styleMask;
|
||||
- (void) _setReleasedWhenClosed: (BOOL) flag;
|
||||
- (BOOL) _isReleasedWhenClosed;
|
||||
- (unsigned int) autoPositionMask;
|
||||
- (void) setAutoPositionMask: (unsigned int)mask;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <GNUstepGUI/GSNibTemplates.h>
|
||||
#include "GormNSPanel.h"
|
||||
|
||||
static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
|
||||
|
@ -65,6 +66,9 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
|
|||
|
||||
// remove the default icon...
|
||||
[self setMiniwindowImage: nil];
|
||||
|
||||
// set the default position mask;
|
||||
autoPositionMask = GSWindowMaxXMargin | GSWindowMaxYMargin;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -94,4 +98,14 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
|
|||
{
|
||||
return _gormReleasedWhenClosed;
|
||||
}
|
||||
|
||||
- (unsigned int) autoPositionMask
|
||||
{
|
||||
return autoPositionMask;
|
||||
}
|
||||
|
||||
- (void) setAutoPositionMask: (unsigned int)mask
|
||||
{
|
||||
autoPositionMask = mask;
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -30,11 +30,14 @@
|
|||
{
|
||||
unsigned _gormStyleMask;
|
||||
BOOL _gormReleasedWhenClosed;
|
||||
unsigned int autoPositionMask;
|
||||
}
|
||||
- (void) _setStyleMask: (unsigned int)newStyleMask;
|
||||
- (unsigned int) _styleMask;
|
||||
- (void) _setReleasedWhenClosed: (BOOL) flag;
|
||||
- (BOOL) _isReleasedWhenClosed;
|
||||
- (unsigned int) autoPositionMask;
|
||||
- (void) setAutoPositionMask: (unsigned int)mask;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#include <GNUstepGUI/GSNibTemplates.h>
|
||||
#include "GormNSWindow.h"
|
||||
|
||||
// the default style mask we start with.
|
||||
|
@ -76,6 +77,9 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
|
|||
|
||||
// remove the default icon...
|
||||
[self setMiniwindowImage: nil];
|
||||
|
||||
// set the default position mask;
|
||||
autoPositionMask = GSWindowMaxXMargin | GSWindowMaxYMargin;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -116,48 +120,13 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
|
|||
return _gormReleasedWhenClosed;
|
||||
}
|
||||
|
||||
// for testing...
|
||||
/*
|
||||
- (id) retain
|
||||
- (unsigned int) autoPositionMask
|
||||
{
|
||||
NSLog(@"Being retained... %d: %@", [self retainCount], self);
|
||||
return [super retain];
|
||||
return autoPositionMask;
|
||||
}
|
||||
|
||||
- (oneway void) release
|
||||
- (void) setAutoPositionMask: (unsigned int)mask
|
||||
{
|
||||
NSLog(@"Being released... %d: %@", [self retainCount], self);
|
||||
[super release];
|
||||
autoPositionMask = mask;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
NSLog(@"Deallocing %@",self);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) orderFront: (id)sender
|
||||
{
|
||||
NSLog(@"Ordering front...%@",self);
|
||||
[super orderFront: sender];
|
||||
}
|
||||
|
||||
- (void) orderFrontRegardless
|
||||
{
|
||||
NSLog(@"Ordering front regardless...%@",self);
|
||||
[super orderFrontRegardless];
|
||||
}
|
||||
|
||||
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
|
||||
{
|
||||
// NSLog(@"Ordering window %@",self);
|
||||
[super orderWindow: place relativeTo: otherWin];
|
||||
}
|
||||
|
||||
- (void) orderOut: (id)sender
|
||||
{
|
||||
NSLog(@"Ordering out...%@",self);
|
||||
[super orderOut: sender];
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
|
|
@ -1,12 +1,24 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
FirstResponder = {
|
||||
Actions = (
|
||||
"setAutoposition:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
GormWindowSizeInspector = {
|
||||
Actions = (
|
||||
"setAutoposition:"
|
||||
);
|
||||
Outlets = (
|
||||
minForm,
|
||||
sizeForm,
|
||||
window
|
||||
window,
|
||||
bottom,
|
||||
left,
|
||||
maxForm,
|
||||
right,
|
||||
top
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#include <GNUstepGUI/GSNibTemplates.h>
|
||||
#include <InterfaceBuilder/IBPalette.h>
|
||||
#include <InterfaceBuilder/IBInspector.h>
|
||||
#include <InterfaceBuilder/IBApplicationAdditions.h>
|
||||
|
@ -356,8 +357,6 @@ NSwindow inspector
|
|||
if ([anObject hasDynamicDepthLimit])
|
||||
[optionMatrix selectCellAtRow: 5 column: 0];
|
||||
|
||||
// FIXME: wants to be color comes here
|
||||
|
||||
// icon name
|
||||
[[iconNameForm cellAtIndex: 0] setStringValue: [[object miniwindowImage] name]];
|
||||
|
||||
|
@ -417,7 +416,14 @@ NSwindow inspector
|
|||
{
|
||||
NSForm *sizeForm;
|
||||
NSForm *minForm;
|
||||
NSForm *maxForm;
|
||||
id top;
|
||||
id bottom;
|
||||
id left;
|
||||
id right;
|
||||
}
|
||||
|
||||
- (void) setAutoposition: (id)sender;
|
||||
@end
|
||||
|
||||
@implementation GormWindowSizeInspector
|
||||
|
@ -440,12 +446,20 @@ NSwindow inspector
|
|||
[[minForm cellAtIndex: 1] floatValue]);
|
||||
[object setMinSize: size];
|
||||
}
|
||||
else if (control == maxForm)
|
||||
{
|
||||
NSSize size;
|
||||
size = NSMakeSize([[maxForm cellAtIndex: 0] floatValue],
|
||||
[[maxForm cellAtIndex: 1] floatValue]);
|
||||
[object setMaxSize: size];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _getValuesFromObject: anObject
|
||||
{
|
||||
NSRect frame;
|
||||
NSSize size;
|
||||
unsigned int mask = [object autoPositionMask];
|
||||
|
||||
if (anObject != object)
|
||||
return;
|
||||
|
@ -459,6 +473,30 @@ NSwindow inspector
|
|||
size = [anObject minSize];
|
||||
[[minForm cellAtIndex: 0] setFloatValue: size.width];
|
||||
[[minForm cellAtIndex: 1] setFloatValue: size.height];
|
||||
|
||||
size = [anObject maxSize];
|
||||
[[maxForm cellAtIndex: 0] setFloatValue: size.width];
|
||||
[[maxForm cellAtIndex: 1] setFloatValue: size.height];
|
||||
|
||||
if (mask & GSWindowMaxYMargin)
|
||||
[top setState: NSOnState];
|
||||
else
|
||||
[top setState: NSOffState];
|
||||
|
||||
if (mask & GSWindowMinYMargin)
|
||||
[bottom setState: NSOnState];
|
||||
else
|
||||
[bottom setState: NSOffState];
|
||||
|
||||
if (mask & GSWindowMaxXMargin)
|
||||
[right setState: NSOnState];
|
||||
else
|
||||
[right setState: NSOffState];
|
||||
|
||||
if (mask & GSWindowMinXMargin)
|
||||
[left setState: NSOnState];
|
||||
else
|
||||
[left setState: NSOffState];
|
||||
}
|
||||
|
||||
- (void) windowChangeNotification: (NSNotification*)aNotification
|
||||
|
@ -488,6 +526,13 @@ NSwindow inspector
|
|||
selector: @selector(windowChangeNotification:)
|
||||
name: NSWindowDidResizeNotification
|
||||
object: object];
|
||||
|
||||
// set up tags...
|
||||
[top setTag: GSWindowMaxYMargin];
|
||||
[bottom setTag: GSWindowMinYMargin];
|
||||
[left setTag: GSWindowMinXMargin];
|
||||
[right setTag: GSWindowMaxXMargin];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -496,6 +541,7 @@ NSwindow inspector
|
|||
[super ok: sender];
|
||||
[self _setValuesFromControl: sizeForm];
|
||||
[self _setValuesFromControl: minForm];
|
||||
[self _setValuesFromControl: maxForm];
|
||||
}
|
||||
|
||||
- (void) setObject: (id)anObject
|
||||
|
@ -504,4 +550,19 @@ NSwindow inspector
|
|||
[self _getValuesFromObject: anObject];
|
||||
}
|
||||
|
||||
- (void) setAutoposition: (id)sender
|
||||
{
|
||||
unsigned mask = [sender tag];
|
||||
|
||||
[super ok: sender];
|
||||
if ([sender state] == NSOnState)
|
||||
{
|
||||
mask = [object autoPositionMask] | mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
mask = [object autoPositionMask] & ~mask;
|
||||
}
|
||||
[object setAutoPositionMask: mask];
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -8,6 +8,24 @@
|
|||
comment = "Will store the old default settings in the action mask field.";
|
||||
version = 1;
|
||||
};
|
||||
GSWindowTemplate = {
|
||||
comment = "Will not store autoposition mask information.";
|
||||
version = 0;
|
||||
};
|
||||
};
|
||||
"GNUstep gui-0.9.5" = {
|
||||
GSNibContainer = {
|
||||
comment = "Not compatible with GNUstep gui-0.9.3 or earlier.";
|
||||
version = 1;
|
||||
};
|
||||
NSTextFieldCell = {
|
||||
comment = "Change the default behavior defined in the action mask, this will not be useable under older versions.";
|
||||
version = 2;
|
||||
};
|
||||
GSWindowTemplate = {
|
||||
comment = "Will not store autoposition mask information.";
|
||||
version = 0;
|
||||
};
|
||||
};
|
||||
"Latest Version" = {
|
||||
GSNibContainer = {
|
||||
|
@ -18,5 +36,9 @@
|
|||
comment = "Change the default behavior defined in the action mask, this will not be useable under older versions.";
|
||||
version = 2;
|
||||
};
|
||||
GSWindowTemplate = {
|
||||
comment = "New attribute to store auto-position mask. Not compatible with 0.9.5 or earlier.";
|
||||
version = 1;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue