A slightly more elegant solution to the original standalone view issue.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@22343 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-01-21 05:22:01 +00:00
parent e3b123eb05
commit a4119701cb
3 changed files with 47 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2006-01-21 00:19 Gregory John Casamento <greg_casamento@yahoo.com>
* 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 <greg_casamento@yahoo.com>
* GormCore/GormViewSizeInspector.m: Correction for a similar problem

View file

@ -179,6 +179,7 @@ static BOOL currently_displaying = NO;
if(viewWindow == nil)
{
[self setAutoresizesSubviews: NO];
[_editedObject setPostsFrameChangedNotifications: YES];
}
else
{
@ -187,7 +188,7 @@ static BOOL currently_displaying = NO;
[self addSubview: _editedObject];
[_editedObject setPostsFrameChangedNotifications: YES];
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(editedObjectFrameDidChange:)
@ -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
{

View file

@ -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