mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
Various improvements and a correction for but #10849.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20356 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e0ead07623
commit
37839119b2
5 changed files with 57 additions and 18 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-11-17 12:59 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* GormViewEditor.m: initWithObject:withDocument: added code
|
||||||
|
to instantiated GormViewWindow if the view being added has no
|
||||||
|
window attached to it. This is to handle standalone views.
|
||||||
|
Correction for Report #10849.
|
||||||
|
* GormViewWindow.m: [GormViewWindow initWithView:] call to
|
||||||
|
setReleasedWhenClosed so that the window isn't released when
|
||||||
|
the view window is closed. This was causing a crash.
|
||||||
|
|
||||||
2004-11-16 19:19 Gregory John Casamento <greg_casamento@yahoo.com>
|
2004-11-16 19:19 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* GormClassPanelController.[hm]: Added method browserAction:. Changed
|
* GormClassPanelController.[hm]: Added method browserAction:. Changed
|
||||||
|
|
|
@ -1,15 +1,40 @@
|
||||||
|
#/* GormColorsPref.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003 Free Software Foundation, Inc.
|
||||||
|
*
|
||||||
|
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
* Date: 1999, 2003
|
||||||
|
*
|
||||||
|
* This file is part of GNUstep.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef INCLUDED_GormColorsPref_h
|
#ifndef INCLUDED_GormColorsPref_h
|
||||||
#define INCLUDED_GormColorsPref_h
|
#define INCLUDED_GormColorsPref_h
|
||||||
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
#include <Foundation/NSArray.h>
|
#include <Foundation/NSArray.h>
|
||||||
|
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
|
||||||
|
@class NSWindow;
|
||||||
|
|
||||||
@interface GormColorsPref : NSObject
|
@interface GormColorsPref : NSObject
|
||||||
{
|
{
|
||||||
id color;
|
id color;
|
||||||
id window;
|
NSWindow *window;
|
||||||
id _view;
|
id _view;
|
||||||
}
|
}
|
||||||
- (NSView *) view;
|
- (NSView *) view;
|
||||||
|
|
|
@ -31,8 +31,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
[color setColor: aColor];
|
[color setColor: aColor];
|
||||||
|
_view = [[window contentView] retain];
|
||||||
_view = [[window contentView] retain];
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +51,9 @@
|
||||||
- (void) ok: (id)sender
|
- (void) ok: (id)sender
|
||||||
{
|
{
|
||||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
[defaults setObject: colorToDict([color color]) forKey: @"GuideColor"];
|
if(sender == color)
|
||||||
|
{
|
||||||
|
[defaults setObject: colorToDict([color color]) forKey: @"GuideColor"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -158,17 +158,10 @@ static BOOL currently_displaying = NO;
|
||||||
{
|
{
|
||||||
NSView *superview;
|
NSView *superview;
|
||||||
|
|
||||||
// put the view into a "view window" if it's a standalone view...
|
// if the view window is not nil, it's a standalone view...
|
||||||
if([_editedObject window] == nil)
|
if(viewWindow != nil)
|
||||||
{
|
{
|
||||||
if(viewWindow == nil)
|
[viewWindow setView: _editedObject];
|
||||||
{
|
|
||||||
viewWindow = [[GormViewWindow alloc] initWithView: _editedObject];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
[viewWindow setView: _editedObject];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
superview = [_editedObject superview];
|
superview = [_editedObject superview];
|
||||||
|
@ -317,6 +310,14 @@ static BOOL currently_displaying = NO;
|
||||||
|
|
||||||
activated = NO;
|
activated = NO;
|
||||||
closed = NO;
|
closed = NO;
|
||||||
|
|
||||||
|
// if this window is nil when the editor is created, we know it's a
|
||||||
|
// standalone view.
|
||||||
|
if([anObject window] == nil)
|
||||||
|
{
|
||||||
|
NSLog(@"#### Stand alone view: %@",_editedObject);
|
||||||
|
viewWindow = [[GormViewWindow alloc] initWithView: _editedObject];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -32,16 +32,16 @@
|
||||||
|
|
||||||
@interface GormViewWindowDelegate : NSObject
|
@interface GormViewWindowDelegate : NSObject
|
||||||
{
|
{
|
||||||
id _view;
|
NSView *_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithView: (id)view;
|
- (id) initWithView: (NSView *)view;
|
||||||
- (void) resize;
|
- (void) resize;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation GormViewWindowDelegate
|
@implementation GormViewWindowDelegate
|
||||||
|
|
||||||
- (id) initWithView: (id)view;
|
- (id) initWithView: (NSView *)view;
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
|
@ -87,6 +87,7 @@
|
||||||
[self setTitle: title];
|
[self setTitle: title];
|
||||||
[self setFrame: NSMakeRect(0,0,400,300) display: YES];
|
[self setFrame: NSMakeRect(0,0,400,300) display: YES];
|
||||||
// [self setBackgroundColor: [NSColor redColor]];
|
// [self setBackgroundColor: [NSColor redColor]];
|
||||||
|
[self setReleasedWhenClosed: NO];
|
||||||
[self setView: view];
|
[self setView: view];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|
Loading…
Reference in a new issue