mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-23 06:20:47 +00:00
Merge pull request #6 from gnustep/UsabilityEnhancements
Usability enhancements
This commit is contained in:
commit
e0b9fca877
116 changed files with 762 additions and 282 deletions
241
ChangeLog
241
ChangeLog
|
@ -1,3 +1,244 @@
|
|||
2020-01-10 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/ControlsPalette.gorm,
|
||||
* Palettes/2Controls/GormNSFormInspector.gorm: update stepper size.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.h,
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m
|
||||
(_displayObject:resize): move object refresh code here. Use it where
|
||||
it's appropriate.
|
||||
* Palettes/2Controls/GormNSMatrixInspector.gorm: separate dimensions
|
||||
form into 2 for rows and columns; add steppers again.
|
||||
* Palettes/2Controls/GormButtonEditor.m
|
||||
(gormTitleRectForFrame:inView:): initialize `titleRect` to supress
|
||||
compiler warning.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m: ehnanced
|
||||
redrawing of object after dimension changes.
|
||||
* Palettes/2Controls/GormNSBoxInspector.gorm: ticks to offset sliders
|
||||
were added; "Stop on ticks only" set.
|
||||
|
||||
2020-01-09 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m: use ok: on
|
||||
editing finish of textfields objects.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m:(ok:): update window
|
||||
content view on object's dimensions changes.
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m (ok:): removed unused
|
||||
code.
|
||||
* Palettes/2Controls/GormNSButtonInspector.gorm/objects.gorm:
|
||||
added missed "Disclosure Round" bezel type to popup button.
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m
|
||||
(buttonTypeForObject:): use NSMomentaryPushInButton for "Momentary Push" type.
|
||||
(rever:): use tag to select button type.
|
||||
|
||||
2020-01-08 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m:
|
||||
fixed "Momentary Light" button type value.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m (ok:): preserve tag
|
||||
and title of cells on "Match Prototype" button click.
|
||||
* Palettes/3Containers/GormTableViewAttributesInspector.m: apply changes
|
||||
only after editing has end.
|
||||
|
||||
2020-01-06 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Gorm.m: Inspector's shortcuts now work across the application.
|
||||
|
||||
2020-01-05 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/3Containers/GormNSTableViewInspector.gorm:
|
||||
tiny fix of inspector position.
|
||||
* Palettes/4Data/GormNSDateFormatterInspector.gorm,
|
||||
* Palettes/4Data/GormNSNumberFormatterInspector.gorm:
|
||||
fixed size and positions of UI elements.
|
||||
* Palettes/2Controls/ControlsPalette.m (willInspectObject:):
|
||||
create "Prototype" mode only if selected object's prototype exists.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m (ok:):
|
||||
fixed "Match Prototype" action - make cells as copy of prototype,
|
||||
select first cell.
|
||||
* GormCore/GormInspectorsManager.m (setCurrentInspector:): get width
|
||||
from Inspector's minSize when new minSize is about to be set.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m (revert:):
|
||||
update object in prototype matrix.
|
||||
* Palettes/2Controls/GormMatrixAttributesInspector.m (ok:): implemented
|
||||
"Match Prototype" button action - recreates object's cells.
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m (ok:),
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m (revert:): adopt
|
||||
methods to be usable for objects with prototype. This inspector can be
|
||||
called in "Prototype" mode.
|
||||
* Palettes/2Controls/ControlsPalette.m: implement adding "Prototype"
|
||||
mode to Inspector's popup button for objects with prototype available
|
||||
(mainly NSMatrix).
|
||||
* Palettes/2Controls/GormNSMatrixInspector.gorm: reestablish connection
|
||||
to action for "Match Prototype" button.
|
||||
* Palettes/2Controls/GormNSButtonInspector.gorm: set enabled and not
|
||||
selected state "Bordered" button.
|
||||
|
||||
2020-01-04 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* English.lproj/GormConnectionInspector.gorm: fixed window size to prevent
|
||||
inspector panel resizing while switching from the other standard-sized
|
||||
inspectors.
|
||||
* Palettes/4Data/GormNSComboBoxInspector.gorm: fixed sizes and positions
|
||||
of elements.
|
||||
* GormCore/GormInspectorsManager.m (setCurrentInspector:): increase
|
||||
height of inspector panel frame if inspector taller then previous;
|
||||
set minimum size accordingly.
|
||||
* Palettes/2Controls/GormNSMatrixInspector.gorm: made inspector content taller
|
||||
to look better and as a test case for change in GorInspectorManager.
|
||||
|
||||
2019-12-27 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* GormCore/GormConnectionInspector.m (ok:): return on problem with making
|
||||
connection, don't mark document as edited; update "Outlets" browser after
|
||||
makeing changes to connections - updates "connected" image on selected
|
||||
outlet.
|
||||
* Palettes/2Controls/GormNSBoxInspector.gorm,
|
||||
* Palettes/2Controls/GormNSButtonInspector.gorm,
|
||||
* Palettes/2Controls/GormNSCellInspector.gorm,
|
||||
* Palettes/2Controls/GormNSColorWellInspector.gorm,
|
||||
* Palettes/2Controls/GormNSMatrixInspector.gorm,
|
||||
* Palettes/2Controls/GormNSPopUpButtonInspector.gorm,
|
||||
* Palettes/2Controls/GormNSProgressIndicatorInspector.gorm,
|
||||
* Palettes/2Controls/GormNSSliderInspector.gorm,
|
||||
* Palettes/2Controls/GormNSStepperInspector.gorm,
|
||||
* Palettes/2Controls/GormNSTextFieldInspector.gorm:
|
||||
sizing and positions fixes.
|
||||
|
||||
2019-12-27 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormNSFormInspector.gorm:
|
||||
sizes and positions cleanup and fix.
|
||||
* Palettes/3Containers/GormNSBrowserInspector.gorm:
|
||||
fixed initial first responder.
|
||||
* Palettes/1Windows/GormNSWindowSizeInspector.gorm:
|
||||
fixed initial first responder.
|
||||
* Palettes/1Windows/GormDrawerAttributesInspector.gorm:
|
||||
fixed autosizing.
|
||||
* English.lproj/GormObjectInspector.gorm: fixed initial first responder
|
||||
setting.
|
||||
* English.lproj/GormScrollViewAttributesInspector.gorm: fixed default
|
||||
background color.
|
||||
* English.lproj/GormConnectionInspector.gorm: fixed initial first
|
||||
responder setting.
|
||||
* English.lproj/GormClassInspector.gorm,
|
||||
* English.lproj/GormClassPanel.gorm,
|
||||
* English.lproj/GormScrollViewAttributesInspector.gorm,
|
||||
* English.lproj/GormSetName.gorm,
|
||||
* English.lproj/GormSoundInspector.gorm,
|
||||
* Palettes/4Data/GormNSImageViewInspector.gorm,
|
||||
* Palettes/4Data/GormNSTextViewInspector.gorm: sizing and positioning
|
||||
fixes.
|
||||
* Palettes/3Containers/GormNSTableColumnInspector.gorm: fixed textfields
|
||||
height.
|
||||
* GormCore/GormConnectionInspector.m: use custom cell class for "Outlets"
|
||||
browser to draw dimple image on connected outlets.
|
||||
* Palettes/3Containers/GormNSTableColumnSizeInspector.gorm: adjust sizing
|
||||
and position of elements.
|
||||
* Palettes/3Containers/GormTableColumnSizeInspector.m: apply changes only
|
||||
after editing has end.
|
||||
* Palettes/3Containers/inspectors.m: added missed method to return table
|
||||
column sizer class.
|
||||
|
||||
2019-12-26 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/3Containers/GormNSTableViewInspector.gorm: fxed sizing and
|
||||
positioning; rearrange inspector elements.
|
||||
* Palettes/3Containers/GormNSTableColumnInspector.gorm: fxed sizing and
|
||||
positioning; rearrange inspector elements.
|
||||
* Palettes/3Containers/GormNSBrowserInspector.gorm/objects.gorm: fixed
|
||||
vertical offset of option butttons.
|
||||
* Palettes/3Containers/GormBrowserAttributesInspector.m (ok:): reduce
|
||||
number of digits of fraction part to 2.
|
||||
* Palettes/3Containers/GormNSBrowserInspector.gorm: fixed sizing and
|
||||
postioning; remove delegate from textfields - attribute is set only after
|
||||
user finished editing (pressed Return or Tab key).
|
||||
* Palettes/1Windows:
|
||||
Window Attributes Inspecor:
|
||||
- Fixed size, postion and autosizing of elements.
|
||||
- "Autosave Name" form was moved into "Window Size Inspector".
|
||||
- "Minwindow Icon Name": removed clear button, form converted into
|
||||
texfield.
|
||||
Window Size Inspector:
|
||||
- "Size" form was splitted into 2 forms to place them horizontally.
|
||||
- "Size" group was renamed into "Frame".
|
||||
- "Autosave Name" form was added and converted into textfield.
|
||||
- Fixed size, postion and autosizing of elements.
|
||||
NOTE: "Autosave Name" field is not saved into model file - is not encoded?
|
||||
* Palettes/2Controls/GotmNSBoxInspector.gorm: minor fixes.
|
||||
* Palettes/2Controls/GormButtonInspector.gorm: recreate broken "Type"
|
||||
popup button.
|
||||
* Palettes/2Controls/GormButtonAttributesInspector.m (ok:): set "Key:"
|
||||
textfield value to after selecting popup button items.
|
||||
|
||||
2019-12-23 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/GormNSBoxInspector.gorm: adjust size and positions
|
||||
of elements.
|
||||
* Menu Item Inspector: changed size and positions of UI elements;
|
||||
redesigned key equivalent selection - user can specify either character
|
||||
in text field or special(function) key from popup button; added check for
|
||||
length of key equivalent - only 1 character length allowed.
|
||||
* Palettes/2Controls: return code for NSPopUpButton adding
|
||||
programmatically into palette.
|
||||
|
||||
2019-12-23 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Palettes/2Controls/ControlsPalette.gorm: adjust some controls position
|
||||
slightly.
|
||||
* Palettes/0Menus/GormMenuAttributesInspector.gorm: fixed positioning
|
||||
and autosizing.
|
||||
* English.lproj/GormConnectionInspector.gorm: adjust splitview height
|
||||
after last change.
|
||||
* GormCore/GormInspectorsManager.m (setCurrentInspector:): do not
|
||||
resize inspector panel on inspector change.
|
||||
* Fixed guideline on/off menu item handling after rearrangement.
|
||||
* GormCore/GormPalettesManager.m (resizeWithOldSuperviewSize:): new
|
||||
method. Fixes correct placement of palette view on panel resize.
|
||||
(init): disable auroresizing of dragView.
|
||||
* GormCore/GormPalettesManager.m (loadPalette): commented out code that
|
||||
leads to issues with scrolling (although, code supposed to fix issues
|
||||
with scrolling :().
|
||||
* GormCore/GormPalettesManager.m (init): autohide scroller of selection
|
||||
ScrollView.
|
||||
* Palettes/3Containers/ContainersPalette.m: fixed typo.
|
||||
* Palette Panel: set window title from original window title of selected
|
||||
palette; window titles were added/fixed for palettes.
|
||||
* GormCore/GormPalettesManager.m (init): made dragView is not
|
||||
autoresizable to omit problems with palettes visibility.
|
||||
* Palettes/4Data/DataPalette.m (finishInstantiate): ScrollView was made
|
||||
not resizable; move controls in right column slightly to the right.
|
||||
* Palettes/2Controls/ControlsPalette.m (finishInstantiate) do not add
|
||||
popup button - it's already in model file of palette.
|
||||
* Controls Palette: minor fixes to controls position and size.
|
||||
* Menus Palette: adjust position of menu image centered in dragged view.
|
||||
* GormPalettesManager: palettes selection icons now display selection
|
||||
with white color of selected icon background; removed arrows from
|
||||
scroller; icons are replaced to make selection color visible.
|
||||
|
||||
2019-12-21 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Rearrangement of main menu items:
|
||||
- "Layout" renamed into "Format";
|
||||
- "Font" submenu was added into "Format";
|
||||
- "Group" and "Page Layout" were moved into "Format";
|
||||
- shortcuts 'p' and 'i' were removed from "Palletes..." and
|
||||
"Inspector..." because it's standard shortcuts for "Italic" and "Print"
|
||||
menu actions;
|
||||
* ViewSizeInspector: fixed size, position and autosizing properties.
|
||||
* CustomClassInspector: fixed size, position and autosizing properties.
|
||||
* ConnectionInspector: removed horizontal scroller from "Outlets" browser;
|
||||
adjusted split view frame.
|
||||
* DummyInspector: change text to "Not Applicable" and font size to 18.
|
||||
* CustomClassInspector: autosizing fixes.
|
||||
* ImageInspector: use MSImageView from palette instead of CustomView;
|
||||
autosizing fixes.
|
||||
* ControlsPalette: rearrange controls.
|
||||
* PalettePanel: fixed size and autosize attributes (model file is not
|
||||
used yet).
|
||||
* ObjectInspector: fixed size, position, autosize
|
||||
* NSSplitViewInspector: fixed size, position, autosize; refuse first
|
||||
responder on matrix cells.
|
||||
|
||||
2019-07-26 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Add .gitignore.
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21
Gorm.m
21
Gorm.m
|
@ -74,6 +74,23 @@
|
|||
return [[NSDocumentController sharedDocumentController] currentDocument];
|
||||
}
|
||||
|
||||
/*
|
||||
NSApplication override to make Inspector's shortcuts available globally
|
||||
*/
|
||||
- (void) sendEvent: (NSEvent *)theEvent
|
||||
{
|
||||
if ([theEvent type] == NSKeyDown)
|
||||
{
|
||||
NSPanel *inspector = [[self inspectorsManager] panel];
|
||||
if ([inspector performKeyEquivalent: theEvent] != NO)
|
||||
{
|
||||
[inspector orderFront: self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
[super sendEvent: theEvent];
|
||||
}
|
||||
|
||||
/*
|
||||
NSApp
|
||||
*/
|
||||
|
@ -757,12 +774,12 @@
|
|||
object:nil];
|
||||
if ( [guideLineMenuItem tag] == 0 )
|
||||
{
|
||||
[guideLineMenuItem setTitle:_(@"Enable GuideLine")];
|
||||
[guideLineMenuItem setTitle:_(@"Turn GuideLine On")];
|
||||
[guideLineMenuItem setTag:1];
|
||||
}
|
||||
else if ( [guideLineMenuItem tag] == 1)
|
||||
{
|
||||
[guideLineMenuItem setTitle:_(@"Disable GuideLine")];
|
||||
[guideLineMenuItem setTitle:_(@"Turn GuideLine Off")];
|
||||
[guideLineMenuItem setTag:0];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,59 @@
|
|||
#include "GormPrivate.h"
|
||||
#include "GormConnectionInspector.h"
|
||||
|
||||
@interface GormConnectionCell : NSBrowserCell
|
||||
{
|
||||
BOOL isOutletConnected;
|
||||
}
|
||||
@end
|
||||
@implementation GormConnectionCell : NSBrowserCell
|
||||
|
||||
- (void) setIsOutletConnected:(BOOL)yn
|
||||
{
|
||||
isOutletConnected = yn;
|
||||
}
|
||||
|
||||
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView *)controlView
|
||||
{
|
||||
if (isOutletConnected != NO)
|
||||
{
|
||||
NSImage *dimple_image = [NSImage imageNamed: @"common_Dimple"];
|
||||
NSRect title_rect = cellFrame;
|
||||
NSRect imgRect;
|
||||
|
||||
if ([self isHighlighted] != NO)
|
||||
{
|
||||
[[self highlightColorInView: controlView] setFill];
|
||||
NSRectFill(cellFrame);
|
||||
}
|
||||
|
||||
imgRect.size = [dimple_image size];
|
||||
imgRect.origin.x = MAX(NSMaxX(title_rect) - imgRect.size.width - 4.0, 0.);
|
||||
imgRect.origin.y = MAX(NSMidY(title_rect) - (imgRect.size.height/2.), 0.);
|
||||
|
||||
title_rect.size.width -= imgRect.size.width + 8;
|
||||
[super drawInteriorWithFrame: title_rect inView: controlView];
|
||||
|
||||
if (controlView != nil)
|
||||
{
|
||||
imgRect = [controlView centerScanRect: imgRect];
|
||||
}
|
||||
|
||||
[dimple_image drawInRect: imgRect
|
||||
fromRect: NSZeroRect
|
||||
operation: NSCompositeSourceOver
|
||||
fraction: 1.0
|
||||
respectFlipped: YES
|
||||
hints: nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
[super drawInteriorWithFrame: cellFrame inView: controlView];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation GormConnectionInspector
|
||||
|
||||
- (id) init
|
||||
|
@ -64,6 +117,7 @@
|
|||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
[newBrowser setCellClass: [GormConnectionCell class]];
|
||||
[newBrowser setDoubleAction: @selector(ok:)];
|
||||
}
|
||||
|
||||
|
@ -334,6 +388,7 @@ selectCellWithString: (NSString*)title
|
|||
atRow: (NSInteger)row
|
||||
column: (NSInteger)col
|
||||
{
|
||||
[aCell setRefusesFirstResponder: YES];
|
||||
if (sender == newBrowser)
|
||||
{
|
||||
NSString *name;
|
||||
|
@ -353,6 +408,14 @@ selectCellWithString: (NSString*)title
|
|||
[aCell setLeaf: YES];
|
||||
}
|
||||
[aCell setEnabled: YES];
|
||||
|
||||
// Draws dimple for connected outlets
|
||||
for (id conn in connectors) {
|
||||
if ([name isEqualToString: [conn label]]) {
|
||||
[aCell setIsOutletConnected: YES];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -432,6 +495,7 @@ selectCellWithString: (NSString*)title
|
|||
NSRunAlertPanel(_(@"Problem making connection"),
|
||||
_(@"Please select a valid destination."),
|
||||
_(@"OK"), nil, nil, nil);
|
||||
return;
|
||||
}
|
||||
else if ([connectors containsObject: currentConnector] == YES)
|
||||
{
|
||||
|
@ -483,6 +547,11 @@ selectCellWithString: (NSString*)title
|
|||
[oldBrowser setPath: path];
|
||||
}
|
||||
|
||||
// Update image marker in "Outlets" browser
|
||||
NSString *newPath = [newBrowser path];
|
||||
[newBrowser loadColumnZero];
|
||||
[newBrowser setPath:newPath];
|
||||
|
||||
// mark as edited.
|
||||
[super ok: sender];
|
||||
[self updateButtons];
|
||||
|
|
|
@ -271,14 +271,14 @@
|
|||
- (void) setCurrentInspector: (id)anObj
|
||||
{
|
||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
|
||||
unsigned count = [selection count];
|
||||
id obj = [selection lastObject];
|
||||
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
|
||||
NSView *newView = nil;
|
||||
NSView *oldView = nil;
|
||||
NSString *newInspector = nil;
|
||||
NSInteger tag = 0;
|
||||
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
|
||||
unsigned count = [selection count];
|
||||
id obj = [selection lastObject];
|
||||
id<IBDocuments> document = [(id<IB>)NSApp activeDocument];
|
||||
NSView *newView = nil;
|
||||
NSView *oldView = nil;
|
||||
NSString *newInspector = nil;
|
||||
NSInteger tag = 0;
|
||||
|
||||
if (anObj != self)
|
||||
{
|
||||
|
@ -390,9 +390,9 @@
|
|||
newView = [[inspector window] contentView];
|
||||
if (newView != nil && newView != oldView)
|
||||
{
|
||||
id initialResponder = [[inspector window] initialFirstResponder];
|
||||
NSView *outer = [panel contentView];
|
||||
NSRect rect = [panel frame];
|
||||
id initialResponder = [[inspector window] initialFirstResponder];
|
||||
NSView *outer = [panel contentView];
|
||||
NSRect rect = [panel frame];
|
||||
/*
|
||||
We should compute the delta between the heights of the old inspector view
|
||||
and the new one. The delta will be used to compute the size of the inspector
|
||||
|
@ -401,10 +401,14 @@
|
|||
*/
|
||||
CGFloat delta = [newView frame].size.height - [oldView frame].size.height;
|
||||
|
||||
rect.size.height = rect.size.height + delta;
|
||||
rect.origin.y = [panel frame].origin.y - delta;
|
||||
// [panel setContentSize: rect.size];
|
||||
[panel setFrame: rect display: YES];
|
||||
rect.size.height += delta;
|
||||
if (delta > 0)
|
||||
{
|
||||
rect.origin.y = [panel frame].origin.y - delta;
|
||||
[panel setFrame: rect display: YES];
|
||||
}
|
||||
rect.size.width = [panel minSize].width;
|
||||
[panel setMinSize: rect.size];
|
||||
|
||||
rect = [outer bounds];
|
||||
|
||||
|
@ -463,14 +467,15 @@
|
|||
* Make the inspector view the correct size for the viewable panel,
|
||||
* and set the frame size for the new contents before adding them.
|
||||
*/
|
||||
[inspectorView setFrame: rect];
|
||||
rect.origin = NSZeroPoint;
|
||||
[newView setFrame: rect];
|
||||
// [inspectorView setFrame: rect];
|
||||
// rect.origin = NSZeroPoint;
|
||||
// [newView setFrame: rect];
|
||||
|
||||
RETAIN(oldView);
|
||||
[inspectorView setContentView: newView];
|
||||
[[prevInspector window] setContentView: oldView];
|
||||
[outer setNeedsDisplay: YES];
|
||||
// RELEASE(oldView);
|
||||
RELEASE(oldView);
|
||||
|
||||
/* Set the default First responder to the new View */
|
||||
if ( initialResponder )
|
||||
|
|
|
@ -45,6 +45,14 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
for (NSCell *cell in [orientation cells])
|
||||
{
|
||||
[cell setRefusesFirstResponder: YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _getValuesFromObject
|
||||
{
|
||||
BOOL state = [(NSSplitView *)object isVertical];
|
||||
|
|
|
@ -99,6 +99,16 @@ static NSImage *dragImage = nil;
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) resizeWithOldSuperviewSize: (NSSize)oldSize
|
||||
{
|
||||
NSSize newSize = [[self superview] frame].size;
|
||||
NSRect frame = [self frame];
|
||||
|
||||
frame.origin.x -= floorf((oldSize.width - newSize.width) / 2);
|
||||
frame.origin.y -= floorf((oldSize.height - newSize.height) / 2);
|
||||
[self setFrameOrigin: frame.origin];
|
||||
}
|
||||
|
||||
/*
|
||||
* Dragging source protocol implementation
|
||||
*/
|
||||
|
@ -297,8 +307,8 @@ static NSImage *dragImage = nil;
|
|||
NSArray *array;
|
||||
NSRect contentRect = {{0, 0}, {272, 266}};
|
||||
NSRect selectionRect = {{0, 0}, {52, 52}};
|
||||
NSRect scrollRect = {{0, 192}, {272, 74}};
|
||||
NSRect dragRect = {{0, 0}, {272, 192}};
|
||||
NSRect scrollRect = {{-2, 192}, {276, 76}};
|
||||
NSRect dragRect = {{0, 0}, {272, 200}};
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
||||
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||
NSArray *userPalettes = [defaults arrayForKey: USER_PALETTES];
|
||||
|
@ -322,24 +332,26 @@ static NSImage *dragImage = nil;
|
|||
[scrollView setHasHorizontalScroller: YES];
|
||||
[scrollView setHasVerticalScroller: NO];
|
||||
[scrollView setAutoresizingMask: NSViewMinYMargin | NSViewWidthSizable];
|
||||
[scrollView setBorderType: NSBezelBorder];
|
||||
[scrollView setBorderType: NSGrooveBorder];
|
||||
[[scrollView horizontalScroller] setArrowsPosition: NSScrollerArrowsNone];
|
||||
[scrollView setAutohidesScrollers: YES];
|
||||
|
||||
selectionView = [[NSMatrix alloc] initWithFrame: selectionRect
|
||||
mode: NSRadioModeMatrix
|
||||
cellClass: [NSImageCell class]
|
||||
cellClass: [NSButtonCell class]
|
||||
numberOfRows: 1
|
||||
numberOfColumns: 0];
|
||||
[selectionView setTarget: self];
|
||||
[selectionView setAction: @selector(setCurrentPalette:)];
|
||||
[selectionView setCellSize: NSMakeSize(52,52)];
|
||||
[selectionView setIntercellSpacing: NSMakeSize(0,0)];
|
||||
[selectionView setIntercellSpacing: NSMakeSize(15, 0)];
|
||||
[scrollView setDocumentView: selectionView];
|
||||
RELEASE(selectionView);
|
||||
[[panel contentView] addSubview: scrollView];
|
||||
RELEASE(scrollView);
|
||||
|
||||
dragView = [[GormPaletteView alloc] initWithFrame: dragRect];
|
||||
[dragView setAutoresizingMask: NSViewHeightSizable | NSViewWidthSizable];
|
||||
[dragView setAutoresizingMask: 0];
|
||||
[[panel contentView] addSubview: dragView];
|
||||
RELEASE(dragView);
|
||||
|
||||
|
@ -417,7 +429,7 @@ static NSImage *dragImage = nil;
|
|||
NSArray *exportImages;
|
||||
NSDictionary *subClasses;
|
||||
IBPalette *palette;
|
||||
NSImageCell *cell;
|
||||
NSButtonCell *cell;
|
||||
int col;
|
||||
|
||||
if([self bundlePathIsLoaded: path])
|
||||
|
@ -532,21 +544,22 @@ static NSImage *dragImage = nil;
|
|||
|
||||
// Resize the window appropriately so that we don't have issues
|
||||
// with scrolling.
|
||||
if([window styleMask] & NSBorderlessWindowMask)
|
||||
{
|
||||
[window setFrame: NSMakeRect(0,0,272,160) display: NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
[window setFrame: NSMakeRect(0,0,272,192) display: NO];
|
||||
}
|
||||
// if([window styleMask] & NSBorderlessWindowMask)
|
||||
// {
|
||||
// [window setFrame: NSMakeRect(0,0,272,160) display: NO];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// [window setFrame: NSMakeRect(0,0,272,224) display: NO];
|
||||
// }
|
||||
|
||||
[palettes addObject: palette];
|
||||
[selectionView addColumn];
|
||||
[[palette paletteIcon] setBackgroundColor: [selectionView backgroundColor]];
|
||||
col = [selectionView numberOfColumns] - 1;
|
||||
cell = [selectionView cellAtRow: 0 column: col];
|
||||
[cell setImageFrameStyle: NSImageFrameButton];
|
||||
[cell setButtonType: NSOnOffButton];
|
||||
[cell setRefusesFirstResponder: YES];
|
||||
[cell setImage: [palette paletteIcon]];
|
||||
[selectionView sizeToCells];
|
||||
[selectionView selectCellAtRow: 0 column: col];
|
||||
|
@ -647,8 +660,7 @@ static NSImage *dragImage = nil;
|
|||
/*
|
||||
* Set the window title to reflect the palette selection.
|
||||
*/
|
||||
[panel setTitle: [NSString stringWithFormat: @"Palettes (%@)",
|
||||
[palette className]]];
|
||||
[panel setTitle: [[palette originalWindow] title]];
|
||||
|
||||
/*
|
||||
* Move the views from their original window into our drag view.
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -17,7 +17,8 @@
|
|||
ctrlBtn,
|
||||
shiftBtn,
|
||||
cmdBtn,
|
||||
keyPopup
|
||||
keyPopup,
|
||||
keyType
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include <InterfaceBuilder/InterfaceBuilder.h>
|
||||
|
||||
@class NSTextField, NSPopUpButton;
|
||||
@class NSTextField, NSPopUpButton, NSMatrix;
|
||||
|
||||
@interface GormMenuItemAttributesInspector : IBInspector
|
||||
{
|
||||
|
@ -44,6 +44,7 @@
|
|||
NSTextField *shortCut;
|
||||
NSTextField *tagText;
|
||||
NSPopUpButton *keyPopup;
|
||||
NSMatrix *keyType;
|
||||
id altBtn;
|
||||
id ctrlBtn;
|
||||
id shiftBtn;
|
||||
|
|
|
@ -65,6 +65,14 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
for (NSCell *cell in [keyType cells])
|
||||
{
|
||||
[cell setRefusesFirstResponder: YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
RELEASE(upString);
|
||||
|
@ -74,7 +82,7 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) revert : (id)sender
|
||||
- (void) revert: (id)sender
|
||||
{
|
||||
unsigned int flags = [object keyEquivalentModifierMask];
|
||||
NSString *key = VSTR([object keyEquivalent]);
|
||||
|
@ -83,10 +91,9 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
return;
|
||||
|
||||
[titleText setStringValue: VSTR([object title])];
|
||||
[shortCut setStringValue: key];
|
||||
|
||||
[tagText setIntValue: [object tag]];
|
||||
|
||||
[shortCut setEnabled: NO];
|
||||
if([key isEqualToString: @"\n"])
|
||||
{
|
||||
[keyPopup selectItemAtIndex: 1];
|
||||
|
@ -121,7 +128,11 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
}
|
||||
else
|
||||
{
|
||||
[keyPopup selectItem: nil];
|
||||
[keyPopup selectItemAtIndex: 0];
|
||||
[keyPopup setEnabled: NO];
|
||||
[keyType selectCellWithTag: 0];
|
||||
[shortCut setEnabled: YES];
|
||||
[shortCut setStringValue: key];
|
||||
}
|
||||
|
||||
// key modifier mask...
|
||||
|
@ -147,7 +158,66 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
}
|
||||
}
|
||||
|
||||
-(void) ok: (id) sender
|
||||
- (void) _setFunctionKeyEquivalent
|
||||
{
|
||||
unsigned int tag = [[keyPopup selectedItem] tag];
|
||||
switch(tag)
|
||||
{
|
||||
case 0: // none
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
}
|
||||
break;
|
||||
case 1: // return
|
||||
{
|
||||
[object setKeyEquivalent: @"\n"];
|
||||
}
|
||||
break;
|
||||
case 2: // delete
|
||||
{
|
||||
[object setKeyEquivalent: @"\b"];
|
||||
}
|
||||
break;
|
||||
case 3: // escape
|
||||
{
|
||||
[object setKeyEquivalent: @"\E"];
|
||||
}
|
||||
break;
|
||||
case 4: // tab
|
||||
{
|
||||
[object setKeyEquivalent: @"\t"];
|
||||
}
|
||||
break;
|
||||
case 5: // up
|
||||
{
|
||||
[object setKeyEquivalent: upString];
|
||||
}
|
||||
break;
|
||||
case 6: // down
|
||||
{
|
||||
[object setKeyEquivalent: dnString];
|
||||
}
|
||||
break;
|
||||
case 7: // left
|
||||
{
|
||||
[object setKeyEquivalent: ltString];
|
||||
}
|
||||
break;
|
||||
case 8: // right
|
||||
{
|
||||
[object setKeyEquivalent: rtString];
|
||||
}
|
||||
break;
|
||||
default: // should never happen..
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
NSLog(@"This shouldn't happen.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
-(void) ok: (id)sender
|
||||
{
|
||||
if (sender == titleText)
|
||||
{
|
||||
|
@ -155,7 +225,14 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
}
|
||||
if (sender == shortCut)
|
||||
{
|
||||
[object setKeyEquivalent:[[shortCut stringValue] stringByTrimmingSpaces]];
|
||||
NSString *keyEq = [shortCut stringValue];
|
||||
if ([keyEq length] > 1)
|
||||
{
|
||||
keyEq = [NSString stringWithFormat:@"%c", [keyEq characterAtIndex: 0]];
|
||||
[shortCut setStringValue: keyEq];
|
||||
NSBeep();
|
||||
}
|
||||
[object setKeyEquivalent:[keyEq stringByTrimmingSpaces]];
|
||||
}
|
||||
if (sender == tagText)
|
||||
{
|
||||
|
@ -163,61 +240,25 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
}
|
||||
else if (sender == keyPopup)
|
||||
{
|
||||
unsigned int tag = [[keyPopup selectedItem] tag];
|
||||
switch(tag)
|
||||
{
|
||||
case 0: // none
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
}
|
||||
break;
|
||||
case 1: // return
|
||||
{
|
||||
[object setKeyEquivalent: @"\n"];
|
||||
}
|
||||
break;
|
||||
case 2: // delete
|
||||
{
|
||||
[object setKeyEquivalent: @"\b"];
|
||||
}
|
||||
break;
|
||||
case 3: // escape
|
||||
{
|
||||
[object setKeyEquivalent: @"\E"];
|
||||
}
|
||||
break;
|
||||
case 4: // tab
|
||||
{
|
||||
[object setKeyEquivalent: @"\t"];
|
||||
}
|
||||
break;
|
||||
case 5: // up
|
||||
{
|
||||
[object setKeyEquivalent: upString];
|
||||
}
|
||||
break;
|
||||
case 6: // down
|
||||
{
|
||||
[object setKeyEquivalent: dnString];
|
||||
}
|
||||
break;
|
||||
case 7: // left
|
||||
{
|
||||
[object setKeyEquivalent: ltString];
|
||||
}
|
||||
break;
|
||||
case 8: // right
|
||||
{
|
||||
[object setKeyEquivalent: rtString];
|
||||
}
|
||||
break;
|
||||
default: // should never happen..
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
NSLog(@"This shouldn't happen.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
[self _setFunctionKeyEquivalent];
|
||||
}
|
||||
else if (sender == keyType)
|
||||
{
|
||||
switch ([[keyType selectedCell] tag])
|
||||
{
|
||||
case 0:
|
||||
[keyPopup selectItemWithTag: 0];
|
||||
[keyPopup setEnabled: NO];
|
||||
[shortCut setEnabled: YES];
|
||||
[object setKeyEquivalent:[[shortCut stringValue] stringByTrimmingSpaces]];
|
||||
break;
|
||||
case 1:
|
||||
// [shortCut setStringValue: @""];
|
||||
[shortCut setEnabled: NO];
|
||||
[keyPopup setEnabled: YES];
|
||||
[self _setFunctionKeyEquivalent];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (sender == altBtn)
|
||||
{
|
||||
|
@ -279,7 +320,7 @@ const unichar rt[]={NSRightArrowFunctionKey};
|
|||
[super ok:sender];
|
||||
}
|
||||
|
||||
- (void)controlTextDidChange:(NSNotification *)aNotification
|
||||
- (void) controlTextDidChange: (NSNotification *)aNotification
|
||||
{
|
||||
[self ok: [aNotification object]];
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
styleMask: NSBorderlessWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO];
|
||||
[originalWindow setTitle: @"Menus"];
|
||||
contents = [originalWindow contentView];
|
||||
|
||||
|
||||
|
@ -555,7 +556,7 @@
|
|||
* A whole new menu...
|
||||
*/
|
||||
menu = [[GormMenuMaker alloc] init];
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(148,6,48,48)];
|
||||
v = [[NSButton alloc] initWithFrame: NSMakeRect(115,0,48,48)];
|
||||
[v setBordered: NO];
|
||||
[v setImage: dragImage];
|
||||
[v setImagePosition: NSImageOverlaps];
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -6,8 +6,7 @@
|
|||
Outlets = (
|
||||
backingMatrix,
|
||||
titleForm,
|
||||
iconNameForm,
|
||||
clearButton,
|
||||
iconNameField,
|
||||
colorWell,
|
||||
releaseButton,
|
||||
hideButton,
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -11,7 +11,9 @@
|
|||
left,
|
||||
maxForm,
|
||||
right,
|
||||
top
|
||||
top,
|
||||
originForm,
|
||||
autosaveName
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -63,9 +63,7 @@
|
|||
/*Background Color */
|
||||
NSColorWell *colorWell;
|
||||
/* Miniaturized Window Icon */
|
||||
NSForm *iconNameForm;
|
||||
NSButton *clearButton;
|
||||
NSForm *autosaveName;
|
||||
NSForm *iconNameField;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -63,10 +63,6 @@
|
|||
[object setTitle: [[sender cellAtIndex: 0] stringValue] ];
|
||||
}
|
||||
/* title */
|
||||
else if (sender == autosaveName)
|
||||
{
|
||||
[object setFrameAutosaveName: [[sender cellAtIndex: 0] stringValue] ];
|
||||
}
|
||||
/* backing Type */
|
||||
else if (sender == backingMatrix)
|
||||
{
|
||||
|
@ -149,9 +145,9 @@
|
|||
}
|
||||
|
||||
/* icon name */
|
||||
else if (sender == iconNameForm)
|
||||
else if (sender == iconNameField)
|
||||
{
|
||||
NSString *string = [[sender cellAtIndex: 0] stringValue];
|
||||
NSString *string = [sender stringValue];
|
||||
NSImage *image;
|
||||
/* the clearButton is disabled if the form is empty, enabled otherwise */
|
||||
// This allows the user to set the icon, if they wish, for the mini window.
|
||||
|
@ -160,23 +156,13 @@
|
|||
{
|
||||
image = [NSImage imageNamed: string];
|
||||
[object setMiniwindowImage: image];
|
||||
[clearButton setEnabled:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
// use the default, if the string is empty.
|
||||
[object setMiniwindowImage: nil];
|
||||
[clearButton setEnabled:NO];
|
||||
|
||||
}
|
||||
}
|
||||
/* clear the iconNameForm from clearButton */
|
||||
else if (sender == clearButton)
|
||||
{
|
||||
[[iconNameForm cellAtIndex: 0] setStringValue: nil];
|
||||
[object setMiniwindowImage: nil];
|
||||
[clearButton setEnabled:NO];
|
||||
}
|
||||
|
||||
[super ok: sender];
|
||||
}
|
||||
|
@ -195,9 +181,6 @@
|
|||
/* Title */
|
||||
[[titleForm cellAtIndex: 0] setStringValue: [object title] ];
|
||||
|
||||
// Autosave name
|
||||
[[autosaveName cellAtIndex: 0] setStringValue: [object frameAutosaveName] ];
|
||||
|
||||
/* Backing */
|
||||
[backingMatrix selectCellWithTag: [object backingType] ];
|
||||
|
||||
|
@ -216,15 +199,8 @@
|
|||
[dynamicDepthButton setState:[object hasDynamicDepthLimit]];
|
||||
|
||||
/* Icon Name */
|
||||
[[iconNameForm cellAtIndex: 0] setStringValue:
|
||||
[[object miniwindowImage] name]];
|
||||
[iconNameField setStringValue: [[object miniwindowImage] name]];
|
||||
|
||||
/* the clearButton is disabled if the form is empty, enabled otherwise */
|
||||
if ( [[object miniwindowImage] name] == nil )
|
||||
[clearButton setEnabled:NO];
|
||||
else
|
||||
[clearButton setEnabled:YES];
|
||||
|
||||
/* background color*/
|
||||
[colorWell setColorWithoutAction: [object backgroundColor]];
|
||||
|
||||
|
|
|
@ -42,7 +42,9 @@
|
|||
|
||||
@interface GormWindowSizeInspector : IBInspector
|
||||
{
|
||||
NSForm *originForm;
|
||||
NSForm *sizeForm;
|
||||
NSForm *autosaveName;
|
||||
NSForm *minForm;
|
||||
NSForm *maxForm;
|
||||
|
||||
|
|
|
@ -105,16 +105,22 @@
|
|||
- (void) ok: (id)sender
|
||||
{
|
||||
/* Size */
|
||||
if (sender == sizeForm)
|
||||
if (sender == sizeForm || sender == originForm)
|
||||
{
|
||||
NSRect rect;
|
||||
rect = NSMakeRect([[sender cellAtIndex: 0] floatValue],
|
||||
[[sender cellAtIndex: 1] floatValue],
|
||||
[[sender cellAtIndex: 2] floatValue],
|
||||
[[sender cellAtIndex: 3] floatValue]);
|
||||
rect = NSMakeRect([[originForm cellAtIndex: 0] floatValue],
|
||||
[[originForm cellAtIndex: 1] floatValue],
|
||||
[[sizeForm cellAtIndex: 0] floatValue],
|
||||
[[sizeForm cellAtIndex: 1] floatValue]);
|
||||
|
||||
[object setFrame: rect display: YES];
|
||||
}
|
||||
/* Autosave Name */
|
||||
else if (sender == autosaveName)
|
||||
{
|
||||
// TODO: is not saved yet (not encoded by object?)
|
||||
[object setFrameAutosaveName: [sender stringValue] ];
|
||||
}
|
||||
/* Min Size */
|
||||
else if (sender == minForm)
|
||||
{
|
||||
|
@ -163,6 +169,7 @@
|
|||
|
||||
// Abort editing of the fields, so that the new values can be
|
||||
// populated.
|
||||
[originForm abortEditing];
|
||||
[sizeForm abortEditing];
|
||||
[minForm abortEditing];
|
||||
[maxForm abortEditing];
|
||||
|
@ -170,10 +177,13 @@
|
|||
mask = [object autoPositionMask];
|
||||
|
||||
frame = [object frame];
|
||||
[[sizeForm cellAtIndex: 0] setFloatValue: NSMinX(frame)];
|
||||
[[sizeForm cellAtIndex: 1] setFloatValue: NSMinY(frame)];
|
||||
[[sizeForm cellAtIndex: 2] setFloatValue: NSWidth(frame)];
|
||||
[[sizeForm cellAtIndex: 3] setFloatValue: NSHeight(frame)];
|
||||
[[originForm cellAtIndex: 0] setFloatValue: NSMinX(frame)];
|
||||
[[originForm cellAtIndex: 1] setFloatValue: NSMinY(frame)];
|
||||
[[sizeForm cellAtIndex: 0] setFloatValue: NSWidth(frame)];
|
||||
[[sizeForm cellAtIndex: 1] setFloatValue: NSHeight(frame)];
|
||||
|
||||
// Autosave name
|
||||
[autosaveName setStringValue: [object frameAutosaveName] ];
|
||||
|
||||
size = [object minSize];
|
||||
[[minForm cellAtIndex: 0] setFloatValue: size.width];
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
styleMask: NSBorderlessWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO];
|
||||
[originalWindow setTitle: @"Windows"];
|
||||
contents = [originalWindow contentView];
|
||||
|
||||
w = [[GormWindowMaker alloc] init];
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -23,6 +23,7 @@
|
|||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include <InterfaceBuilder/InterfaceBuilder.h>
|
||||
|
@ -41,6 +42,13 @@
|
|||
// Make ourselves a delegate, so that when the sound/image is dragged in,
|
||||
// this code is called...
|
||||
[NSView registerViewResourceDraggingDelegate: self];
|
||||
|
||||
// subscribe to the notification...
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
addObserver: self
|
||||
selector: @selector(willInspectObject:)
|
||||
name: IBWillInspectObjectNotification
|
||||
object: nil];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -58,8 +66,7 @@
|
|||
id v;
|
||||
|
||||
contents = [originalWindow contentView];
|
||||
[contents setFrame: NSMakeRect(0, 0, 272, 192)];
|
||||
v = [[GormNSPopUpButton alloc] initWithFrame: NSMakeRect(118, 139, 87, 22)];
|
||||
v = [[GormNSPopUpButton alloc] initWithFrame: NSMakeRect(73, 159, 70, 22)];
|
||||
[v addItemWithTitle: @"Item 1"];
|
||||
[v addItemWithTitle: @"Item 2"];
|
||||
[v addItemWithTitle: @"Item 3"];
|
||||
|
@ -67,6 +74,22 @@
|
|||
RELEASE(v);
|
||||
}
|
||||
|
||||
- (void) willInspectObject: (NSNotification *)notification
|
||||
{
|
||||
id o = [notification object];
|
||||
if ([o respondsToSelector: @selector(prototype)] && [o prototype])
|
||||
{
|
||||
id prototype = [o prototype];
|
||||
NSString *ident = NSStringFromClass([prototype class]);
|
||||
[[IBInspectorManager sharedInspectorManager]
|
||||
addInspectorModeWithIdentifier: ident
|
||||
forObject: o
|
||||
localizedLabel: _(@"Prototype")
|
||||
inspectorClassName: [prototype inspectorClassName]
|
||||
ordering: -1.0];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Ask if the view accepts the object.
|
||||
*/
|
||||
|
|
Binary file not shown.
|
@ -99,18 +99,18 @@ NSString *rtString = nil;
|
|||
NSDebugLog(@"highlight = %d, stateby = %d",
|
||||
(int)[cell highlightsBy],(int)[cell showsStateBy]);
|
||||
|
||||
type = NSMomentaryPushButton;
|
||||
type = NSMomentaryPushInButton;
|
||||
if (highlight == NSChangeBackgroundCellMask)
|
||||
{
|
||||
if (stateby == NSNoCellMask)
|
||||
type = NSMomentaryLight;
|
||||
type = NSMomentaryLightButton;
|
||||
else
|
||||
type = NSOnOffButton;
|
||||
}
|
||||
else if (highlight == (NSPushInCellMask | NSChangeGrayCellMask))
|
||||
{
|
||||
if (stateby == NSNoCellMask)
|
||||
type = NSMomentaryPushButton;
|
||||
type = NSMomentaryPushInButton;
|
||||
else
|
||||
type = NSPushOnPushOffButton;
|
||||
}
|
||||
|
@ -135,19 +135,26 @@ NSString *rtString = nil;
|
|||
|
||||
- (void) ok: (id) sender
|
||||
{
|
||||
id obj = object;
|
||||
if ([object respondsToSelector: @selector(prototype)])
|
||||
{
|
||||
obj = [object prototype];
|
||||
}
|
||||
|
||||
if (sender == alignMatrix)
|
||||
{
|
||||
[(NSButton *)object setAlignment: (NSTextAlignment)[[sender selectedCell] tag]];
|
||||
[(NSButton *)obj setAlignment: (NSTextAlignment)[[sender selectedCell] tag]];
|
||||
}
|
||||
else if (sender == iconMatrix)
|
||||
{
|
||||
[(NSButton *)object setImagePosition:
|
||||
[(NSButton *)obj setImagePosition:
|
||||
(NSCellImagePosition)[[sender selectedCell] tag]];
|
||||
}
|
||||
else if (sender == keyForm)
|
||||
{
|
||||
[keyEquiv selectItem: nil]; // if the user does his own thing, select the default...
|
||||
[object setKeyEquivalent: [[sender cellAtIndex: 0] stringValue]];
|
||||
// if the user does his own thing, select the default...
|
||||
[keyEquiv selectItemAtIndex: 0];
|
||||
[obj setKeyEquivalent: [[sender cellAtIndex: 0] stringValue]];
|
||||
}
|
||||
else if (sender == keyEquiv)
|
||||
{
|
||||
|
@ -156,52 +163,56 @@ NSString *rtString = nil;
|
|||
{
|
||||
case 0: // none
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
[obj setKeyEquivalent: nil];
|
||||
}
|
||||
break;
|
||||
case 1: // return
|
||||
{
|
||||
[object setKeyEquivalent: @"\r"];
|
||||
[obj setKeyEquivalent: @"\r"];
|
||||
[[keyForm cellAtIndex: 0] setStringValue: @"\\r"];
|
||||
}
|
||||
break;
|
||||
case 2: // delete
|
||||
{
|
||||
[object setKeyEquivalent: @"\b"];
|
||||
[obj setKeyEquivalent: @"\b"];
|
||||
[[keyForm cellAtIndex: 0] setStringValue: @"\\b"];
|
||||
}
|
||||
break;
|
||||
case 3: // escape
|
||||
{
|
||||
[object setKeyEquivalent: @"\E"];
|
||||
[obj setKeyEquivalent: @"\E"];
|
||||
[[keyForm cellAtIndex: 0] setStringValue: @"\\E"];
|
||||
}
|
||||
break;
|
||||
case 4: // tab
|
||||
{
|
||||
[object setKeyEquivalent: @"\t"];
|
||||
[obj setKeyEquivalent: @"\t"];
|
||||
[[keyForm cellAtIndex: 0] setStringValue: @"\\t"];
|
||||
}
|
||||
break;
|
||||
case 5: // up
|
||||
{
|
||||
[object setKeyEquivalent: upString];
|
||||
[obj setKeyEquivalent: upString];
|
||||
}
|
||||
break;
|
||||
case 6: // down
|
||||
{
|
||||
[object setKeyEquivalent: dnString];
|
||||
[obj setKeyEquivalent: dnString];
|
||||
}
|
||||
break;
|
||||
case 7: // left
|
||||
{
|
||||
[object setKeyEquivalent: ltString];
|
||||
[obj setKeyEquivalent: ltString];
|
||||
}
|
||||
break;
|
||||
case 8: // right
|
||||
{
|
||||
[object setKeyEquivalent: rtString];
|
||||
[obj setKeyEquivalent: rtString];
|
||||
}
|
||||
break;
|
||||
default: // should never happen..
|
||||
{
|
||||
[object setKeyEquivalent: nil];
|
||||
[obj setKeyEquivalent: nil];
|
||||
NSLog(@"This shouldn't happen.");
|
||||
}
|
||||
break;
|
||||
|
@ -212,174 +223,184 @@ NSString *rtString = nil;
|
|||
BOOL flag;
|
||||
|
||||
flag = ([[sender cellAtRow: 0 column: 0] state] == NSOnState) ? YES : NO;
|
||||
[object setBordered: flag]; flag = ([[sender cellAtRow: 1 column: 0] state] == NSOnState) ? YES : NO;
|
||||
[object setContinuous: flag];
|
||||
[obj setBordered: flag];
|
||||
flag = ([[sender cellAtRow: 1 column: 0] state] == NSOnState) ? YES : NO;
|
||||
[obj setContinuous: flag];
|
||||
flag = ([[sender cellAtRow: 2 column: 0] state] == NSOnState) ? YES : NO;
|
||||
[object setEnabled: flag];
|
||||
[obj setEnabled: flag];
|
||||
|
||||
[object setState: [[sender cellAtRow: 3 column: 0] state]];
|
||||
[obj setState: [[sender cellAtRow: 3 column: 0] state]];
|
||||
flag = ([[sender cellAtRow: 4 column: 0] state] == NSOnState) ? YES : NO;
|
||||
[object setTransparent: flag];
|
||||
[obj setTransparent: flag];
|
||||
}
|
||||
else if (sender == tagForm)
|
||||
{
|
||||
[(NSButton *)object setTag: [[sender cellAtIndex: 0] intValue]];
|
||||
[(NSButton *)obj setTag: [[sender cellAtIndex: 0] intValue]];
|
||||
}
|
||||
else if (sender == titleForm)
|
||||
{
|
||||
NSString *string;
|
||||
NSImage *image;
|
||||
|
||||
[object setTitle: [[sender cellAtIndex: 0] stringValue]];
|
||||
[object setAlternateTitle: [[sender cellAtIndex: 1] stringValue]];
|
||||
[obj setTitle: [[sender cellAtIndex: 0] stringValue]];
|
||||
[obj setAlternateTitle: [[sender cellAtIndex: 1] stringValue]];
|
||||
|
||||
string = [[sender cellAtIndex: 2] stringValue];
|
||||
if ([string length] > 0)
|
||||
{
|
||||
image = [NSImage imageNamed: string];
|
||||
[object setImage: image];
|
||||
[obj setImage: image];
|
||||
}
|
||||
string = [[sender cellAtIndex: 3] stringValue];
|
||||
if ([string length] > 0)
|
||||
{
|
||||
image = [NSImage imageNamed: string];
|
||||
[object setAlternateImage: image];
|
||||
[obj setAlternateImage: image];
|
||||
}
|
||||
}
|
||||
else if (sender == typeButton)
|
||||
{
|
||||
[object setButtonType: [[sender selectedItem] tag]];
|
||||
[obj setButtonType: [[sender selectedItem] tag]];
|
||||
}
|
||||
else if (sender == bezelButton)
|
||||
{
|
||||
[object setBezelStyle: [[sender selectedItem] tag]];
|
||||
}
|
||||
else if ([sender isKindOfClass: [NSMenuItem class]] )
|
||||
{
|
||||
/*
|
||||
* In old NSPopUpButton implementation we do receive
|
||||
* the selected menu item here. Not the PopUpbutton 'typeButton'
|
||||
* FIXME: Ideally we should also test if the menu item belongs
|
||||
* to the 'type button' control. How to do that?
|
||||
*/
|
||||
[(NSButton *)object setButtonType: [sender tag]];
|
||||
[obj setBezelStyle: [[sender selectedItem] tag]];
|
||||
}
|
||||
else if (sender == altMod)
|
||||
{
|
||||
if([altMod state] == NSOnState)
|
||||
if ([altMod state] == NSOnState)
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] | NSAlternateKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] | NSAlternateKeyMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] & ~NSAlternateKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] & ~NSAlternateKeyMask];
|
||||
}
|
||||
}
|
||||
else if (sender == ctrlMod)
|
||||
{
|
||||
if([ctrlMod state] == NSOnState)
|
||||
if ([ctrlMod state] == NSOnState)
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] | NSControlKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] | NSControlKeyMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] & ~NSControlKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] & ~NSControlKeyMask];
|
||||
}
|
||||
}
|
||||
else if (sender == shiftMod)
|
||||
{
|
||||
if([shiftMod state] == NSOnState)
|
||||
if ([shiftMod state] == NSOnState)
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] | NSShiftKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] | NSShiftKeyMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] & ~NSShiftKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] & ~NSShiftKeyMask];
|
||||
}
|
||||
}
|
||||
else if (sender == cmdMod)
|
||||
{
|
||||
if([cmdMod state] == NSOnState)
|
||||
if ([cmdMod state] == NSOnState)
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] | NSCommandKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] | NSCommandKeyMask];
|
||||
}
|
||||
else
|
||||
{
|
||||
[object setKeyEquivalentModifierMask: [object keyEquivalentModifierMask] & ~NSCommandKeyMask];
|
||||
[obj setKeyEquivalentModifierMask:
|
||||
[obj keyEquivalentModifierMask] & ~NSCommandKeyMask];
|
||||
}
|
||||
}
|
||||
|
||||
if ([object respondsToSelector: @selector(prototype)])
|
||||
{
|
||||
[object setPrototype: obj];
|
||||
}
|
||||
|
||||
[super ok: sender];
|
||||
}
|
||||
|
||||
-(void) revert: (id)sender
|
||||
{
|
||||
NSImage *image;
|
||||
id obj = object;
|
||||
|
||||
if ([object respondsToSelector: @selector(prototype)])
|
||||
{
|
||||
obj = [object prototype];
|
||||
}
|
||||
|
||||
if(sender != nil)
|
||||
{
|
||||
NSString *key = VSTR([object keyEquivalent]);
|
||||
unsigned int flags = [object keyEquivalentModifierMask];
|
||||
NSString *key = VSTR([obj keyEquivalent]);
|
||||
unsigned int flags = [obj keyEquivalentModifierMask];
|
||||
|
||||
[alignMatrix selectCellWithTag: [object alignment]];
|
||||
[iconMatrix selectCellWithTag: [object imagePosition]];
|
||||
[alignMatrix selectCellWithTag: [obj alignment]];
|
||||
[iconMatrix selectCellWithTag: [obj imagePosition]];
|
||||
[[keyForm cellAtIndex: 0] setStringValue: key];
|
||||
|
||||
if([key isEqualToString: @"\r"])
|
||||
if ([key isEqualToString: @"\r"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 1];
|
||||
}
|
||||
else if([key isEqualToString: @"\b"])
|
||||
else if ([key isEqualToString: @"\b"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 2];
|
||||
}
|
||||
else if([key isEqualToString: @"\E"])
|
||||
else if ([key isEqualToString: @"\E"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 3];
|
||||
}
|
||||
else if([key isEqualToString: @"\t"])
|
||||
else if ([key isEqualToString: @"\t"])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 4];
|
||||
}
|
||||
else if([key isEqualToString: upString])
|
||||
else if ([key isEqualToString: upString])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 5];
|
||||
}
|
||||
else if([key isEqualToString: dnString])
|
||||
else if ([key isEqualToString: dnString])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 6];
|
||||
}
|
||||
else if([key isEqualToString: ltString])
|
||||
else if ([key isEqualToString: ltString])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 7];
|
||||
}
|
||||
else if([key isEqualToString: rtString])
|
||||
else if ([key isEqualToString: rtString])
|
||||
{
|
||||
[keyEquiv selectItemAtIndex: 8];
|
||||
}
|
||||
else
|
||||
{
|
||||
[keyEquiv selectItem: nil];
|
||||
[keyEquiv selectItemAtIndex: 0];
|
||||
}
|
||||
|
||||
[optionMatrix deselectAllCells];
|
||||
if ([object isBordered])
|
||||
[optionMatrix selectCellAtRow: 0 column: 0];
|
||||
if ([object isContinuous])
|
||||
[optionMatrix selectCellAtRow: 1 column: 0];
|
||||
if ([object isEnabled])
|
||||
[optionMatrix selectCellAtRow: 2 column: 0];
|
||||
if ([object state] == NSOnState)
|
||||
[optionMatrix selectCellAtRow: 3 column: 0];
|
||||
if ([object isTransparent])
|
||||
[optionMatrix selectCellAtRow: 4 column: 0];
|
||||
if ([obj isBordered])
|
||||
[optionMatrix selectCellAtRow: 0 column: 0];
|
||||
if ([obj isContinuous])
|
||||
[optionMatrix selectCellAtRow: 1 column: 0];
|
||||
if ([obj isEnabled])
|
||||
[optionMatrix selectCellAtRow: 2 column: 0];
|
||||
if ([obj state] == NSOnState)
|
||||
[optionMatrix selectCellAtRow: 3 column: 0];
|
||||
if ([obj isTransparent])
|
||||
[optionMatrix selectCellAtRow: 4 column: 0];
|
||||
|
||||
[[tagForm cellAtIndex: 0] setIntValue: [(NSButton *)obj tag]];
|
||||
|
||||
[[tagForm cellAtIndex: 0] setIntValue: [(NSButton *)object tag]];
|
||||
[[titleForm cellAtIndex: 0] setStringValue: VSTR([obj title])];
|
||||
[[titleForm cellAtIndex: 1] setStringValue: VSTR([obj alternateTitle])];
|
||||
|
||||
[[titleForm cellAtIndex: 0] setStringValue: VSTR([object title])];
|
||||
[[titleForm cellAtIndex: 1] setStringValue: VSTR([object alternateTitle])];
|
||||
|
||||
image = [object image];
|
||||
image = [obj image];
|
||||
if (image != nil)
|
||||
{
|
||||
[[titleForm cellAtIndex: 2] setStringValue: VSTR([image name])];
|
||||
|
@ -389,7 +410,7 @@ NSString *rtString = nil;
|
|||
[[titleForm cellAtIndex: 2] setStringValue: @""];
|
||||
}
|
||||
|
||||
image = [object alternateImage];
|
||||
image = [obj alternateImage];
|
||||
if (image != nil)
|
||||
{
|
||||
[[titleForm cellAtIndex: 3] setStringValue: VSTR([image name])];
|
||||
|
@ -421,12 +442,10 @@ NSString *rtString = nil;
|
|||
[cmdMod setState: NSOnState];
|
||||
}
|
||||
|
||||
[typeButton selectItemAtIndex:
|
||||
[typeButton indexOfItemWithTag:
|
||||
[self buttonTypeForObject: object]]];
|
||||
[typeButton selectItemWithTag: [self buttonTypeForObject: obj]];
|
||||
|
||||
[bezelButton selectItemAtIndex:
|
||||
[bezelButton indexOfItemWithTag: [object bezelStyle]]];
|
||||
[bezelButton indexOfItemWithTag: [obj bezelStyle]]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
NSImage *imageToDisplay;
|
||||
NSRect imageRect;
|
||||
NSString *titleToDisplay;
|
||||
NSRect titleRect;
|
||||
NSRect titleRect = {{0,0},{0,0}};
|
||||
NSSize imageSize = {0, 0};
|
||||
NSSize titleSize = {0, 0};
|
||||
NSColor *backgroundColor = nil;
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
NSMatrix *prototypeMatrix;
|
||||
NSButton *selRectSwitch;
|
||||
NSForm *tagForm;
|
||||
NSForm *dimensionsForm;
|
||||
NSForm *rowsForm;
|
||||
NSForm *colsForm;
|
||||
NSStepper *rowsStepper;
|
||||
NSStepper *colsStepper;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@
|
|||
#include "GormMatrixAttributesInspector.h"
|
||||
|
||||
|
||||
#include <InterfaceBuilder/IBApplicationAdditions.h>
|
||||
#include <GormCore/GormViewKnobs.h>
|
||||
|
||||
@implementation NSMatrix (IBObjectAdditions)
|
||||
- (NSString*) inspectorClassName
|
||||
|
@ -52,6 +54,29 @@
|
|||
NSUInteger rowsStepperValue;
|
||||
NSUInteger colsStepperValue;
|
||||
|
||||
- (void) _displayObject: (id)obj resize: (BOOL)resize
|
||||
{
|
||||
id document = [(id<IB>)NSApp documentForObject: obj];
|
||||
id editor = [document editorForObject: obj create: NO];
|
||||
NSRect eoFrame = [editor frame];
|
||||
|
||||
if (resize == NO)
|
||||
{
|
||||
NSRect rect = [obj frame];
|
||||
NSSize cell = [obj cellSize];
|
||||
NSSize inter = [obj intercellSpacing];
|
||||
cell.width = (rect.size.width + inter.width) / colsStepperValue - inter.width;
|
||||
cell.height = (rect.size.height + inter.height) / rowsStepperValue - inter.height;
|
||||
[object setCellSize: cell];
|
||||
}
|
||||
else
|
||||
{
|
||||
[obj sizeToCells];
|
||||
}
|
||||
[obj setNeedsDisplay: YES];
|
||||
[[editor superview] setNeedsDisplayInRect: GormExtBoundsForRect(eoFrame)];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
if ([super init] == nil)
|
||||
|
@ -120,8 +145,25 @@ NSUInteger colsStepperValue;
|
|||
}
|
||||
else if (sender == propagateSwitch)
|
||||
{
|
||||
//Nothing for the moment - must implement Prototype
|
||||
// item in the pull down menu
|
||||
NSButtonCell *cell;
|
||||
NSInteger tag;
|
||||
NSString *title;
|
||||
for (int c = 0; c < [object numberOfColumns]; c++)
|
||||
{
|
||||
for (int r = 0; r < [object numberOfRows]; r++)
|
||||
{
|
||||
cell = [object cellAtRow: r column: c];
|
||||
tag = [cell tag];
|
||||
title = [cell title];
|
||||
cell = [[object prototype] copy];
|
||||
[cell setTag: tag];
|
||||
[cell setTitle: title];
|
||||
[object putCell:cell atRow:r column:c];
|
||||
[cell release];
|
||||
}
|
||||
}
|
||||
[object deselectAllCells];
|
||||
[object selectCellAtRow: 0 column: 0];
|
||||
}
|
||||
else if (sender == selRectSwitch)
|
||||
{
|
||||
|
@ -131,10 +173,10 @@ NSUInteger colsStepperValue;
|
|||
{
|
||||
[object setTag: [[sender cellAtIndex: 0] intValue]];
|
||||
}
|
||||
else if (sender == dimensionsForm)
|
||||
else if (sender == rowsForm || sender == colsForm)
|
||||
{
|
||||
int rows = [[sender cellAtIndex: 0] intValue];
|
||||
int cols = [[sender cellAtIndex: 1] intValue];
|
||||
int rows = [[rowsForm cellAtIndex: 0] intValue];
|
||||
int cols = [[colsForm cellAtIndex: 0] intValue];
|
||||
int num;
|
||||
|
||||
while((num = [object numberOfRows]) != rows)
|
||||
|
@ -160,17 +202,12 @@ NSUInteger colsStepperValue;
|
|||
[object addColumn];
|
||||
}
|
||||
}
|
||||
// [object sizeToCells];
|
||||
[object setNeedsDisplay: YES];
|
||||
[[object superview] setNeedsDisplay: YES];
|
||||
[self _displayObject: object resize: YES];
|
||||
}
|
||||
else if(sender == rowsStepper)
|
||||
{
|
||||
int delta = [sender intValue] - rowsStepperValue;
|
||||
int num = [object numberOfRows];
|
||||
NSRect rect = [object frame];
|
||||
NSSize cell = [object cellSize];
|
||||
NSSize inter = [object intercellSpacing];
|
||||
|
||||
while(delta > 0)
|
||||
{
|
||||
|
@ -184,20 +221,15 @@ NSUInteger colsStepperValue;
|
|||
num--;
|
||||
delta++;
|
||||
}
|
||||
cell.height = (rect.size.height + inter.height) / num - inter.height;
|
||||
[object setCellSize: cell];
|
||||
[[dimensionsForm cellAtIndex: 0] setIntValue: num];
|
||||
[sender setIntValue: rowsStepperValue];
|
||||
[dimensionsForm setNeedsDisplay: YES];
|
||||
[object setNeedsDisplay: YES];
|
||||
[[rowsForm cellAtIndex: 0] setIntValue: num];
|
||||
[sender setIntValue: num];
|
||||
rowsStepperValue = num;
|
||||
[self _displayObject: object resize: YES];
|
||||
}
|
||||
else if(sender == colsStepper)
|
||||
{
|
||||
int delta = [sender intValue] - colsStepperValue;
|
||||
int num = [object numberOfColumns];
|
||||
NSRect rect = [object frame];
|
||||
NSSize cell = [object cellSize];
|
||||
NSSize inter = [object intercellSpacing];
|
||||
|
||||
while(delta > 0)
|
||||
{
|
||||
|
@ -211,12 +243,10 @@ NSUInteger colsStepperValue;
|
|||
num--;
|
||||
delta++;
|
||||
}
|
||||
cell.width = (rect.size.width + inter.width) / num - inter.width;
|
||||
[object setCellSize: cell];
|
||||
[[dimensionsForm cellAtIndex: 1] setIntValue: num];
|
||||
[sender setIntValue: colsStepperValue];
|
||||
[dimensionsForm setNeedsDisplay: YES];
|
||||
[object setNeedsDisplay: YES];
|
||||
[[colsForm cellAtIndex: 0] setIntValue: num];
|
||||
[sender setIntValue: num];
|
||||
colsStepperValue = num;
|
||||
[self _displayObject: object resize: YES];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -229,7 +259,7 @@ NSUInteger colsStepperValue;
|
|||
}
|
||||
else
|
||||
{
|
||||
[prototypeMatrix putCell: [object prototype] atRow:0 column:0];
|
||||
[prototypeMatrix putCell: [object prototype] atRow:0 column:0];
|
||||
}
|
||||
|
||||
[super ok:sender];
|
||||
|
@ -242,7 +272,6 @@ NSUInteger colsStepperValue;
|
|||
if (object == nil)
|
||||
return;
|
||||
|
||||
|
||||
[autosizeSwitch setState:
|
||||
([object autosizesCells]) ? NSOnState : NSOffState];
|
||||
|
||||
|
@ -260,22 +289,31 @@ NSUInteger colsStepperValue;
|
|||
|
||||
[backgroundColorWell setColorWithoutAction: [object backgroundColor]];
|
||||
[drawsBackgroundSwitch setState:
|
||||
([object drawsBackground]) ? NSOnState : NSOffState];
|
||||
([object drawsBackground]) ? NSOnState : NSOffState];
|
||||
|
||||
[modeMatrix selectCellWithTag: [(NSMatrix *)object mode]];
|
||||
|
||||
if ([object prototype] == nil)
|
||||
[prototypeMatrix putCell: [object cellAtRow:0 column:0] atRow:0 column:0];
|
||||
else
|
||||
[prototypeMatrix putCell: [object prototype] atRow:0 column:0];
|
||||
|
||||
[selRectSwitch setState:
|
||||
([object isSelectionByRect]) ? NSOnState : NSOffState];
|
||||
[[tagForm cellAtIndex: 0] setIntValue: [object tag]];
|
||||
[[dimensionsForm cellAtIndex: 0] setIntValue: [object numberOfRows]];
|
||||
[[dimensionsForm cellAtIndex: 1] setIntValue: [object numberOfColumns]];
|
||||
rowsStepperValue = [object numberOfRows];
|
||||
[[rowsForm cellAtIndex: 0] setIntValue: rowsStepperValue];
|
||||
[rowsStepper setIntValue: rowsStepperValue];
|
||||
colsStepperValue = [object numberOfColumns];
|
||||
[[colsForm cellAtIndex: 0] setIntValue: colsStepperValue];
|
||||
[colsStepper setIntValue: colsStepperValue];
|
||||
|
||||
[super revert:sender];
|
||||
}
|
||||
|
||||
|
||||
/* delegate method for tag Form */
|
||||
-(void) controlTextDidChange:(NSNotification*) aNotification
|
||||
- (void) controlTextDidEndEditing: (NSNotification*)aNotification
|
||||
{
|
||||
[self ok:[aNotification object]];
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -13,9 +13,10 @@
|
|||
prototypeMatrix,
|
||||
selRectSwitch,
|
||||
tagForm,
|
||||
dimensionsForm,
|
||||
rowsForm,
|
||||
colsStepper,
|
||||
rowsStepper
|
||||
rowsStepper,
|
||||
colsForm
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -45,7 +45,7 @@
|
|||
@implementation ContainersPalette
|
||||
|
||||
- (void) finishInstantiate
|
||||
{
|
||||
{
|
||||
|
||||
NSView *contents;
|
||||
NSTableView *tv;
|
||||
|
@ -59,6 +59,7 @@
|
|||
styleMask: NSBorderlessWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: NO];
|
||||
[originalWindow setTitle: @"Containers"];
|
||||
contents = [originalWindow contentView];
|
||||
|
||||
/*******************/
|
||||
|
|
Binary file not shown.
|
@ -87,6 +87,9 @@
|
|||
{
|
||||
// TODO: Use stepper..
|
||||
[object setMinColumnWidth: [minColumnWidthField intValue]];
|
||||
[minColumnWidthField setStringValue:
|
||||
[NSString stringWithFormat:@"%.2f",
|
||||
[object minColumnWidth]]];
|
||||
}
|
||||
else if ( sender == maxVisibleColumnsField )
|
||||
{
|
||||
|
@ -116,7 +119,7 @@
|
|||
[[tagForm cellAtIndex:0] setIntValue: [object tag]];
|
||||
|
||||
[minColumnWidthField setStringValue:
|
||||
[NSString stringWithFormat:@"%f",
|
||||
[NSString stringWithFormat:@"%.2f",
|
||||
[object minColumnWidth]]];
|
||||
[maxVisibleColumnsField setStringValue:
|
||||
[NSString stringWithFormat:@"%ld",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"## Comment" = "Do NOT change this file, Gorm maintains it";
|
||||
GormTableViewSizeInspector = {
|
||||
GormTableColumnSizeInspector = {
|
||||
Actions = (
|
||||
);
|
||||
Outlets = (
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue