mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 04:50:47 +00:00
Nib improvments and a document bugfix.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23059 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cad6a29fde
commit
464ee79c8d
4 changed files with 86 additions and 27 deletions
|
@ -52,6 +52,8 @@
|
|||
#include <GNUstepGUI/GSNibCompatibility.h>
|
||||
#include <GNUstepGUI/GSInstantiator.h>
|
||||
|
||||
static BOOL _isInInterfaceBuilder = NO;
|
||||
|
||||
@implementation NSWindowTemplate
|
||||
+ (void) initialize
|
||||
{
|
||||
|
@ -121,6 +123,8 @@
|
|||
ASSIGN(_title, [coder decodeObjectForKey: @"NSWindowTitle"]);
|
||||
_windowStyle |= NSTitledWindowMask;
|
||||
}
|
||||
|
||||
_baseWindowClass = [NSWindow class];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -157,10 +161,19 @@
|
|||
{
|
||||
if(_realObject == nil)
|
||||
{
|
||||
Class aClass = NSClassFromString(_windowClass);
|
||||
Class aClass;
|
||||
NSEnumerator *en;
|
||||
id v = nil;
|
||||
|
||||
|
||||
if([NSClassSwapper isInInterfaceBuilder])
|
||||
{
|
||||
aClass = [self baseWindowClass];
|
||||
}
|
||||
else
|
||||
{
|
||||
aClass = NSClassFromString(_windowClass);
|
||||
}
|
||||
|
||||
if (aClass == nil)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
|
@ -321,6 +334,11 @@
|
|||
{
|
||||
return _windowClass;
|
||||
}
|
||||
|
||||
- (Class) baseWindowClass
|
||||
{
|
||||
return _baseWindowClass;
|
||||
}
|
||||
@end
|
||||
|
||||
// Template for any classes which derive from NSView
|
||||
|
@ -546,7 +564,17 @@
|
|||
{
|
||||
if(_object == nil)
|
||||
{
|
||||
Class aClass = NSClassFromString(_className);
|
||||
Class aClass;
|
||||
|
||||
if([NSClassSwapper isInInterfaceBuilder])
|
||||
{
|
||||
aClass = [self class];
|
||||
}
|
||||
else
|
||||
{
|
||||
aClass = NSClassFromString(_className);
|
||||
}
|
||||
|
||||
if(aClass == nil)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
|
@ -583,7 +611,17 @@
|
|||
{
|
||||
if(_view == nil)
|
||||
{
|
||||
Class aClass = NSClassFromString(_className);
|
||||
Class aClass;
|
||||
|
||||
if([NSClassSwapper isInInterfaceBuilder])
|
||||
{
|
||||
aClass = [self class];
|
||||
}
|
||||
else
|
||||
{
|
||||
aClass = NSClassFromString(_className);
|
||||
}
|
||||
|
||||
if(aClass == nil)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
|
@ -738,6 +776,16 @@
|
|||
@end
|
||||
|
||||
@implementation NSClassSwapper
|
||||
+ (void) setIsInInterfaceBuilder: (BOOL)flag
|
||||
{
|
||||
_isInInterfaceBuilder = flag;
|
||||
}
|
||||
|
||||
+ (BOOL) isInInterfaceBuilder
|
||||
{
|
||||
return _isInInterfaceBuilder;
|
||||
}
|
||||
|
||||
- (void) setTemplate: (id)temp
|
||||
{
|
||||
ASSIGN(_template, temp);
|
||||
|
@ -758,11 +806,6 @@
|
|||
return _className;
|
||||
}
|
||||
|
||||
+ (BOOL) isInInterfaceBuilder
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void) instantiateRealObject: (NSCoder *)coder withClassName: (NSString *)className
|
||||
{
|
||||
Class aClass = NSClassFromString(className);
|
||||
|
@ -947,7 +990,7 @@
|
|||
|
||||
- (NSMutableSet *) topLevelObjects
|
||||
{
|
||||
return nil;
|
||||
return _topLevelObjects;
|
||||
}
|
||||
|
||||
- (NSMutableDictionary *) nameTable
|
||||
|
@ -955,16 +998,16 @@
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSDictionary *) customClasses
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *) visibleWindows
|
||||
{
|
||||
return [_visibleWindows allObjects];
|
||||
}
|
||||
|
||||
- (NSMapTable) objects
|
||||
{
|
||||
return _objects;
|
||||
}
|
||||
|
||||
- (id) objectForName: (NSString *)name
|
||||
{
|
||||
NSArray *nameKeys = (NSArray *)NSAllMapTableKeys(_names);
|
||||
|
@ -989,17 +1032,6 @@
|
|||
return result;
|
||||
}
|
||||
|
||||
- (void) setName: (NSString *)name forObject: (id)obj
|
||||
{
|
||||
// TODO_NIB: Implement this in GSNibCompatibility.
|
||||
}
|
||||
|
||||
- (BOOL) containsObject: (id) obj
|
||||
{
|
||||
// TODO_NIB: Implement this in GSNibCompatibility.
|
||||
return NO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the values from the map in the same order as the keys.
|
||||
*/
|
||||
|
@ -1124,6 +1156,9 @@
|
|||
[self _buildMap: _names withKeys: nameKeys andValues: nameValues];
|
||||
[self _buildMap: _objects withKeys: objectsKeys andValues: objectsValues];
|
||||
[self _buildMap: _oids withKeys: oidsKeys andValues: oidsValues];
|
||||
|
||||
// instantiate...
|
||||
_topLevelObjects = [[NSMutableSet alloc] init];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1180,6 +1215,7 @@
|
|||
RELEASE(_framework);
|
||||
RELEASE(_visibleWindows);
|
||||
RELEASE(_root);
|
||||
RELEASE(_topLevelObjects);
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,14 @@
|
|||
{
|
||||
NSString *title = [[NSDocumentController sharedDocumentController]
|
||||
displayNameForType: [self fileType]];
|
||||
[spaButton selectItemWithTitle: title];
|
||||
if([spaButton itemWithTitle: title] != nil)
|
||||
{
|
||||
[spaButton selectItemWithTitle: title];
|
||||
}
|
||||
else
|
||||
{
|
||||
[spaButton selectItemAtIndex: 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue