diff --git a/ChangeLog b/ChangeLog index f022864d..aa0c0494 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-01-21 00:19 Gregory John Casamento + + * GormCore/GormViewEditor.m: [GormViewEditor activate] do not send + notifications about frame size changes, if the object is a standalone + view. + * GormCore/GormViewSizeInspector.m: [GormViewSizeInspector setObject:] + Added code to enable/disable cells if view is standalone. + 2006-01-16 23:19 Gregory John Casamento * GormCore/GormViewSizeInspector.m: Correction for a similar problem diff --git a/GormCore/GormViewEditor.m b/GormCore/GormViewEditor.m index 53414882..e7da7269 100644 --- a/GormCore/GormViewEditor.m +++ b/GormCore/GormViewEditor.m @@ -179,6 +179,7 @@ static BOOL currently_displaying = NO; if(viewWindow == nil) { [self setAutoresizesSubviews: NO]; + [_editedObject setPostsFrameChangedNotifications: YES]; } else { @@ -187,13 +188,13 @@ static BOOL currently_displaying = NO; [self addSubview: _editedObject]; - [_editedObject setPostsFrameChangedNotifications: YES]; + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(editedObjectFrameDidChange:) name: NSViewFrameDidChangeNotification object: _editedObject]; - + [self setPostsFrameChangedNotifications: YES]; [[NSNotificationCenter defaultCenter] addObserver: self @@ -321,14 +322,12 @@ static BOOL currently_displaying = NO; [self setBounds: [_editedObject frame]]; } - - (void) frameDidChange: (id) sender { [self setBounds: [self frame]]; [_editedObject setFrame: [self frame]]; } - - (GormPlacementInfo *) initializeResizingInFrame: (NSView *)view withKnob: (IBKnobPosition) knob { diff --git a/GormCore/GormViewSizeInspector.m b/GormCore/GormViewSizeInspector.m index 3478e45e..82892a73 100644 --- a/GormCore/GormViewSizeInspector.m +++ b/GormCore/GormViewSizeInspector.m @@ -25,6 +25,7 @@ #include "GormPrivate.h" #include "GormViewKnobs.h" #include "GormViewSizeInspector.h" +#include "GormViewWindow.h" @implementation GormViewSizeInspector @@ -155,6 +156,15 @@ NSImage *mVLine = nil; if (anObject != object) return; + if([[anObject window] isKindOfClass: [GormViewWindow class]]) + { + [sizeForm setEnabled: NO]; + } + else + { + [sizeForm setEnabled: YES]; + } + // stop editing so that the new values can be populated. [sizeForm abortEditing]; @@ -241,6 +251,32 @@ NSImage *mVLine = nil; [[sizeForm cellAtIndex: 2] setFloatValue: NSWidth(frame)]; [[sizeForm cellAtIndex: 3] setFloatValue: NSHeight(frame)]; [anObject setPostsFrameChangedNotifications: YES]; + + if([[anObject window] isKindOfClass: [GormViewWindow class]] || + [anObject window] == nil) + { + [[sizeForm cellAtIndex: 0] setEnabled: NO]; + [[sizeForm cellAtIndex: 1] setEnabled: NO]; + [[sizeForm cellAtIndex: 2] setEnabled: NO]; + [[sizeForm cellAtIndex: 3] setEnabled: NO]; + + [[sizeForm cellAtIndex: 0] setEditable: NO]; + [[sizeForm cellAtIndex: 1] setEditable: NO]; + [[sizeForm cellAtIndex: 2] setEditable: NO]; + [[sizeForm cellAtIndex: 3] setEditable: NO]; + } + else + { + [[sizeForm cellAtIndex: 0] setEnabled: YES]; + [[sizeForm cellAtIndex: 1] setEnabled: YES]; + [[sizeForm cellAtIndex: 2] setEnabled: YES]; + [[sizeForm cellAtIndex: 3] setEnabled: YES]; + + [[sizeForm cellAtIndex: 0] setEditable: YES]; + [[sizeForm cellAtIndex: 1] setEditable: YES]; + [[sizeForm cellAtIndex: 2] setEditable: YES]; + [[sizeForm cellAtIndex: 3] setEditable: YES]; + } } } @end