mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Minor fixes and improvements to controls palette
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@8980 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9f1a48642f
commit
0f1bd6b5bc
3 changed files with 164 additions and 117 deletions
|
@ -1,3 +1,10 @@
|
|||
2001-02-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Palettes/2Control/main.m: Added patch to tidy up and add more
|
||||
objects to the controls palette ... patch by
|
||||
Jason H Clouse <jhclouse@juno.com>
|
||||
Removed bogus code that selected a window when it was made key.
|
||||
|
||||
2001-01-27 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* GormPalettesManager.m: Ensure that palette manager window can never
|
||||
|
|
|
@ -123,13 +123,6 @@ static NSMapTable *docMap = 0;
|
|||
nc = [NSNotificationCenter defaultCenter];
|
||||
|
||||
[objects addObject: anObject];
|
||||
if ([anObject isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSWindowDidBecomeKeyNotification
|
||||
object: anObject];
|
||||
}
|
||||
[self refreshCells];
|
||||
}
|
||||
}
|
||||
|
@ -200,9 +193,6 @@ static NSMapTable *docMap = 0;
|
|||
[document detachObject: selected];
|
||||
if ([selected isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
[nc removeObserver: self
|
||||
name: NSWindowDidBecomeKeyNotification
|
||||
object: selected];
|
||||
[selected close];
|
||||
}
|
||||
[objects removeObjectIdenticalTo: selected];
|
||||
|
@ -298,10 +288,6 @@ static NSMapTable *docMap = 0;
|
|||
id object = [aNotification object];
|
||||
NSString *name = [aNotification name];
|
||||
|
||||
if ([name isEqual: NSWindowDidBecomeKeyNotification] == YES)
|
||||
{
|
||||
[self selectObjects: [NSArray arrayWithObject: object]];
|
||||
}
|
||||
}
|
||||
|
||||
- (id) editedObject
|
||||
|
|
|
@ -1,103 +1,157 @@
|
|||
/* main.m
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard frith-Macdonald (richard@brainstorm.co.uk>
|
||||
Date: 1999
|
||||
|
||||
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.
|
||||
*/
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#include "../../Gorm.h"
|
||||
|
||||
@interface ControlsPalette: IBPalette
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation ControlsPalette
|
||||
- (void) finishInstantiate
|
||||
{
|
||||
NSView *contents;
|
||||
id v;
|
||||
|
||||
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, 272, 192)
|
||||
styleMask: NSBorderlessWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO];
|
||||
contents = [window contentView];
|
||||
|
||||
v = [[NSTextField alloc] initWithFrame: NSMakeRect(10, 160, 80, 20)];
|
||||
[v setStringValue: @"Text"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 125, 80, 20)];
|
||||
[v setButtonType: NSToggleButton];
|
||||
[v setTitle: @"Button"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
#if 0
|
||||
// Need image encoding/decoding
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 90, 80, 20)];
|
||||
[v setButtonType: NSSwitchButton];
|
||||
[v setImagePosition: NSImageRight];
|
||||
[v setTitle: @"Switch"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
#endif
|
||||
|
||||
v = [[NSPopUpButton alloc] initWithFrame: NSMakeRect(10, 60, 80, 20)];
|
||||
[v addItemWithTitle: @"PopUp1"];
|
||||
[v addItemWithTitle: @"PopUp2"];
|
||||
[v addItemWithTitle: @"PopUp3"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
v = [[NSPopUpButton alloc] initWithFrame: NSMakeRect(10, 30, 80, 20)];
|
||||
[v setPullsDown: YES];
|
||||
[v addItemWithTitle: @"PullDown1"];
|
||||
[v addItemWithTitle: @"PullDown2"];
|
||||
[v addItemWithTitle: @"PullDown3"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
v = [[NSTextField alloc] initWithFrame: NSMakeRect(100, 160, 80, 20)];
|
||||
[v setEditable: NO];
|
||||
[v setSelectable: NO];
|
||||
[v setBezeled: NO];
|
||||
[v setAlignment: NSCenterTextAlignment];
|
||||
[v setFont: [NSFont systemFontOfSize: 14.0]];
|
||||
[v setDrawsBackground: NO];
|
||||
[v setStringValue: @"Title"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
v = [[NSSlider alloc] initWithFrame: NSMakeRect(100, 60, 14, 90)];
|
||||
[v setContinuous: YES];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
v = [[NSSlider alloc] initWithFrame: NSMakeRect(100, 20, 90, 14)];
|
||||
[v setContinuous: YES];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
}
|
||||
@end
|
||||
|
||||
/* main.m
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard frith-Macdonald (richard@brainstorm.co.uk>
|
||||
Date: 1999
|
||||
|
||||
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.
|
||||
*/
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <AppKit/AppKit.h>
|
||||
#include "../../Gorm.h"
|
||||
|
||||
@interface ControlsPalette: IBPalette
|
||||
{
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation ControlsPalette
|
||||
- (void) finishInstantiate
|
||||
{
|
||||
NSView *contents;
|
||||
id v;
|
||||
|
||||
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, 272, 192)
|
||||
styleMask: NSBorderlessWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO];
|
||||
contents = [window contentView];
|
||||
|
||||
|
||||
/*******************/
|
||||
/* First Column... */
|
||||
/*******************/
|
||||
|
||||
// Editable text field
|
||||
v = [[NSTextField alloc] initWithFrame: NSMakeRect(10, 127, 56, 21)];
|
||||
[v setStringValue: @"Text"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Push button
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 90, 56, 24)];
|
||||
[v setButtonType: NSToggleButton];
|
||||
[v setTitle: @"Button"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Checkbox
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 60, 56, 16)];
|
||||
[v setButtonType: NSSwitchButton];
|
||||
[v setImagePosition: NSImageRight];
|
||||
[v setTitle: @"Switch"];
|
||||
[v setBordered: NO];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Radio button: default on
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 35, 56, 15)];
|
||||
[v setButtonType: NSRadioButton];
|
||||
[v setImagePosition: NSImageLeft];
|
||||
[v setTitle: @"Radio"];
|
||||
[v setBordered: NO];
|
||||
[v setState: NSOnState];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Radio button: default off
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 17, 56, 15)];
|
||||
[v setButtonType: NSRadioButton];
|
||||
[v setImagePosition: NSImageLeft];
|
||||
[v setTitle: @"Radio"];
|
||||
[v setBordered: NO];
|
||||
[v setState: NSOffState];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
|
||||
/********************/
|
||||
/* Second Column... */
|
||||
/********************/
|
||||
|
||||
// Non editable text field (label)
|
||||
v = [[NSTextField alloc] initWithFrame: NSMakeRect(78, 132, 83, 14)];
|
||||
[v setEditable: NO];
|
||||
[v setSelectable: NO];
|
||||
[v setBezeled: NO];
|
||||
[v setAlignment: NSCenterTextAlignment];
|
||||
[v setFont: [NSFont systemFontOfSize: 14.0]];
|
||||
[v setDrawsBackground: NO];
|
||||
[v setStringValue: @"Title"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Group box
|
||||
v = [[NSBox alloc] initWithFrame: NSMakeRect(78, 78, 53, 44)];
|
||||
[v setTitle: @"Box"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Color well
|
||||
v = [[NSColorWell alloc] initWithFrame: NSMakeRect(78, 42, 53, 30)];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Horizontal Slider
|
||||
v = [[NSSlider alloc] initWithFrame: NSMakeRect(78, 19, 83, 16)];
|
||||
[v setContinuous: YES];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Vertical Slider
|
||||
v = [[NSSlider alloc] initWithFrame: NSMakeRect(145, 42, 16, 76)];
|
||||
[v setContinuous: YES];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
|
||||
/*******************/
|
||||
/* Third Column... */
|
||||
/*******************/
|
||||
|
||||
// Popup button
|
||||
v = [[NSPopUpButton alloc] initWithFrame: NSMakeRect(172, 127, 89, 20)];
|
||||
[v addItemWithTitle: @"Item 1"];
|
||||
[v addItemWithTitle: @"Item 2"];
|
||||
[v addItemWithTitle: @"Item 3"];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// Form
|
||||
v = [[NSForm alloc] initWithFrame: NSMakeRect(172, 81, 87, 45)];
|
||||
[v addEntry: @"Field 1"];
|
||||
[v addEntry: @"Field 2"];
|
||||
[v setEntryWidth: 87];
|
||||
[v setInterlineSpacing: 3];
|
||||
[contents addSubview: v];
|
||||
RELEASE(v);
|
||||
|
||||
// TODO: Add CustomView as soon as I figure out how it works.
|
||||
}
|
||||
@end
|
Loading…
Reference in a new issue