mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
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:
parent
e3b123eb05
commit
a4119701cb
3 changed files with 47 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue