diff --git a/ChangeLog b/ChangeLog index e498324d..2c610ae9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2004-04-03 13:13 Gregory John Casamento + + * GormClassManager.m: Corrected a problem with renaming a class + in [GormClassManager renameClassName:toClassName:]. The + direct subclasses of the class whose name is being changed must + be modified to have their superclass name set to the new name. + * GormCustomView.m: Set the custom view to use the bold font to + display the view name at the default size set by the user. + * GormDocument.m: Corrected an issue with redisplay of the changed + class name. Also made some changes to correct some compiler + warnings. + * GormFontViewController.m: The default action of the font controller + is now to set the "encodes default" to off, since this is what + the user most often means when selecting a preset font. + * GormInternalViewEditor.[hm]: + [GormInternalViewEditor changeFont:]. This allows the font to be + modified on NSForms. + * GormMatrixEditor.[hm]: same as above, except we're changing + forms in a matrix. These two classes don't derive from one + another so the method had to, unfortunately, be duplicated. + 2004-03-30 15:36 Gregory John Casamento * GormPalettesManager.m: [GormPaletteView draggedImage:endedAt: diff --git a/GormClassManager.m b/GormClassManager.m index 773bc78d..0cb58b9e 100644 --- a/GormClassManager.m +++ b/GormClassManager.m @@ -985,6 +985,7 @@ if (classInfo != nil && [classInformation objectForKey: name] == nil) { int index = 0; + NSArray *subclasses = [self subClassesOf: oldName]; [self _touch]; RETAIN(classInfo); @@ -995,6 +996,8 @@ if ((index = [customClasses indexOfObject: oldName]) != NSNotFound) { NSEnumerator *en = [customClassMap keyEnumerator]; + NSEnumerator *cen = [subclasses objectEnumerator]; + id sc = nil; id object = nil; NSDebugLog(@"replacing object with %@, %@",name, customClasses); @@ -1016,6 +1019,14 @@ } } NSDebugLog(@"New customClassMap = %@",customClassMap); // and after + + // Iterate over the list of subclasses and replace their referece with the new + // name. + while((sc = [cen nextObject]) != nil) + { + [self setSuperClassNamed: name + forClassNamed: sc]; + } } else NSLog(@"customClass not found %@",oldName); @@ -1024,7 +1035,6 @@ return YES; } else return NO; - } - (NSString *)parentOfClass: (NSString *)aClass diff --git a/GormCustomView.m b/GormCustomView.m index 2106caee..d2f3dac7 100644 --- a/GormCustomView.m +++ b/GormCustomView.m @@ -42,7 +42,7 @@ [self setTextColor: [NSColor whiteColor]]; [self setDrawsBackground: YES]; [self setAlignment: NSCenterTextAlignment]; - [self setFont: [NSFont boldSystemFontOfSize: 12]]; + [self setFont: [NSFont boldSystemFontOfSize: 0]]; [self setEditable: NO]; [self setClassName: @"CustomView"]; return self; diff --git a/GormDocument.m b/GormDocument.m index 0dc3bc54..cc414355 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -3094,7 +3094,7 @@ static NSImage *classesImage = nil; NSDebugLog(@"setSelectionFromEditor %@", anEditor); if ([(NSObject *)anEditor respondsToSelector: @selector(window)]) { - [[anEditor window] makeFirstResponder: anEditor]; + [[anEditor window] makeFirstResponder: (id)anEditor]; } [nc postNotificationName: IBSelectionChangedNotification object: anEditor]; @@ -3558,7 +3558,14 @@ objectValueForTableColumn: (NSTableColumn *)aTableColumn [classManager renameClassNamed: item newName: anObject]; [gov reloadData]; row = [gov rowForItem: anObject]; + + // make sure that item is collapsed... + [gov expandItem: anObject]; + [gov collapseItem: anObject]; + + // scroll to the item.. [gov scrollRowToVisible: row]; + // [gov selectRow: row byExtendingSelection: NO]; } } } diff --git a/GormFontViewController.m b/GormFontViewController.m index c925d193..365f82dc 100644 --- a/GormFontViewController.m +++ b/GormFontViewController.m @@ -103,8 +103,8 @@ static GormFontViewController *gorm_font_cont = nil; else { [encodeButton setEnabled: YES]; - [encodeButton setState: NSOnState]; - } + [encodeButton setState: NSOffState]; + } } - (id) view diff --git a/GormInternalViewEditor.h b/GormInternalViewEditor.h index 20ab9b13..36a5cf63 100644 --- a/GormInternalViewEditor.h +++ b/GormInternalViewEditor.h @@ -30,6 +30,7 @@ { } - (NSArray*) destroyAndListSubviews; +- (void) changeFont: (id)sender; @end #endif diff --git a/GormInternalViewEditor.m b/GormInternalViewEditor.m index 6888b7df..ae3ea42c 100644 --- a/GormInternalViewEditor.m +++ b/GormInternalViewEditor.m @@ -25,6 +25,7 @@ #include #include "GormPrivate.h" #include "GormInternalViewEditor.h" +#include "GormFontViewController.h" @class GormEditorToParent; @@ -933,4 +934,35 @@ static NSImage *horizontalImage; { [self deleteSelection]; } + +- (void) changeFont: (id)sender +{ + NSEnumerator *enumerator = [[self selection] objectEnumerator]; + id anObject; + NSFont *newFont; + + NSDebugLog(@"In %@ changing font for %@",[self className],[self selection]); + while ((anObject = [enumerator nextObject])) + { + if([anObject respondsToSelector: @selector(setTitleFont:)] && + [anObject respondsToSelector: @selector(setTextFont:)]) + { + newFont = [sender convertFont: [anObject font]]; + newFont = [[GormFontViewController sharedGormFontViewController] + convertFont: newFont]; + [anObject setTitleFont: newFont]; + [anObject setTextFont: newFont]; + } + else if ([anObject respondsToSelector: @selector(font)] && + [anObject respondsToSelector: @selector(setFont:)]) + { + newFont = [sender convertFont: [anObject font]]; + newFont = [[GormFontViewController sharedGormFontViewController] + convertFont: newFont]; + [anObject setFont: newFont]; + } + } + + return; +} @end diff --git a/GormMatrixEditor.m b/GormMatrixEditor.m index 65300b52..2e184910 100644 --- a/GormMatrixEditor.m +++ b/GormMatrixEditor.m @@ -29,6 +29,7 @@ #include "GormMatrixEditor.h" #include "GormViewWithSubviewsEditor.h" #include "GormPlacementInfo.h" +#include "GormFontViewController.h" #define _EO ((NSMatrix*)_editedObject) @@ -640,6 +641,36 @@ static BOOL done_editing; } } +- (void) changeFont: (id)sender +{ + NSEnumerator *enumerator = [[self selection] objectEnumerator]; + id anObject; + NSFont *newFont; + + NSDebugLog(@"In %@ changing font for %@",[self className],[self selection]); + while ((anObject = [enumerator nextObject])) + { + if([anObject respondsToSelector: @selector(setTitleFont:)] && + [anObject respondsToSelector: @selector(setTextFont:)]) + { + newFont = [sender convertFont: [anObject font]]; + newFont = [[GormFontViewController sharedGormFontViewController] + convertFont: newFont]; + [anObject setTitleFont: newFont]; + [anObject setTextFont: newFont]; + } + else if ([anObject respondsToSelector: @selector(font)] && + [anObject respondsToSelector: @selector(setFont:)]) + { + newFont = [sender convertFont: [anObject font]]; + newFont = [[GormFontViewController sharedGormFontViewController] + convertFont: newFont]; + [anObject setFont: newFont]; + } + } + + return; +} @end diff --git a/GormScrollViewEditor.m b/GormScrollViewEditor.m index bcb3a421..83c36857 100644 --- a/GormScrollViewEditor.m +++ b/GormScrollViewEditor.m @@ -67,9 +67,10 @@ NSView *documentView = [_EO documentView]; NSDebugLog(@"documentView %@", documentView); - documentViewEditor = [document editorForObject: documentView - inEditor: self - create: YES]; + documentViewEditor = (GormInternalViewEditor *)[document + editorForObject: documentView + inEditor: self + create: YES]; return YES; } diff --git a/GormViewWithSubviewsEditor.h b/GormViewWithSubviewsEditor.h index b29b0c03..9d003e9a 100644 --- a/GormViewWithSubviewsEditor.h +++ b/GormViewWithSubviewsEditor.h @@ -47,6 +47,7 @@ */ - (void) closeSubeditors; - (void) deactivateSubeditors; +- (void) changeFont: (id)sender; @end #endif