Added new gorm file for Controls palette.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19822 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-08-04 04:52:43 +00:00
parent 042b670b40
commit 8141cbdef1
8 changed files with 193 additions and 148 deletions

View file

@ -1,4 +1,16 @@
2004-08-02 23 Gregory John Casamento <greg_casamento@yahoo.com> 2004-08-04 00:52 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: -[GormDocument setupDefaults:] changed
size of the window for a new palette. If it's too big it
causes problems with event handling in the palettes.
* Palettes/2Controls/GNUmakefile: Added ControlsPalette.gorm
* Palettes/2Controls/main.m: Removed much of the code
from the ControlsPalette class. It's not needed now
that the palette uses a .gorm file.
* Palettes/2Controls/ControlsPalette.gorm: New gui for the
palette.
2004-08-02 23:00 Gregory John Casamento <greg_casamento@yahoo.com>
* GormViewEditor.m: Added stub for initWithCoder just for * GormViewEditor.m: Added stub for initWithCoder just for
completeness. completeness.

View file

@ -2513,7 +2513,6 @@ static NSImage *fileImage = nil;
// the first menu attached becomes the main menu. // the first menu attached becomes the main menu.
[self attachObject: aMenu toParent: nil]; [self attachObject: aMenu toParent: nil];
[[aMenu window] setFrameTopLeftPoint: origin]; [[aMenu window] setFrameTopLeftPoint: origin];
// RETAIN(aMenu);
} }
else if ([type isEqual: @"Inspector"] == YES) else if ([type isEqual: @"Inspector"] == YES)
{ {
@ -2543,7 +2542,6 @@ static NSImage *fileImage = nil;
[aWindow setTitle: _(@"Inspector Window")]; [aWindow setTitle: _(@"Inspector Window")];
[self setName: @"InspectorWin" forObject: aWindow]; [self setName: @"InspectorWin" forObject: aWindow];
[self attachObject: aWindow toParent: nil]; [self attachObject: aWindow toParent: nil];
// RELEASE(aWindow);
} }
else if ([type isEqual: @"Palette"] == YES) else if ([type isEqual: @"Palette"] == YES)
{ {
@ -2554,7 +2552,7 @@ static NSImage *fileImage = nil;
if ([NSWindow respondsToSelector: @selector(allocSubstitute)]) if ([NSWindow respondsToSelector: @selector(allocSubstitute)])
{ {
aWindow = [[NSWindow allocSubstitute] aWindow = [[NSWindow allocSubstitute]
initWithContentRect: NSMakeRect(0,0,272,192) initWithContentRect: NSMakeRect(0,0,272,160)
styleMask: style styleMask: style
backing: NSBackingStoreRetained backing: NSBackingStoreRetained
defer: NO]; defer: NO];
@ -2562,7 +2560,7 @@ static NSImage *fileImage = nil;
else else
{ {
aWindow = [[NSWindow alloc] aWindow = [[NSWindow alloc]
initWithContentRect: NSMakeRect(0,0,272,192) initWithContentRect: NSMakeRect(0,0,272,160)
styleMask: style styleMask: style
backing: NSBackingStoreRetained backing: NSBackingStoreRetained
defer: NO]; defer: NO];
@ -2573,7 +2571,6 @@ static NSImage *fileImage = nil;
[aWindow setTitle: _(@"Palette Window")]; [aWindow setTitle: _(@"Palette Window")];
[self setName: @"PaletteWin" forObject: aWindow]; [self setName: @"PaletteWin" forObject: aWindow];
[self attachObject: aWindow toParent: nil]; [self attachObject: aWindow toParent: nil];
// RELEASE(aWindow);
} }
} }
@ -2583,7 +2580,6 @@ static NSImage *fileImage = nil;
NSString *oldName; NSString *oldName;
NSMutableDictionary *cc = [classManager customClassMap]; NSMutableDictionary *cc = [classManager customClassMap];
NSString *className; NSString *className;
// NSString *nameCopy;
if (object == nil) if (object == nil)
{ {

View file

@ -0,0 +1,159 @@
{
ControlsPalette = {
Actions = (
);
Outlets = (
);
Super = IBPalette;
};
FirstResponder = {
Actions = (
"activateContextHelpMode:",
"alignCenter:",
"alignJustified:",
"alignLeft:",
"alignRight:",
"arrangeInFront:",
"cancel:",
"capitalizeWord:",
"changeColor:",
"checkSpelling:",
"close:",
"complete:",
"copy:",
"copyFont:",
"copyRuler:",
"cut:",
"delete:",
"deleteBackward:",
"deleteForward:",
"deleteToBeginningOfLine:",
"deleteToBeginningOfParagraph:",
"deleteToEndOfLine:",
"deleteToEndOfParagraph:",
"deleteToMark:",
"deleteWordBackward:",
"deleteWordForward:",
"deminiaturize:",
"deselectAll:",
"fax:",
"hide:",
"hideOtherApplications:",
"indent:",
"loosenKerning:",
"lowerBaseline:",
"lowercaseWord:",
"makeKeyAndOrderFront:",
"miniaturize:",
"miniaturizeAll:",
"moveBackward:",
"moveBackwardAndModifySelection:",
"moveDown:",
"moveDownAndModifySelection:",
"moveForward:",
"moveForwardAndModifySelection:",
"moveLeft:",
"moveRight:",
"moveToBeginningOfDocument:",
"moveToBeginningOfLine:",
"moveToBeginningOfParagraph:",
"moveToEndOfDocument:",
"moveToEndOfLine:",
"moveToEndOfParagraph:",
"moveUp:",
"moveUpAndModifySelection:",
"moveWordBackward:",
"moveWordBackwardAndModifySelection:",
"moveWordForward:",
"moveWordForwardAndModifySelection:",
"newDocument:",
"ok:",
"open:",
"openDocument:",
"orderBack:",
"orderFront:",
"orderFrontColorPanel:",
"orderFrontDataLinkPanel:",
"orderFrontHelpPanel:",
"orderFrontStandardAboutPanel:",
"orderFrontStandardInfoPanel:",
"orderOut:",
"pageDown:",
"pageUp:",
"paste:",
"pasteAsPlainText:",
"pasteAsRichText:",
"pasteFont:",
"pasteRuler:",
"performClose:",
"performMiniaturize:",
"performZoom:",
"print:",
"raiseBaseline:",
"redo:",
"revertDocumentToSaved:",
"runPageLayout:",
"runToolbarCustomizationPalette:",
"saveAllDocuments:",
"saveDocument:",
"saveDocumentAs:",
"saveDocumentTo:",
"scrollLineDown:",
"scrollLineUp:",
"scrollPageDown:",
"scrollPageUp:",
"scrollViaScroller:",
"selectAll:",
"selectLine:",
"selectNextKeyView:",
"selectParagraph:",
"selectPreviousKeyView:",
"selectText:",
"selectToMark:",
"selectWord:",
"showContextHelp:",
"showGuessPanel:",
"showHelp:",
"showWindow:",
"stop:",
"subscript:",
"superscript:",
"swapWithMark:",
"takeDoubleValueFrom:",
"takeFloatValueFrom:",
"takeIntValueFrom:",
"takeObjectValueFrom:",
"takeStringValueFrom:",
"terminate:",
"tightenKerning:",
"toggle:",
"toggleContinuousSpellChecking:",
"toggleRuler:",
"toggleToolbarShown:",
"toggleTraditionalCharacterShape:",
"transpose:",
"transposeWords:",
"turnOffKerning:",
"turnOffLigatures:",
"underline:",
"undo:",
"unhide:",
"unhideAllApplications:",
"unscript:",
"uppercaseWord:",
"useAllLigatures:",
"useStandardKerning:",
"useStandardLigatures:",
"yank:",
"zoom:"
);
Super = NSObject;
};
GormNSPopUpButton = {
Actions = (
);
Outlets = (
);
Super = NSPopUpButton;
};
}

Binary file not shown.

Binary file not shown.

View file

@ -44,7 +44,9 @@ PALETTE_NAME = 2Controls
GormNSStepperInspector.gorm \ GormNSStepperInspector.gorm \
GormNSTextFieldInspector.gorm \ GormNSTextFieldInspector.gorm \
GormNSColorWellInspector.gorm \ GormNSColorWellInspector.gorm \
GormNSProgressIndicatorInspector.gorm GormNSProgressIndicatorInspector.gorm \
ControlsPalette.gorm \
palette.table
2Controls_STANDARD_INSTALL = no 2Controls_STANDARD_INSTALL = no

View file

@ -1,9 +1,10 @@
/* main.m /**
main.m
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 2004 Free Software Foundation, Inc.
Author: Richard frith-Macdonald (richard@brainstorm.co.uk> Author: Gregory John Casamento <greg_casamento@yahoo.com>
Date: 1999 Date: 2004
This file is part of GNUstep. This file is part of GNUstep.
@ -21,17 +22,14 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#include <Foundation/Foundation.h>
#include <AppKit/AppKit.h>
#include <InterfaceBuilder/IBPalette.h>
#include "GormCustomView.h"
// @class GormPopUpNSMenu; #include <InterfaceBuilder/IBPalette.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSPopUpButton.h>
@class GormNSPopUpButton; @class GormNSPopUpButton;
@interface ControlsPalette: IBPalette @interface ControlsPalette: IBPalette
{
}
@end @end
@ -41,141 +39,12 @@
NSView *contents; NSView *contents;
id v; id v;
originalWindow = [[NSWindow alloc] initWithContentRect:
NSMakeRect(0, 0, 272, 192)
styleMask: NSBorderlessWindowMask
backing: NSBackingStoreRetained
defer: NO];
contents = [originalWindow contentView]; contents = [originalWindow contentView];
/*******************/
/* First Column... */
/*******************/
// Editable text field
v = [[NSTextField alloc] initWithFrame: NSMakeRect(10, 147, 56, 21)];
[v setEditable: YES];
[v setStringValue: @"Text"];
[contents addSubview: v];
RELEASE(v);
// Push button
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 110, 56, 24)];
[v setButtonType: NSMomentaryPushButton];
[v setTitle: @"Button"];
[contents addSubview: v];
RELEASE(v);
// Checkbox
v = [[NSButton alloc] initWithFrame: NSMakeRect(10, 80, 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, 55, 56, 16)];
[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, 37, 56, 16)];
[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, 152, 83, 18)];
[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, 98, 53, 44)];
[v setTitle: @"Box"];
[contents addSubview: v];
RELEASE(v);
// Color well
v = [[NSColorWell alloc] initWithFrame: NSMakeRect(78, 62, 53, 30)];
[contents addSubview: v];
RELEASE(v);
// Horizontal Slider
v = [[NSSlider alloc] initWithFrame: NSMakeRect(78, 39, 83, 16)];
[v setDoubleValue: 0];
[v setContinuous: YES];
[contents addSubview: v];
RELEASE(v);
// Vertical Slider
v = [[NSSlider alloc] initWithFrame: NSMakeRect(145, 62, 16, 76)];
[v setDoubleValue: 0];
[v setContinuous: YES];
[contents addSubview: v];
RELEASE(v);
// Progress Indicator
v = [[NSProgressIndicator alloc] initWithFrame: NSMakeRect(78, 15, 83, 18)];
[v setIndeterminate: NO];
[v setDoubleValue: 50.];
[contents addSubview: v];
RELEASE(v);
/*******************/
/* Third Column... */
/*******************/
// Popup button
v = [[GormNSPopUpButton alloc] initWithFrame: NSMakeRect(172, 147, 89, 20)]; v = [[GormNSPopUpButton alloc] initWithFrame: NSMakeRect(172, 147, 89, 20)];
[v addItemWithTitle: @"Item 1"]; [v addItemWithTitle: @"Item 1"];
[v addItemWithTitle: @"Item 2"]; [v addItemWithTitle: @"Item 2"];
[v addItemWithTitle: @"Item 3"]; [v addItemWithTitle: @"Item 3"];
[contents addSubview: v]; [contents addSubview: v];
RELEASE(v); RELEASE(v);
// Form
v = [[NSForm alloc] initWithFrame: NSMakeRect(172, 101, 87, 45)];
[v addEntry: @"Field 1"];
[v addEntry: @"Field 2"];
[v setEntryWidth: 87];
[v setInterlineSpacing: 3];
[v setCellSize: NSMakeSize([v cellSize].width, 21)];
[contents addSubview: v];
RELEASE(v);
// Stepper
v = [[NSStepper alloc] initWithFrame: NSMakeRect(172, 76, 16, 23)];
[contents addSubview: v];
RELEASE(v);
// CustomView
v = [[GormCustomView alloc] initWithFrame: NSMakeRect(172, 19, 89, 40)];
[contents addSubview: v];
RELEASE(v);
} }
@end @end

View file

@ -0,0 +1,7 @@
{
NibFile = "ControlsPalette";
Class = "ControlsPalette";
Icon = "ControlsPalette";
ExportClasses = ();
ExportImages = ();
}