mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-23 06:20:47 +00:00
Fixes for NSFontManager handling
This commit is contained in:
parent
608c5218ce
commit
21226a0fa3
2 changed files with 43 additions and 25 deletions
|
@ -518,28 +518,35 @@ static NSImage *fileImage = nil;
|
|||
*/
|
||||
- (void) _instantiateFontManager
|
||||
{
|
||||
GSNibItem *item = nil;
|
||||
NSMenu *fontMenu = nil;
|
||||
|
||||
item = [[GormObjectProxy alloc] initWithClassName: @"NSFontManager"];
|
||||
|
||||
[self setName: @"NSFont" forObject: item];
|
||||
[self attachObject: item toParent: nil];
|
||||
RELEASE(item);
|
||||
|
||||
// set the holder in the document.
|
||||
fontManager = (GormObjectProxy *)item;
|
||||
[self changeToViewWithTag: 0];
|
||||
|
||||
// Add the connection to the menu from the font manager, if the NSFontMenu exists...
|
||||
fontMenu = [self fontMenu];
|
||||
if (fontMenu != nil)
|
||||
if (fontManager != nil)
|
||||
{
|
||||
NSNibOutletConnector *con = [[NSNibOutletConnector alloc] init];
|
||||
[con setSource: item];
|
||||
[con setDestination: fontMenu];
|
||||
[con setLabel: @"menu"];
|
||||
[self addConnector: con];
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
GSNibItem *item = nil;
|
||||
NSMenu *fontMenu = nil;
|
||||
|
||||
item = [[GormObjectProxy alloc] initWithClassName: @"NSFontManager"];
|
||||
|
||||
[self setName: @"NSFont" forObject: item];
|
||||
[self attachObject: item toParent: nil];
|
||||
RELEASE(item);
|
||||
|
||||
// set the holder in the document.
|
||||
fontManager = (GormObjectProxy *)item;
|
||||
[self changeToViewWithTag: 0];
|
||||
|
||||
// Add the connection to the menu from the font manager, if the NSFontMenu exists...
|
||||
fontMenu = [self fontMenu];
|
||||
if (fontMenu != nil)
|
||||
{
|
||||
NSNibOutletConnector *con = [[NSNibOutletConnector alloc] init];
|
||||
[con setSource: item];
|
||||
[con setDestination: fontMenu];
|
||||
[con setLabel: @"menu"];
|
||||
[self addConnector: con];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,12 +38,17 @@
|
|||
/*
|
||||
* This allows us to retrieve the customClasses from the XIB unarchiver.
|
||||
*/
|
||||
|
||||
@interface NSKeyedUnarchiver (Private)
|
||||
- (NSDictionary *) customClasses;
|
||||
- (NSDictionary *) decoded;
|
||||
@end
|
||||
|
||||
/*
|
||||
* Allow access to the method to instantiate the font manager
|
||||
*/
|
||||
@interface GormDocument (XibPluginPrivate)
|
||||
- (void) _instantiateFontManager;
|
||||
@end
|
||||
|
||||
/*
|
||||
* Xib loader...
|
||||
|
@ -92,6 +97,12 @@
|
|||
result = [document firstResponder];
|
||||
[obj setRealObject: result];
|
||||
}
|
||||
else if ([className isEqualToString: @"NSFontManager"])
|
||||
{
|
||||
[document _instantiateFontManager];
|
||||
result = [document fontManager];
|
||||
[obj setRealObject: result];
|
||||
}
|
||||
else
|
||||
{
|
||||
result = [obj realObject];
|
||||
|
@ -139,8 +150,7 @@
|
|||
|
||||
// these are preset values
|
||||
if ([theId isEqualToString: @"-1"]
|
||||
|| [theId isEqualToString: @"-3"]
|
||||
|| [customClassName isEqualToString: @"NSFontManager"])
|
||||
|| [theId isEqualToString: @"-3"])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -224,6 +234,7 @@
|
|||
NSString *subClassName = nil;
|
||||
GormClassManager *classManager = [doc classManager];
|
||||
|
||||
document = doc; // make sure they are the same...
|
||||
if ([super loadFileWrapper: wrapper
|
||||
withDocument: doc] &&
|
||||
[wrapper isDirectory] == NO)
|
||||
|
@ -325,7 +336,7 @@
|
|||
// skip the file's owner, it is handled above...
|
||||
if ((obj == _nibFilesOwner)
|
||||
|| (obj == xibFirstResponder))
|
||||
// || (obj == xibFontManager))
|
||||
// || (obj == xibFontManager))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue