mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
Removing commented out code. General cleanup of some of the code and documentation improvement. Also added "Autoenable" to the menu inspector.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@17984 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
eb6f3a012b
commit
d23519ef81
25 changed files with 94 additions and 1251 deletions
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
|||
2003-10-28 12:18 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormBoxEditor.m: Removed commented out code.
|
||||
* GormControlEditor.m: same
|
||||
* GormCustomView.m: same
|
||||
* GormFintViewController.m: same
|
||||
* GormGenericEditor.m: same
|
||||
* GormImageEditor.m: same
|
||||
* GormSoundEditor.m: same
|
||||
* GormInternalViewEditor.m: same
|
||||
* GormObjectEditor.m: same
|
||||
* GormMatrixEditor.m: same
|
||||
* GormSplitViewEditor.m: same
|
||||
* GormViewEditor.m: same
|
||||
* GormViewWithContentViewEditor.m: same
|
||||
* GormViewWithSubviewsEditor.m: same
|
||||
* GormInspectorsManager.m: minor cleanup.
|
||||
* GormDocument.m: [GormDocument _selectClass:] removed extra,
|
||||
uneeded RETAIN. [GormDocument detachObject:] RELEASE the
|
||||
object when after it's detached from the document.
|
||||
[GormDocument _indentifierString:] removed extra RETAIN calls.
|
||||
[GormDocument _replaceObjectsWithTemplates:] removed extra RETAIN.
|
||||
* Documentation/Gorm.texi: Updated some of the documentation to reflect
|
||||
recent changes. More planned documentation additions in the future.
|
||||
|
||||
2003-10-25 17:00 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Gorm.m: Added categories for the old templates to allow them
|
||||
|
|
|
@ -63,6 +63,7 @@ Free Software Foundation instead of in the original English.
|
|||
@subtitle Version @value{GORM-VERSION}
|
||||
@subtitle (for use with @samp{gstep-base} version @value{GNUSTEP-VERSION})
|
||||
@author Richard Frith-Macdonald <richard@@brainstorm.co.uk>
|
||||
@author Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1999,2000 Free Software Foundation, Inc.
|
||||
|
@ -276,25 +277,27 @@ This method sets the values currently returned by
|
|||
@cindex preferences
|
||||
@cindex defaults
|
||||
|
||||
Currently (Jan 4 2000) there is no preferences panel.
|
||||
Application defaults are stored in the file `Defaults.plist', so this file
|
||||
determines the default values if they are not overridden.
|
||||
The preferences panel contains a number of use customizable options which can
|
||||
be used to modify the behavior of Gorm.
|
||||
|
||||
The current defaults are -
|
||||
Some of these defaults can be safely modified from the command line by the user.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item SaveAsNib @*
|
||||
If this boolean is set to @samp{YES} then Gorm will save documents with a
|
||||
@samp{.nib} file extension (for NeXT/Apple compatibility), otherwise it will
|
||||
save with a @samp{.gorm} extension.
|
||||
@item OpenNibs @*
|
||||
If this boolean is set to @samp{YES} then Gorm will accept an attempt to open
|
||||
a document with a @samp{.nib} file extension (for NeXT/Apple compatibility),
|
||||
otherwise it will only open documents with a @samp{.gorm} extension.
|
||||
@item PreloadHeaders @*
|
||||
The user can define a set of headers to load when Gorm starts creation of a new .gorm file.
|
||||
This is useful when the user is building a framework or a set of interfaces for a large
|
||||
application.
|
||||
|
||||
@item ShowInspectors @*
|
||||
Controls whether the inspector shows when Gorm is started.
|
||||
|
||||
@item ShowPalettes @*
|
||||
Controls whether the palettes window shows when Gorm is started.
|
||||
|
||||
@item BackupFile @*
|
||||
Determines if the old .gorm is moved to .gorm~ when the modified version is saved.
|
||||
|
||||
NB. While Gorm will attempt to open @samp{.nib} documents, it can't open true
|
||||
NeXT/Apple documents, only ones it has written itsself.
|
||||
@end itemize
|
||||
|
||||
@node Concept Index, , Implementation, Top
|
||||
|
|
469
GormBoxEditor.m
469
GormBoxEditor.m
|
@ -24,11 +24,8 @@
|
|||
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "GormPrivate.h"
|
||||
|
||||
#include "GormBoxEditor.h"
|
||||
|
||||
#include "GormInternalViewEditor.h"
|
||||
|
||||
#define _EO ((NSBox *)_editedObject)
|
||||
|
@ -117,17 +114,11 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) makeSelectionVisible: (BOOL) value
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void) deleteSelection
|
||||
{
|
||||
int i;
|
||||
|
@ -182,7 +173,6 @@
|
|||
|
||||
if (opened == NO)
|
||||
{
|
||||
// NSLog(@"GormBoxEditor not opened");
|
||||
[super mouseDown: theEvent];
|
||||
return;
|
||||
}
|
||||
|
@ -191,14 +181,12 @@
|
|||
if ([[_EO hitTest: [theEvent locationInWindow]]
|
||||
isDescendantOf: contentViewEditor])
|
||||
{
|
||||
// NSLog(@"md %@ descendant of", self);
|
||||
if ([contentViewEditor isOpened] == NO)
|
||||
[contentViewEditor setOpened: YES];
|
||||
[contentViewEditor mouseDown: theEvent];
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"md %@ not descendant of sending to %@", self, _EO);
|
||||
if ([contentViewEditor isOpened] == YES)
|
||||
[contentViewEditor setOpened: NO];
|
||||
|
||||
|
@ -233,464 +221,9 @@
|
|||
object: self];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// the following code did job that is now done by GormInternalViewEditor
|
||||
|
||||
// // are we on the knob of a selected view ?
|
||||
// {
|
||||
// int count = [selection count];
|
||||
// int i;
|
||||
// GormViewEditor *knobView = nil;
|
||||
// IBKnobPosition knob = IBNoneKnobPosition;
|
||||
// NSPoint mouseDownPoint;
|
||||
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// mouseDownPoint = [[[selection objectAtIndex: i] superview]
|
||||
// convertPoint: [theEvent locationInWindow]
|
||||
// fromView: nil];
|
||||
|
||||
// knob = GormKnobHitInRect([[selection objectAtIndex: i] frame],
|
||||
// mouseDownPoint);
|
||||
|
||||
// if (knob != IBNoneKnobPosition)
|
||||
// {
|
||||
// knobView = [selection objectAtIndex: i];
|
||||
// [self selectObjects: [NSMutableArray arrayWithObject: knobView]];
|
||||
// // we should set knobView as the only view selected
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// NSLog(@"md %@ openedSubeditor %@", self, openedSubeditor);
|
||||
// if ( openedSubeditor != nil )
|
||||
// {
|
||||
// mouseDownPoint = [[openedSubeditor superview]
|
||||
// convertPoint: [theEvent locationInWindow]
|
||||
// fromView: nil];
|
||||
|
||||
// NSLog(@"md %@ %@ %@", self, NSStringFromPoint(mouseDownPoint),
|
||||
// NSStringFromRect([openedSubeditor frame]));
|
||||
|
||||
// knob = GormKnobHitInRect([openedSubeditor frame],
|
||||
// mouseDownPoint);
|
||||
// if (knob != IBNoneKnobPosition)
|
||||
// {
|
||||
// NSLog(@"md %@ on knob !", self);
|
||||
// knobView = openedSubeditor;
|
||||
// // we should take back the selection
|
||||
// // we should select openedSubeditor only
|
||||
// [self selectObjects: [NSMutableArray arrayWithObject: knobView]];
|
||||
// [[self window] disableFlushWindow];
|
||||
// [self display];
|
||||
// [[self window] enableFlushWindow];
|
||||
// [[self window] flushWindow];
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// if (knobView != nil)
|
||||
// {
|
||||
// [self handleMouseOnKnob: knob
|
||||
// ofView: knobView
|
||||
// withEvent: theEvent];
|
||||
// // NSLog(@"resize %@", knobView);
|
||||
// [self setNeedsDisplay: YES];
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// {
|
||||
// GormViewEditor *editorView;
|
||||
|
||||
// // get the view we are on
|
||||
// {
|
||||
// NSPoint mouseDownPoint;
|
||||
// NSView *result;
|
||||
|
||||
|
||||
// mouseDownPoint = [self convertPoint: [theEvent locationInWindow]
|
||||
// fromView: nil];
|
||||
|
||||
// result = [_editedObject hitTest: mouseDownPoint];
|
||||
|
||||
|
||||
// NSLog(@"md %@ result %@", self, result);
|
||||
// // we should get a result which is a direct subeditor
|
||||
// {
|
||||
// id temp = result;
|
||||
// GormViewEditor *parent = [document parentEditorForEditor: temp];
|
||||
|
||||
// NSLog(@"md %@ parent %@", self, parent);
|
||||
// while ((temp != nil) && (parent != self) && (temp != self))
|
||||
// {
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
// temp = [temp superview];
|
||||
// while (![temp isKindOfClass: [GormViewEditor class]])
|
||||
// {
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
// temp = [temp superview];
|
||||
// }
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
// parent = [document parentEditorForEditor: temp];
|
||||
// }
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
// if (temp != nil)
|
||||
// {
|
||||
// result = temp;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// NSLog(@"WARNING -- strange case");
|
||||
// result = self;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// if ([result isKindOfClass: [GormViewEditor class]])
|
||||
// {
|
||||
// /*
|
||||
// if (result != self)
|
||||
// {
|
||||
// [self selectObjects: [NSMutableArray arrayWithObject: result]];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// [self selectObjects: [NSMutableArray array]];
|
||||
// }
|
||||
// [[self window] disableFlushWindow];
|
||||
// [self display];
|
||||
// [[self window] enableFlushWindow];
|
||||
// [[self window] flushWindow];
|
||||
// NSLog(@"clicked on %@", result);
|
||||
// */
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// NSLog(@"md %@ result = nil", self);
|
||||
// result = nil;
|
||||
// }
|
||||
|
||||
// editorView = result;
|
||||
// }
|
||||
|
||||
// if (([theEvent clickCount] == 2)
|
||||
// && [editorView respondsToSelector: @selector(canBeOpened)]
|
||||
// && ([editorView canBeOpened] == YES)
|
||||
// && (editorView != self))
|
||||
|
||||
// {
|
||||
// [editorView setOpened: YES];
|
||||
// [self silentlyResetSelection];
|
||||
// openedSubeditor = editorView;
|
||||
// [self setNeedsDisplay: YES];
|
||||
// NSLog(@"md %@ editor should open", self);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// if (editorView != self)
|
||||
// [self handleMouseOnView: editorView
|
||||
// withEvent: theEvent];
|
||||
// else // editorView == self
|
||||
// {
|
||||
// [self selectObjects: [NSMutableArray array]];
|
||||
// [self setNeedsDisplay: YES];
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
/*
|
||||
// are we on a selected view ?
|
||||
{
|
||||
int count = [selection count];
|
||||
int i;
|
||||
BOOL inView = NO;
|
||||
NSPoint mouseDownPoint;
|
||||
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
mouseDownPoint = [[[selection objectAtIndex: i] superview]
|
||||
convertPoint: [theEvent locationInWindow]
|
||||
fromView: nil];
|
||||
|
||||
if ([[[selection objectAtIndex: i] superview]
|
||||
mouse: mouseDownPoint
|
||||
inRect: [[selection objectAtIndex: i] frame]])
|
||||
{
|
||||
inView = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (inView)
|
||||
{
|
||||
NSLog(@"inside %@", [selection objectAtIndex: i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// are we on a view ?
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// - (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
|
||||
// {
|
||||
// NSRect rect = [[_EO contentView] bounds];
|
||||
// NSPoint loc = [sender draggingLocation];
|
||||
// NSPasteboard *dragPb;
|
||||
// NSArray *types;
|
||||
|
||||
// dragPb = [sender draggingPasteboard];
|
||||
// types = [dragPb types];
|
||||
// loc = [[_EO contentView]
|
||||
// convertPoint: loc fromView: nil];
|
||||
|
||||
// if ([types containsObject: GormLinkPboardType] == YES)
|
||||
// {
|
||||
// [NSApp displayConnectionBetween: [NSApp connectSource]
|
||||
// and: _editedObject];
|
||||
// NSLog(@"I said Yes !");
|
||||
// return NSDragOperationLink;
|
||||
// }
|
||||
// if (NSMouseInRect(loc, [[_EO contentView] bounds], NO) == NO)
|
||||
// {
|
||||
// return NSDragOperationNone;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// rect.origin.x += 2;
|
||||
// rect.origin.y += 2;
|
||||
// rect.size.width -= 4;
|
||||
// rect.size.height -= 4;
|
||||
|
||||
// [[_EO contentView] lockFocus];
|
||||
|
||||
// [[NSColor darkGrayColor] set];
|
||||
// NSFrameRectWithWidth(rect, 2);
|
||||
|
||||
// [[_EO contentView] unlockFocus];
|
||||
// [[self window] flushWindow];
|
||||
// return NSDragOperationCopy;
|
||||
// }
|
||||
// }
|
||||
|
||||
// - (void) draggingExited: (id<NSDraggingInfo>)sender
|
||||
// {
|
||||
// NSRect rect = [[_EO contentView] bounds];
|
||||
// rect.origin.x += 2;
|
||||
// rect.origin.y += 2;
|
||||
// rect.size.width -= 4;
|
||||
// rect.size.height -= 4;
|
||||
|
||||
// rect.origin.x --;
|
||||
// rect.size.width ++;
|
||||
// rect.size.height ++;
|
||||
|
||||
// [[self window] disableFlushWindow];
|
||||
// [self displayRect:
|
||||
// [[_EO contentView] convertRect: rect
|
||||
// toView: self]];
|
||||
// [[self window] enableFlushWindow];
|
||||
// [[self window] flushWindow];
|
||||
// }
|
||||
|
||||
// - (unsigned int) draggingUpdated: (id<NSDraggingInfo>)sender
|
||||
// {
|
||||
// NSPoint loc = [sender draggingLocation];
|
||||
// NSRect rect = [[_EO contentView] bounds];
|
||||
// loc = [[_EO contentView]
|
||||
// convertPoint: loc fromView: nil];
|
||||
|
||||
// rect.origin.x += 2;
|
||||
// rect.origin.y += 2;
|
||||
// rect.size.width -= 4;
|
||||
// rect.size.height -= 4;
|
||||
|
||||
// if (NSMouseInRect(loc, [[_EO contentView] bounds], NO) == NO)
|
||||
// {
|
||||
// [[self window] disableFlushWindow];
|
||||
// rect.origin.x --;
|
||||
// rect.size.width ++;
|
||||
// rect.size.height ++;
|
||||
// [self displayRect:
|
||||
// [[_EO contentView] convertRect: rect
|
||||
// toView: self]];
|
||||
// [[self window] enableFlushWindow];
|
||||
// [[self window] flushWindow];
|
||||
// return NSDragOperationNone;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// [[_EO contentView] lockFocus];
|
||||
|
||||
// [[NSColor darkGrayColor] set];
|
||||
// NSFrameRectWithWidth(rect, 2);
|
||||
|
||||
// [[_EO contentView] unlockFocus];
|
||||
// [[self window] flushWindow];
|
||||
// return NSDragOperationCopy;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// - (BOOL) prepareForDragOperation: (id<NSDraggingInfo>)sender
|
||||
// {
|
||||
// NSString *dragType;
|
||||
// NSArray *types;
|
||||
// NSPasteboard *dragPb;
|
||||
|
||||
// NSLog(@"prepareForDragOperation called");
|
||||
|
||||
// dragPb = [sender draggingPasteboard];
|
||||
|
||||
// types = [dragPb types];
|
||||
|
||||
// if ([types containsObject: IBViewPboardType] == YES)
|
||||
// {
|
||||
// dragType = IBViewPboardType;
|
||||
// }
|
||||
// else if ([types containsObject: GormLinkPboardType] == YES)
|
||||
// {
|
||||
// dragType = GormLinkPboardType;
|
||||
// }
|
||||
// else if ([types containsObject: IBFormatterPboardType] == YES)
|
||||
// {
|
||||
// dragType = IBFormatterPboardType;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// dragType = nil;
|
||||
// }
|
||||
|
||||
// if (dragType == IBViewPboardType)
|
||||
// {
|
||||
// /*
|
||||
// * We can accept views dropped anywhere.
|
||||
// */
|
||||
// NSPoint loc = [sender draggingLocation];
|
||||
// loc = [[_EO contentView]
|
||||
// convertPoint: loc fromView: nil];
|
||||
// if (NSMouseInRect(loc, [_EO bounds], NO) == NO)
|
||||
// {
|
||||
// return NO;
|
||||
// }
|
||||
|
||||
// return YES;
|
||||
// }
|
||||
|
||||
// return NO;
|
||||
// }
|
||||
|
||||
// - (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||
// {
|
||||
// NSString *dragType;
|
||||
// NSPasteboard *dragPb;
|
||||
// NSArray *types;
|
||||
|
||||
// dragPb = [sender draggingPasteboard];
|
||||
|
||||
// types = [dragPb types];
|
||||
|
||||
// if ([types containsObject: IBViewPboardType] == YES)
|
||||
// {
|
||||
// dragType = IBViewPboardType;
|
||||
// }
|
||||
// else if ([types containsObject: GormLinkPboardType] == YES)
|
||||
// {
|
||||
// dragType = GormLinkPboardType;
|
||||
// }
|
||||
// else if ([types containsObject: IBFormatterPboardType] == YES)
|
||||
// {
|
||||
// dragType = IBFormatterPboardType;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// dragType = nil;
|
||||
// }
|
||||
|
||||
// if (dragType == IBViewPboardType)
|
||||
// {
|
||||
// NSPoint loc = [sender draggingLocation];
|
||||
// NSArray *views;
|
||||
// // NSArray *array = [NSMutableArray array];
|
||||
// NSEnumerator *enumerator;
|
||||
// NSView *sub;
|
||||
|
||||
// /*
|
||||
// if (opened != YES)
|
||||
// {
|
||||
// NSLog(@"make ourself the editor");
|
||||
// }
|
||||
// else if (openedSubeditor != nil)
|
||||
// {
|
||||
// NSLog(@"close our subeditors");
|
||||
// }
|
||||
// */
|
||||
|
||||
// /*
|
||||
// * Ask the document to get the dragged views from the pasteboard and add
|
||||
// * them to it's collection of known objects.
|
||||
// */
|
||||
// views = [document pasteType: IBViewPboardType
|
||||
// fromPasteboard: dragPb
|
||||
// parent: _EO];
|
||||
// /*
|
||||
// * Now make all the views subviews of ourself, setting their origin to
|
||||
// * be the point at which they were dropped (converted from window
|
||||
// * coordinates to our own coordinates).
|
||||
// */
|
||||
// loc = [[_EO contentView]
|
||||
// convertPoint: loc fromView: nil];
|
||||
// if (NSMouseInRect(loc, [_EO bounds], NO) == NO)
|
||||
// {
|
||||
// // Dropped outside our view frame
|
||||
// NSLog(@"Dropped outside current edit view");
|
||||
// dragType = nil;
|
||||
// return NO;
|
||||
// }
|
||||
// enumerator = [views objectEnumerator];
|
||||
// while ((sub = [enumerator nextObject]) != nil)
|
||||
// {
|
||||
// NSRect rect = [sub frame];
|
||||
|
||||
// rect.origin = [[_EO contentView]
|
||||
// convertPoint: [sender draggedImageLocation]
|
||||
// fromView: nil];
|
||||
// rect.origin.x = (int) rect.origin.x;
|
||||
// rect.origin.y = (int) rect.origin.y;
|
||||
// rect.size.width = (int) rect.size.width;
|
||||
// rect.size.height = (int) rect.size.height;
|
||||
// [sub setFrame: rect];
|
||||
|
||||
// [[_EO contentView] addSubview: sub];
|
||||
|
||||
// [self selectObjects:
|
||||
// [NSArray arrayWithObject:
|
||||
// [document editorForObject: sub
|
||||
// inEditor: self
|
||||
// create: YES]]];
|
||||
// }
|
||||
// // FIXME we should maybe open ourself
|
||||
// }
|
||||
|
||||
// return YES;
|
||||
// }
|
||||
|
||||
|
||||
// - (void) pasteInSelection
|
||||
// {
|
||||
// [self pasteInView: [_EO contentView]];
|
||||
// }
|
||||
|
||||
- (NSArray *)destroyAndListSubviews
|
||||
{
|
||||
if (contentViewEditor)
|
||||
|
|
|
@ -58,15 +58,6 @@
|
|||
|
||||
@implementation GormControlEditor
|
||||
|
||||
|
||||
// - (GormPlacementInfo *) initializeResizingInFrame: (NSView *)view
|
||||
// withKnob: (IBKnobPosition) knob
|
||||
// {
|
||||
// GormPlacementInfo *gip;
|
||||
// gip = [super initializeResizingInFrame: view withKnob: knob];
|
||||
// }
|
||||
|
||||
|
||||
- (void) _altDisplayFrame: (NSRect) frame
|
||||
withPlacementInfo: (GormPlacementInfo*)gpi
|
||||
{
|
||||
|
@ -203,247 +194,12 @@
|
|||
gpi->oldRect.size.height += 2;
|
||||
}
|
||||
|
||||
// - (void) _displayFrameWithHint: (NSRect) frame
|
||||
// withPlacementInfo: (GormPlacementInfo*)gpi
|
||||
// {
|
||||
// float leftOfFrame = NSMinX(frame);
|
||||
// float rightOfFrame = NSMaxX(frame);
|
||||
// float topOfFrame = NSMaxY(frame);
|
||||
// float bottomOfFrame = NSMinY(frame);
|
||||
// int i;
|
||||
// int count;
|
||||
// int lastDistance;
|
||||
// int minimum = 10;
|
||||
// NSMutableArray *bests;
|
||||
// if (gpi->hintInitialized == NO)
|
||||
// {
|
||||
// [self _initializeHintWithInfo: gpi];
|
||||
// }
|
||||
|
||||
// {
|
||||
// if (gpi->firstPass == NO)
|
||||
// [gpi->resizingIn displayRect: gpi->oldRect];
|
||||
// else
|
||||
// gpi->firstPass = NO;
|
||||
// }
|
||||
// {
|
||||
// [gpi->resizingIn setNeedsDisplayInRect: gpi->lastLeftRect];
|
||||
// [[self window] displayIfNeeded];
|
||||
// gpi->lastLeftRect = NSZeroRect;
|
||||
// }
|
||||
// {
|
||||
// [gpi->resizingIn setNeedsDisplayInRect: gpi->lastRightRect];
|
||||
// [[self window] displayIfNeeded];
|
||||
// gpi->lastRightRect = NSZeroRect;
|
||||
// }
|
||||
// {
|
||||
// [gpi->resizingIn setNeedsDisplayInRect: gpi->lastTopRect];
|
||||
// [[self window] displayIfNeeded];
|
||||
// gpi->lastTopRect = NSZeroRect;
|
||||
// }
|
||||
// {
|
||||
// [gpi->resizingIn setNeedsDisplayInRect: gpi->lastBottomRect];
|
||||
// [[self window] displayIfNeeded];
|
||||
// gpi->lastBottomRect = NSZeroRect;
|
||||
// }
|
||||
|
||||
|
||||
// if (gpi->knob == IBTopLeftKnobPosition
|
||||
// || gpi->knob == IBMiddleLeftKnobPosition
|
||||
// || gpi->knob == IBBottomLeftKnobPosition)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// minimum = 6;
|
||||
// count = [gpi->leftHints count];
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// lastDistance = [[gpi->leftHints objectAtIndex: i]
|
||||
// distanceToFrame: frame];
|
||||
// if (lastDistance < minimum)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// [bests addObject: [gpi->leftHints objectAtIndex: i]];
|
||||
// minimum = lastDistance;
|
||||
// }
|
||||
// else if (lastDistance == minimum)
|
||||
// [bests addObject: [gpi->leftHints objectAtIndex: i]];
|
||||
// }
|
||||
|
||||
// count = [bests count];
|
||||
|
||||
|
||||
// if (count >= 1)
|
||||
// {
|
||||
// float start, end, position;
|
||||
// position = [[bests objectAtIndex: 0] position];
|
||||
|
||||
// start = NSMinY(frame);
|
||||
// end = NSMaxY(frame);
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// start = MIN(NSMinY([[bests objectAtIndex: i] frame]), start);
|
||||
// end = MAX(NSMaxY([[bests objectAtIndex: i] frame]), end);
|
||||
// }
|
||||
|
||||
// [[NSColor redColor] set];
|
||||
// NSRectFill(NSMakeRect(position - 1, start, 2, end - start));
|
||||
// gpi->lastLeftRect = NSMakeRect(position - 1, start, 2, end - start);
|
||||
// leftOfFrame = position;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (gpi->knob == IBTopRightKnobPosition
|
||||
// || gpi->knob == IBMiddleRightKnobPosition
|
||||
// || gpi->knob == IBBottomRightKnobPosition)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// minimum = 6;
|
||||
// count = [gpi->rightHints count];
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// lastDistance = [[gpi->rightHints objectAtIndex: i]
|
||||
// distanceToFrame: frame];
|
||||
// if (lastDistance < minimum)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// [bests addObject: [gpi->rightHints objectAtIndex: i]];
|
||||
// minimum = lastDistance;
|
||||
// }
|
||||
// else if (lastDistance == minimum)
|
||||
// [bests addObject: [gpi->rightHints objectAtIndex: i]];
|
||||
// }
|
||||
|
||||
// count = [bests count];
|
||||
|
||||
|
||||
// if (count >= 1)
|
||||
// {
|
||||
// float start, end, position;
|
||||
// position = [[bests objectAtIndex: 0] position];
|
||||
|
||||
// start = NSMinY(frame);
|
||||
// end = NSMaxY(frame);
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// start = MIN(NSMinY([[bests objectAtIndex: i] frame]), start);
|
||||
// end = MAX(NSMaxY([[bests objectAtIndex: i] frame]), end);
|
||||
// }
|
||||
|
||||
// [[NSColor redColor] set];
|
||||
// NSRectFill(NSMakeRect(position - 1, start, 2, end - start));
|
||||
// gpi->lastRightRect = NSMakeRect(position - 1, start, 2, end - start);
|
||||
// rightOfFrame = position;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (gpi->knob == IBTopRightKnobPosition
|
||||
// || gpi->knob == IBTopLeftKnobPosition
|
||||
// || gpi->knob == IBTopMiddleKnobPosition)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// minimum = 6;
|
||||
// count = [gpi->topHints count];
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// lastDistance = [[gpi->topHints objectAtIndex: i]
|
||||
// distanceToFrame: frame];
|
||||
// if (lastDistance < minimum)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// [bests addObject: [gpi->topHints objectAtIndex: i]];
|
||||
// minimum = lastDistance;
|
||||
// }
|
||||
// else if (lastDistance == minimum)
|
||||
// [bests addObject: [gpi->topHints objectAtIndex: i]];
|
||||
// }
|
||||
|
||||
// count = [bests count];
|
||||
|
||||
|
||||
// if (count >= 1)
|
||||
// {
|
||||
// float start, end, position;
|
||||
// position = [[bests objectAtIndex: 0] position];
|
||||
|
||||
// start = NSMinX(frame);
|
||||
// end = NSMaxX(frame);
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// start = MIN(NSMinX([[bests objectAtIndex: i] frame]), start);
|
||||
// end = MAX(NSMaxX([[bests objectAtIndex: i] frame]), end);
|
||||
// }
|
||||
|
||||
// [[NSColor redColor] set];
|
||||
// NSRectFill(NSMakeRect(start, position - 1, end - start, 2));
|
||||
// gpi->lastTopRect = NSMakeRect(start, position - 1, end - start, 2);
|
||||
// topOfFrame = position;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (gpi->knob == IBBottomRightKnobPosition
|
||||
// || gpi->knob == IBBottomLeftKnobPosition
|
||||
// || gpi->knob == IBBottomMiddleKnobPosition)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// minimum = 6;
|
||||
// count = [gpi->bottomHints count];
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// lastDistance = [[gpi->bottomHints objectAtIndex: i]
|
||||
// distanceToFrame: frame];
|
||||
// if (lastDistance < minimum)
|
||||
// {
|
||||
// bests = [NSMutableArray arrayWithCapacity: 4];
|
||||
// [bests addObject: [gpi->bottomHints objectAtIndex: i]];
|
||||
// minimum = lastDistance;
|
||||
// }
|
||||
// else if (lastDistance == minimum)
|
||||
// [bests addObject: [gpi->bottomHints objectAtIndex: i]];
|
||||
// }
|
||||
|
||||
// count = [bests count];
|
||||
|
||||
|
||||
// if (count >= 1)
|
||||
// {
|
||||
// float start, end, position;
|
||||
// position = [[bests objectAtIndex: 0] position];
|
||||
|
||||
// start = NSMinX(frame);
|
||||
// end = NSMaxX(frame);
|
||||
// for ( i = 0; i < count; i++ )
|
||||
// {
|
||||
// start = MIN(NSMinX([[bests objectAtIndex: i] frame]), start);
|
||||
// end = MAX(NSMaxX([[bests objectAtIndex: i] frame]), end);
|
||||
// }
|
||||
|
||||
// [[NSColor redColor] set];
|
||||
// NSRectFill(NSMakeRect(start, position - 1, end - start, 2));
|
||||
// gpi->lastBottomRect = NSMakeRect(start, position - 1, end - start, 2);
|
||||
// bottomOfFrame = position;
|
||||
// }
|
||||
// }
|
||||
|
||||
// gpi->hintFrame = NSMakeRect (leftOfFrame, bottomOfFrame,
|
||||
// rightOfFrame - leftOfFrame,
|
||||
// topOfFrame - bottomOfFrame);
|
||||
|
||||
// GormShowFrameWithKnob(gpi->hintFrame, gpi->knob);
|
||||
// gpi->oldRect = GormExtBoundsForRect(gpi->hintFrame);
|
||||
// gpi->oldRect.origin.x--;
|
||||
// gpi->oldRect.origin.y--;
|
||||
// gpi->oldRect.size.width += 2;
|
||||
// gpi->oldRect.size.height += 2;
|
||||
|
||||
// }
|
||||
|
||||
#undef MIN
|
||||
#undef MAX
|
||||
|
||||
#define MIN(a,b) (a>b?b:a)
|
||||
#define MAX(a,b) (a>b?a:b)
|
||||
|
||||
|
||||
- (void) _displayFrameWithHint: (NSRect) frame
|
||||
withPlacementInfo: (GormPlacementInfo*)gpi
|
||||
{
|
||||
|
@ -805,8 +561,6 @@
|
|||
col = gpi->lastFrame.size.width / cellSize.width;
|
||||
row = gpi->lastFrame.size.height / cellSize.height;
|
||||
|
||||
// NSLog(@"parentEditor %@", we);
|
||||
|
||||
// let's morph into a matrix
|
||||
matrix = [[NSMatrix alloc] initWithFrame: gpi->lastFrame
|
||||
mode: NSRadioModeMatrix
|
||||
|
@ -827,12 +581,10 @@
|
|||
|
||||
[document attachObject: matrix toParent: _EO];
|
||||
|
||||
// NSLog(@"gonna open editor");
|
||||
editor = [document editorForObject: matrix
|
||||
inEditor: parent
|
||||
create: YES];
|
||||
|
||||
// NSLog(@"editor %@", editor);
|
||||
|
||||
[parent selectObjects: [NSArray arrayWithObject: editor]];
|
||||
|
||||
|
@ -886,5 +638,3 @@
|
|||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -63,12 +63,6 @@
|
|||
return [self stringValue];
|
||||
}
|
||||
|
||||
|
||||
// - (Class) classForCoder
|
||||
// {
|
||||
// return [GSCustomView class];
|
||||
// }
|
||||
|
||||
/*
|
||||
* This needs to be coded like a GSNibItem. How do we make sure this
|
||||
* tracks changes in GSNibItem coding?
|
||||
|
@ -116,12 +110,8 @@
|
|||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface GormTestCustomView : GSNibItem <NSCoding>
|
||||
{
|
||||
}
|
||||
|
|
|
@ -244,7 +244,7 @@ static NSImage *classesImage = nil;
|
|||
[[self openEditorForObject: anObject] activate];
|
||||
if ([anObject isKindOfClass: [NSWindow class]] == YES)
|
||||
{
|
||||
// RETAIN(anObject);
|
||||
RETAIN(anObject);
|
||||
[anObject setReleasedWhenClosed: NO];
|
||||
}
|
||||
}
|
||||
|
@ -628,7 +628,6 @@ static NSImage *classesImage = nil;
|
|||
{
|
||||
newClassName = [classManager addClassWithSuperClassName:
|
||||
itemSelected];
|
||||
RETAIN(newClassName);
|
||||
[classesView reloadData];
|
||||
[classesView expandItem: itemSelected];
|
||||
i = [classesView rowForItem: newClassName];
|
||||
|
@ -725,6 +724,8 @@ static NSImage *classesImage = nil;
|
|||
NSMapRemove(objToName, (void*)anObject);
|
||||
RELEASE(name);
|
||||
}
|
||||
|
||||
RELEASE(anObject);
|
||||
}
|
||||
|
||||
- (void) detachObjects: (NSArray*)anArray
|
||||
|
@ -2363,8 +2364,6 @@ static NSImage *classesImage = nil;
|
|||
[self setName: @"NSMenu" forObject: aMenu];
|
||||
[self attachObject: aMenu toParent: nil];
|
||||
[objectsView addObject: aMenu];
|
||||
// RETAIN(aMenu);
|
||||
|
||||
[[aMenu window] setFrameTopLeftPoint:
|
||||
NSMakePoint(1, frame.size.height-200)];
|
||||
RELEASE(aMenu);
|
||||
|
@ -2644,8 +2643,8 @@ static NSImage *classesImage = nil;
|
|||
id customClass = [cm customClassForName: key];
|
||||
id object = [self objectForName: key];
|
||||
NSString *superClass = [cm nonCustomSuperClassOf: customClass];
|
||||
id template = [GSTemplateFactory templateForObject: RETAIN(object)
|
||||
withClassName: RETAIN([customClass copy])
|
||||
id template = [GSTemplateFactory templateForObject: object
|
||||
withClassName: customClass // [customClass copy]
|
||||
withSuperClassName: superClass];
|
||||
|
||||
// if the object is deferrable, then set the flag appropriately.
|
||||
|
@ -3049,8 +3048,6 @@ static NSImage *classesImage = nil;
|
|||
invertedSet];
|
||||
numeric = [NSCharacterSet characterSetWithCharactersInString:
|
||||
@"0123456789"];
|
||||
RETAIN(illegal);
|
||||
RETAIN(numeric);
|
||||
}
|
||||
if (str == nil)
|
||||
{
|
||||
|
|
|
@ -112,25 +112,6 @@ static GormFontViewController *gorm_font_cont = nil;
|
|||
return view;
|
||||
}
|
||||
|
||||
/*
|
||||
- (BOOL) acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL) becomeFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
// delegate methods
|
||||
- (void) changeFont: (id)sender
|
||||
{
|
||||
NSLog(@"change");
|
||||
[fontSelector selectItem: 0];
|
||||
}
|
||||
*/
|
||||
|
||||
- (void) mouseDragged: (NSEvent *)event
|
||||
{
|
||||
// here to make certain we don't crash..
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
if (anObject != nil
|
||||
&& [objects indexOfObjectIdenticalTo: anObject] == NSNotFound)
|
||||
{
|
||||
// NSNotificationCenter *nc;
|
||||
// nc = [NSNotificationCenter defaultCenter];
|
||||
[objects addObject: anObject];
|
||||
[self refreshCells];
|
||||
}
|
||||
|
@ -187,7 +185,6 @@
|
|||
/*
|
||||
* Adjust to image area.
|
||||
*/
|
||||
// rect.size.width -= 15;
|
||||
rect.size.height -= 15;
|
||||
rect = [self convertRect: rect toView: nil];
|
||||
return rect;
|
||||
|
|
|
@ -66,8 +66,6 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
||||
{
|
||||
// if ([types containsObject: IBObjectPboardType] == YES)
|
||||
// return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -83,7 +81,7 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
NSArray *types=[[sender draggingPasteboard] types];
|
||||
unsigned int mask=[sender draggingSourceOperationMask];
|
||||
|
||||
NSLog(@"GormImageEditor draggingEntered mask=%i types=%@",mask,types);
|
||||
NSDebugLLog(@"GormImageEditor draggingEntered mask=%i types=%@",mask,types);
|
||||
|
||||
if ( mask&handled_mask &&
|
||||
([types containsObject: NSFilenamesPboardType] ||
|
||||
|
@ -161,10 +159,6 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
return YES;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- (void) drawSelection
|
||||
{
|
||||
}
|
||||
|
@ -176,8 +170,6 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
|
||||
- (void) handleNotification: (NSNotification*)aNotification
|
||||
{
|
||||
// id object = [aNotification object];
|
||||
// NSString *name = [aNotification name];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -361,13 +353,10 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
|
||||
}
|
||||
|
||||
|
||||
- (void) pasteInSelection
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (unsigned int) draggingSourceOperationMaskForLocal: (BOOL)flag
|
||||
{
|
||||
return NSDragOperationCopy;
|
||||
|
@ -540,6 +529,6 @@ static int handled_mask= NSDragOperationCopy|NSDragOperationGeneric|NSDragOperat
|
|||
|
||||
- (NSString *)inspectorClassName
|
||||
{
|
||||
return @"GormImageInspector"; //[self soundInspectorClassName];
|
||||
return @"GormImageInspector";
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
NSRect popupRect = {{60, 5}, {152, 20}};
|
||||
NSRect selectionRect = {{0, 390}, {IVW, 30}};
|
||||
NSRect inspectorRect = {{0, 0}, {IVW, IVH}};
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
||||
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
||||
|
||||
cache = [NSMutableDictionary new];
|
||||
panel = [[NSPanel alloc] initWithContentRect: contentRect
|
||||
|
@ -617,8 +617,6 @@
|
|||
[popup removeItemAtIndex: 5];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -1256,4 +1254,3 @@ selectCellWithString: (NSString*)title
|
|||
return YES;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
*/
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "GormPrivate.h"
|
||||
|
||||
#include "GormInternalViewEditor.h"
|
||||
|
||||
@class GormEditorToParent;
|
||||
|
@ -90,10 +88,6 @@ static NSImage *horizontalImage;
|
|||
NSEnumerator *enumerator;
|
||||
NSView *sub;
|
||||
id superview = [_editedObject superview];
|
||||
// NSView *superview = [_editedObject superview];
|
||||
|
||||
// NSLog(@"ac %@ %@ %@", self, _editedObject, superview);
|
||||
|
||||
|
||||
[self setFrame: [_editedObject frame]];
|
||||
[self setBounds: [self frame]];
|
||||
|
@ -113,10 +107,6 @@ static NSImage *horizontalImage;
|
|||
[self setFrame: [tabSuperview contentRect]];
|
||||
[self setAutoresizingMask:
|
||||
NSViewWidthSizable | NSViewHeightSizable];
|
||||
// NSLog(@"ac %d %d %d",
|
||||
// [tabSuperview autoresizesSubviews],
|
||||
// [self autoresizesSubviews],
|
||||
// [_editedObject autoresizesSubviews]);
|
||||
}
|
||||
else if ([superview isKindOfClass: [GSWindowView class]])
|
||||
{
|
||||
|
@ -158,10 +148,8 @@ static NSImage *horizontalImage;
|
|||
|
||||
while ((sub = [enumerator nextObject]) != nil)
|
||||
{
|
||||
// NSLog(@"ac %@ editorForObject: %@", self, sub);
|
||||
if ([sub isKindOfClass: [GormViewEditor class]] == NO)
|
||||
{
|
||||
// NSLog(@"ac %@ yes", self);
|
||||
[document editorForObject: sub
|
||||
inEditor: self
|
||||
create: YES];
|
||||
|
@ -173,28 +161,6 @@ static NSImage *horizontalImage;
|
|||
return NO;
|
||||
}
|
||||
|
||||
|
||||
// - (void) close
|
||||
// {
|
||||
// NSEnumerator *enumerator;
|
||||
// GormViewEditor *sub;
|
||||
|
||||
// enumerator = [[NSArray arrayWithArray: [_editedObject subviews]]
|
||||
// objectEnumerator];
|
||||
|
||||
// while ((sub = [enumerator nextObject]) != nil)
|
||||
// {
|
||||
// if ([sub respondsToSelector: @selector(deactivate)] == NO)
|
||||
// {
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// NSLog(@"deactivating, deac %@", sub);
|
||||
// [sub deactivate];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
- (void) deactivate
|
||||
{
|
||||
if (activated == YES)
|
||||
|
@ -212,7 +178,6 @@ static NSImage *horizontalImage;
|
|||
}
|
||||
else if ([superview isKindOfClass: [NSTabView class]])
|
||||
{
|
||||
// NSLog(@"deactivating %@", self);
|
||||
NSTabView *tabSuperview = (NSTabView *) superview;
|
||||
[tabSuperview removeSubview: self];
|
||||
[[tabSuperview selectedTabViewItem]
|
||||
|
@ -249,8 +214,6 @@ static NSImage *horizontalImage;
|
|||
return nil;
|
||||
|
||||
selection = [[NSMutableArray alloc] initWithCapacity: 5];
|
||||
|
||||
|
||||
|
||||
[self registerForDraggedTypes: [NSArray arrayWithObjects:
|
||||
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
|
||||
|
@ -286,22 +249,10 @@ static NSImage *horizontalImage;
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
// - (void) reactivateWithObject: (id) anObject
|
||||
// inDocument: (id<IBDocuments>)aDocument
|
||||
// {
|
||||
// [super reactivateWithObject: anObject
|
||||
// inDocument: aDocument];
|
||||
|
||||
// }
|
||||
|
||||
|
||||
- (void) makeSelectionVisible: (BOOL) value
|
||||
{
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
- (NSArray*) selection
|
||||
{
|
||||
int i;
|
||||
|
@ -341,12 +292,9 @@ static NSImage *horizontalImage;
|
|||
[selection removeObjectAtIndex: i];
|
||||
}
|
||||
|
||||
[self selectObjects: [NSArray array]];
|
||||
|
||||
[self selectObjects: [NSArray array]];
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void) mouseDown: (NSEvent *) theEvent
|
||||
{
|
||||
BOOL onKnob = NO;
|
||||
|
@ -435,7 +383,6 @@ static NSImage *horizontalImage;
|
|||
[self handleMouseOnKnob: knob
|
||||
ofView: knobView
|
||||
withEvent: theEvent];
|
||||
// NSLog(@"resize %@", knobView);
|
||||
[self setNeedsDisplay: YES];
|
||||
return;
|
||||
}
|
||||
|
@ -456,32 +403,21 @@ static NSImage *horizontalImage;
|
|||
|
||||
result = [_editedObject hitTest: mouseDownPoint];
|
||||
|
||||
// NSDebugLog(@"md %@ result %@", self, result);
|
||||
// NSLog(@"_editedObject %@", _editedObject);
|
||||
|
||||
// we should get a result which is a direct subeditor
|
||||
{
|
||||
id temp = result;
|
||||
// int i = 0;
|
||||
|
||||
// NSLog(@"md %@ parent %@", self, parent);
|
||||
if ([temp isKindOfClass: [GormViewEditor class]])
|
||||
theParent = [(GormViewEditor *)temp parent];
|
||||
while ((temp != nil) && (theParent != self) && (temp != self))
|
||||
{
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
temp = [temp superview];
|
||||
while (![temp isKindOfClass: [GormViewEditor class]])
|
||||
{
|
||||
// if (i++ > 100)
|
||||
// sleep(3);
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
temp = [temp superview];
|
||||
}
|
||||
theParent = [(GormViewEditor *)temp parent];
|
||||
// NSLog(@"temp (%@) 's parent is %@", temp, theParent);
|
||||
}
|
||||
// NSLog(@"md %@ temp = %@", self, temp);
|
||||
if (temp != nil)
|
||||
{
|
||||
result = temp;
|
||||
|
@ -517,7 +453,6 @@ static NSImage *horizontalImage;
|
|||
[self silentlyResetSelection];
|
||||
openedSubeditor = (GormViewWithSubviewsEditor *) editorView;
|
||||
[self setNeedsDisplay: YES];
|
||||
// NSLog(@"md %@ editor should open", self);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -528,11 +463,9 @@ static NSImage *horizontalImage;
|
|||
}
|
||||
else // editorView == self
|
||||
{
|
||||
// NSLog(@"editorView == self");
|
||||
NSEvent *e;
|
||||
unsigned eventMask;
|
||||
NSDate *future = [NSDate distantFuture];
|
||||
// BOOL first = YES;
|
||||
NSRect oldRect = NSZeroRect;
|
||||
NSPoint p, oldp;
|
||||
NSRect r = NSZeroRect;
|
||||
|
@ -592,8 +525,6 @@ static NSImage *horizontalImage;
|
|||
|
||||
{
|
||||
NSRect wr;
|
||||
//NSCachedImageRep *tableRep =
|
||||
// [[verticalImage representations]objectAtIndex:0];
|
||||
wr = [self convertRect: r
|
||||
toView: nil];
|
||||
|
||||
|
@ -624,7 +555,6 @@ static NSImage *horizontalImage;
|
|||
NSFrameRect(r);
|
||||
oldRect = r;
|
||||
|
||||
// [[self window] displayIfNeeded];
|
||||
[[self window] enableFlushWindow];
|
||||
|
||||
[[self window] flushWindow];
|
||||
|
@ -694,40 +624,6 @@ static NSImage *horizontalImage;
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// are we on a selected view ?
|
||||
{
|
||||
int count = [selection count];
|
||||
int i;
|
||||
BOOL inView = NO;
|
||||
NSPoint mouseDownPoint;
|
||||
|
||||
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
mouseDownPoint = [[[selection objectAtIndex: i] superview]
|
||||
convertPoint: [theEvent locationInWindow]
|
||||
fromView: nil];
|
||||
|
||||
if ([[[selection objectAtIndex: i] superview]
|
||||
mouse: mouseDownPoint
|
||||
inRect: [[selection objectAtIndex: i] frame]])
|
||||
{
|
||||
inView = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (inView)
|
||||
{
|
||||
NSLog(@"inside %@", [selection objectAtIndex: i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// are we on a view ?
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -859,8 +755,6 @@ static NSImage *horizontalImage;
|
|||
NSArray *types;
|
||||
NSPasteboard *dragPb;
|
||||
|
||||
// NSLog(@"prepareForDragOperation called");
|
||||
|
||||
dragPb = [sender draggingPasteboard];
|
||||
|
||||
types = [dragPb types];
|
||||
|
@ -936,17 +830,6 @@ static NSImage *horizontalImage;
|
|||
NSEnumerator *enumerator;
|
||||
NSView *sub;
|
||||
|
||||
/*
|
||||
if (opened != YES)
|
||||
{
|
||||
NSLog(@"make ourself the editor");
|
||||
}
|
||||
else if (openedSubeditor != nil)
|
||||
{
|
||||
NSLog(@"close our subeditors");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ask the document to get the dragged views from the pasteboard and add
|
||||
* them to it's collection of known objects.
|
||||
|
@ -985,11 +868,9 @@ static NSImage *horizontalImage;
|
|||
|
||||
{
|
||||
id editor;
|
||||
// NSLog(@"sub %@ %@", sub, [sub editorClassName]);
|
||||
editor = [document editorForObject: sub
|
||||
inEditor: self
|
||||
create: YES];
|
||||
// NSLog(@"editor %@", editor);
|
||||
[self selectObjects:
|
||||
[NSArray arrayWithObject: editor]];
|
||||
}
|
||||
|
@ -1000,56 +881,12 @@ static NSImage *horizontalImage;
|
|||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void) pasteInSelection
|
||||
{
|
||||
[self pasteInView: _editedObject];
|
||||
}
|
||||
|
||||
@class GormBoxEditor;
|
||||
|
||||
// - (void) ungroupSelf
|
||||
// {
|
||||
// if ([parent isKindOfClass: [GormBoxEditor class]]
|
||||
// && [[parent parent] isKindOfClass:
|
||||
// [GormViewWithContentViewEditor class]])
|
||||
// {
|
||||
// NSEnumerator *enumerator;
|
||||
// GormViewEditor *subview;
|
||||
// enumerator = [[_editedObject subviews] objectEnumerator];
|
||||
// NSMutableArray *newSelection = [NSMutableArray array];
|
||||
|
||||
// [[parent parent] makeSubeditorResign];
|
||||
|
||||
// while ((subview = [enumerator nextObject]) != nil)
|
||||
// {
|
||||
// id v;
|
||||
// NSRect frame;
|
||||
// v = [subview editedObject];
|
||||
// frame = [v frame];
|
||||
// frame = [[parent parent] convertRect: frame
|
||||
// fromView: _editedObject];
|
||||
// [subview deactivate];
|
||||
|
||||
// [[[parent parent] editedObject] addSubview: v];
|
||||
// [v setFrame: frame];
|
||||
// [subview close];
|
||||
// [newSelection addObject:
|
||||
// [document editorForObject: v
|
||||
// inEditor: [parent parent]
|
||||
// create: YES]];
|
||||
// }
|
||||
// [[parent parent] selectObjects: newSelection];
|
||||
|
||||
// {
|
||||
// id thisBox = [parent editedObject];
|
||||
// [parent close];
|
||||
// [thisBox removeFromSuperview];
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
@class GormSplitViewEditor;
|
||||
|
||||
- (NSArray *)destroyAndListSubviews
|
||||
|
@ -1078,7 +915,6 @@ static NSImage *horizontalImage;
|
|||
[subview deactivate];
|
||||
|
||||
[v setFrame: frame];
|
||||
// [[[parent parent] editedObject] addSubview: v];
|
||||
[newSelection addObject: v];
|
||||
}
|
||||
|
||||
|
@ -1098,5 +934,4 @@ static NSImage *horizontalImage;
|
|||
{
|
||||
[self deleteSelection];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -25,16 +25,13 @@
|
|||
*/
|
||||
|
||||
#include "GormPrivate.h"
|
||||
|
||||
#include "GormViewEditor.h"
|
||||
|
||||
#include "GormMatrixEditor.h"
|
||||
#include "GormViewWithSubviewsEditor.h"
|
||||
#include "GormPlacementInfo.h"
|
||||
|
||||
#define _EO ((NSMatrix*)_editedObject)
|
||||
|
||||
|
||||
@interface GormViewEditor (Private)
|
||||
- (void) _displayFrame: (NSRect) frame
|
||||
withPlacementInfo: (GormPlacementInfo*)gpi;
|
||||
|
@ -73,7 +70,6 @@
|
|||
|
||||
@implementation GormMatrixEditor
|
||||
|
||||
|
||||
- (void) copySelection
|
||||
{
|
||||
if (selected != nil)
|
||||
|
@ -84,7 +80,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
- (void) deleteSelection
|
||||
{
|
||||
NSLog(@"Cannot delete Matrix cell\n");
|
||||
|
@ -385,16 +380,6 @@ static BOOL done_editing;
|
|||
return [NSArray arrayWithObject: selected];
|
||||
}
|
||||
|
||||
// - (unsigned) selectionCount
|
||||
// {
|
||||
// return (selected == nil) ? 0 : 1;
|
||||
// }
|
||||
|
||||
// - (id<IBEditors>) openSubeditorForObject: (id)anObject
|
||||
// {
|
||||
// return nil;
|
||||
// }
|
||||
|
||||
- (BOOL) acceptsTypeFromArray: (NSArray*)types
|
||||
{
|
||||
if ([types containsObject: IBObjectPboardType] == YES)
|
||||
|
@ -402,19 +387,6 @@ static BOOL done_editing;
|
|||
return NO;
|
||||
}
|
||||
|
||||
/*
|
||||
- (void) close
|
||||
{
|
||||
[self deactivate];
|
||||
[self closeSubeditors];
|
||||
}
|
||||
|
||||
- (void) closeSubeditors
|
||||
{
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
- (void) postDraw: (NSRect) rect
|
||||
{
|
||||
if (_displaySelection)
|
||||
|
@ -437,9 +409,6 @@ static BOOL done_editing;
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (NSRect) _constrainedFrame: (NSRect) frame
|
||||
withEvent: (NSEvent *)theEvent
|
||||
andKnob: (IBKnobPosition) knob
|
||||
|
|
|
@ -226,9 +226,6 @@ static NSMapTable *docMap = 0;
|
|||
|
||||
- (void) handleNotification: (NSNotification*)aNotification
|
||||
{
|
||||
// id object = [aNotification object];
|
||||
// NSString *name = [aNotification name];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -455,9 +452,6 @@ static NSMapTable *docMap = 0;
|
|||
return self;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (void) resetObject: (id)anObject
|
||||
{
|
||||
NSString *name = [document nameForObject: anObject];
|
||||
|
@ -472,9 +466,6 @@ static NSMapTable *docMap = 0;
|
|||
[mgr setClassInspector];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ struct _rFlagsType2 {
|
|||
{
|
||||
if ([self isCustom])
|
||||
{
|
||||
NSLog(@"%@ display", self);
|
||||
NSDebugLog(@"%@ display", self);
|
||||
}
|
||||
[super display];
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ struct _rFlagsType2 {
|
|||
{
|
||||
if ([self isCustom])
|
||||
{
|
||||
NSLog(@"%@ displayIfNeeded", self);
|
||||
NSDebugLog(@"%@ displayIfNeeded", self);
|
||||
}
|
||||
[super displayIfNeeded];
|
||||
}
|
||||
|
|
|
@ -66,8 +66,7 @@
|
|||
{
|
||||
NSView *documentView = [_EO documentView];
|
||||
|
||||
NSLog(@"documentView %@", documentView);
|
||||
|
||||
NSDebugLog(@"documentView %@", documentView);
|
||||
documentViewEditor = [document editorForObject: documentView
|
||||
inEditor: self
|
||||
create: YES];
|
||||
|
@ -118,7 +117,6 @@
|
|||
|
||||
if (opened == NO)
|
||||
{
|
||||
// NSLog(@"GormBoxEditor not opened");
|
||||
[super mouseDown: theEvent];
|
||||
return;
|
||||
}
|
||||
|
@ -127,7 +125,6 @@
|
|||
if ([[_EO hitTest: [theEvent locationInWindow]]
|
||||
isDescendantOf: documentViewEditor])
|
||||
{
|
||||
// NSLog(@"md %@ descendant of", self);
|
||||
if (([self isOpened] == YES) && ([documentViewEditor isOpened] == NO))
|
||||
[documentViewEditor setOpened: YES];
|
||||
if ([documentViewEditor isOpened])
|
||||
|
|
|
@ -169,8 +169,6 @@ static NSMapTable *docMap = 0;
|
|||
|
||||
- (void) handleNotification: (NSNotification*)aNotification
|
||||
{
|
||||
// id object = [aNotification object];
|
||||
// NSString *name = [aNotification name];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -243,57 +241,6 @@ static NSMapTable *docMap = 0;
|
|||
[[self window] flushWindow];
|
||||
}
|
||||
|
||||
// - (void) mouseDown: (NSEvent*)theEvent
|
||||
// {
|
||||
// if ([theEvent modifierFlags] & NSControlKeyMask)
|
||||
// {
|
||||
// NSPoint loc = [theEvent locationInWindow];
|
||||
// NSString *name;
|
||||
// int r, c;
|
||||
// int pos;
|
||||
// id obj;
|
||||
|
||||
// loc = [self convertPoint: loc fromView: nil];
|
||||
// [self getRow: &r column: &c forPoint: loc];
|
||||
// pos = r * [self numberOfColumns] + c;
|
||||
// if (pos >= 0 && pos < [objects count])
|
||||
// {
|
||||
// obj = [objects objectAtIndex: pos];
|
||||
// }
|
||||
// if (obj != nil && obj != selected)
|
||||
// {
|
||||
// [self selectObjects: [NSArray arrayWithObject: obj]];
|
||||
// [self makeSelectionVisible: YES];
|
||||
// }
|
||||
|
||||
// /*
|
||||
// name = [document nameForObject: obj];
|
||||
// if ([name isEqualToString: @"NSFirst"] == NO)
|
||||
// {
|
||||
// NSPasteboard *pb;
|
||||
|
||||
// pb = [NSPasteboard pasteboardWithName: NSDragPboard];
|
||||
// [pb declareTypes: [NSArray arrayWithObject: GormLinkPboardType]
|
||||
// owner: self];
|
||||
// [pb setString: name forType: GormLinkPboardType];
|
||||
// [NSApp displayConnectionBetween: obj and: nil];
|
||||
|
||||
// [self dragImage: [NSApp linkImage]
|
||||
// at: loc
|
||||
// offset: NSZeroSize
|
||||
// event: theEvent
|
||||
// pasteboard: pb
|
||||
// source: self
|
||||
// slideBack: YES];
|
||||
// [self makeSelectionVisible: YES];
|
||||
// return;
|
||||
// }
|
||||
// */
|
||||
// }
|
||||
|
||||
// [super mouseDown: theEvent];
|
||||
// }
|
||||
|
||||
- (void) mouseDown: (NSEvent*)theEvent
|
||||
{
|
||||
int row, column;
|
||||
|
@ -458,7 +405,7 @@ static NSMapTable *docMap = 0;
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"Drop with unrecognized type!");
|
||||
NSDebugLog(@"Drop with unrecognized type!");
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
|
@ -545,7 +492,7 @@ static NSMapTable *docMap = 0;
|
|||
NSButtonCell *but = [self cellAtRow: index/cols column: index%cols];
|
||||
NSString *name = [obj soundName];
|
||||
|
||||
NSLog(@"sound name = %@",name);
|
||||
NSDebugLog(@"sound name = %@",name);
|
||||
[but setImage: [obj soundImageForViewer]];
|
||||
[but setTitle: name];
|
||||
[but setShowsStateBy: NSChangeGrayCellMask];
|
||||
|
@ -566,16 +513,8 @@ static NSMapTable *docMap = 0;
|
|||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
||||
// - (void) removeObject: (id)anObject
|
||||
// {
|
||||
// [objects removeObject: anObject];
|
||||
// [self refreshCells];
|
||||
// }
|
||||
|
||||
- (void) resetObject: (id)anObject
|
||||
{
|
||||
// NSString *name = nil; // [document nameForObject: anObject];
|
||||
// GormInspectorsManager *mgr = [(Gorm*)NSApp inspectorsManager];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -73,6 +73,7 @@
|
|||
{
|
||||
RELEASE(_currentSound);
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void) handleNotification: (NSNotification*)aNotification
|
||||
|
@ -94,24 +95,19 @@
|
|||
{
|
||||
if([sndobject isKindOfClass: [GormSound class]])
|
||||
{
|
||||
NSLog(@"Sound inspector notified: %@",sndobject);
|
||||
NSDebugLog(@"Sound inspector notified: %@",sndobject);
|
||||
RELEASE(_currentSound);
|
||||
_currentSound = [[NSSound alloc] initWithContentsOfFile: [sndobject soundPath]
|
||||
byReference: YES];
|
||||
RETAIN(_currentSound);
|
||||
NSLog(@"Loaded sound");
|
||||
NSDebugLog(@"Loaded sound");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
{
|
||||
NSLog(@"Sound inspector is awake");
|
||||
}
|
||||
|
||||
- (void) stop: (id)sender
|
||||
{
|
||||
NSLog(@"Stop");
|
||||
NSDebugLog(@"Stop");
|
||||
[_currentSound stop];
|
||||
}
|
||||
|
||||
|
@ -123,14 +119,13 @@
|
|||
|
||||
- (void) pause: (id)sender
|
||||
{
|
||||
NSLog(@"Pause");
|
||||
NSDebugLog(@"Pause");
|
||||
[_currentSound pause];
|
||||
}
|
||||
|
||||
- (void) record: (id)sender
|
||||
{
|
||||
NSLog(@"Record");
|
||||
NSDebugLog(@"Record");
|
||||
// [_currentSound record];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -23,9 +23,7 @@
|
|||
*/
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "GormPrivate.h"
|
||||
|
||||
#include "GormSplitViewEditor.h"
|
||||
#include "GormInternalViewEditor.h"
|
||||
#include "GormBoxEditor.h"
|
||||
|
@ -187,21 +185,6 @@
|
|||
}
|
||||
else if ([types containsObject: IBViewPboardType] == YES)
|
||||
{
|
||||
/*
|
||||
NSArray *sub = [_EO subviews];
|
||||
int count = [sub count];
|
||||
NSPoint loc = [sender draggingLocation];
|
||||
loc = [_EO
|
||||
convertPoint: loc fromView: nil];
|
||||
|
||||
if ([_EO isVertical])
|
||||
{
|
||||
for ( i = 0; i < count - 1; i++ )
|
||||
{
|
||||
if (i <
|
||||
}
|
||||
}
|
||||
*/
|
||||
return NSDragOperationCopy;
|
||||
}
|
||||
else
|
||||
|
@ -255,7 +238,6 @@
|
|||
BOOL onKnob = NO;
|
||||
NSView *clickedSubview;
|
||||
|
||||
// NSLog(@"in GormSplitViewEditor -mouseDown");
|
||||
{
|
||||
if ([parent respondsToSelector: @selector(selection)] &&
|
||||
[[parent selection] containsObject: _EO])
|
||||
|
@ -280,7 +262,6 @@
|
|||
|
||||
if (opened == NO)
|
||||
{
|
||||
// NSLog(@"not opened");
|
||||
[super mouseDown: theEvent];
|
||||
return;
|
||||
}
|
||||
|
@ -307,24 +288,17 @@
|
|||
else
|
||||
{
|
||||
clickedSubview = nil;
|
||||
// NSLog(@"subs %@", subs);
|
||||
}
|
||||
}
|
||||
|
||||
if (clickedSubview == nil)
|
||||
{
|
||||
// NSLog(@"clickedSubview == nil");
|
||||
if (openedSubeditor)
|
||||
[openedSubeditor deactivate];
|
||||
[_EO mouseDown: theEvent];
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"clickedSubview == %@", clickedSubview);
|
||||
// if ([theEvent clickCount] == 2
|
||||
// && [clickedSubview respondsToSelector: @selector(canBeOpened)]
|
||||
// && ([clickedSubview canBeOpened] == YES)
|
||||
// && (clickedSubview != self))
|
||||
[self selectObjects: [NSArray arrayWithObject: clickedSubview]];
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
|
@ -340,7 +314,6 @@
|
|||
[self setOpenedSubeditor: (GormViewWithSubviewsEditor *)clickedSubview];
|
||||
if ([(GormViewWithSubviewsEditor *) clickedSubview isOpened] == NO)
|
||||
[(GormViewWithSubviewsEditor *)clickedSubview setOpened: YES];
|
||||
// NSLog(@"md %@ sendind to clickView %@", self, clickedSubview);
|
||||
[clickedSubview mouseDown: theEvent];
|
||||
}
|
||||
}
|
||||
|
@ -407,7 +380,6 @@
|
|||
[subview deactivate];
|
||||
|
||||
[v setFrame: frame];
|
||||
// [[[parent parent] editedObject] addSubview: v];
|
||||
[newSelection addObject: v];
|
||||
}
|
||||
|
||||
|
@ -419,42 +391,4 @@
|
|||
}
|
||||
return newSelection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
- (void) postDraw: (NSRect) rect
|
||||
{
|
||||
[super postDraw: rect];
|
||||
|
||||
if (openedSubeditor != nil)
|
||||
{
|
||||
GormDrawOpenKnobsForRect(
|
||||
[self convertRect: [openedSubeditor bounds]
|
||||
fromView: openedSubeditor]);
|
||||
GormShowFastKnobFills();
|
||||
}
|
||||
else if (_displaySelection)
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
}
|
||||
|
||||
- (void) postDrawForView: (GormViewEditor *) viewEditor
|
||||
{
|
||||
if (_displaySelection == NO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((openedSubeditor == viewEditor) && (openedSubeditor != nil))
|
||||
{
|
||||
GormDrawOpenKnobsForRect([viewEditor bounds]);
|
||||
GormShowFastKnobFills();
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME
|
||||
}
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
|
|
@ -23,12 +23,9 @@
|
|||
*/
|
||||
|
||||
#include <AppKit/AppKit.h>
|
||||
|
||||
#include "GormPrivate.h"
|
||||
|
||||
#include "GormTabViewEditor.h"
|
||||
|
||||
|
||||
#define _EO ((NSTabView *)_editedObject)
|
||||
|
||||
@implementation NSTabView (GormObjectAdditions)
|
||||
|
@ -117,14 +114,14 @@
|
|||
if ([[_EO hitTest: [theEvent locationInWindow]]
|
||||
isDescendantOf: currentView])
|
||||
{
|
||||
NSLog(@"md %@ descendant of", self);
|
||||
NSDebugLog(@"md %@ descendant of", self);
|
||||
if ([currentView isOpened] == NO)
|
||||
[currentView setOpened: YES];
|
||||
[currentView mouseDown: theEvent];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"md %@ not descendant of", self);
|
||||
NSDebugLog(@"md %@ not descendant of", self);
|
||||
if ([currentView isOpened] == YES)
|
||||
[currentView setOpened: NO];
|
||||
[_EO mouseDown: theEvent];
|
||||
|
@ -147,23 +144,14 @@
|
|||
currentView = [document editorForObject: [tabViewItem view]
|
||||
inEditor: self
|
||||
create: YES];
|
||||
NSLog(@"dSTVI %@ %@ %@", self, currentView, [tabViewItem view]);
|
||||
NSLog(@"dsTVI %@ %@", self, [document parentEditorForEditor: currentView]);
|
||||
NSDebugLog(@"dSTVI %@ %@ %@", self, currentView, [tabViewItem view]);
|
||||
NSDebugLog(@"dsTVI %@ %@", self, [document parentEditorForEditor: currentView]);
|
||||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"dsTVI %@ already there", self);
|
||||
NSDebugLog(@"dsTVI %@ already there", self);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
subs = [[tabViewItem view] subviews];
|
||||
|
||||
if ([[tabViewItem view] isKindOfClass: [GormViewEditor class]] == NO)
|
||||
[document editorForObject: [tabViewItem view]
|
||||
inEditor: self
|
||||
create: YES];
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -171,14 +159,14 @@
|
|||
- (BOOL) tabView: (NSTabView *)tabView
|
||||
shouldSelectTabViewItem: (NSTabViewItem *)tabViewItem
|
||||
{
|
||||
NSLog(@"shouldSelectTabViewItem called");
|
||||
NSDebugLog(@"shouldSelectTabViewItem called");
|
||||
|
||||
if ([[[tabView selectedTabViewItem] view]
|
||||
isKindOfClass:
|
||||
[GormInternalViewEditor class]])
|
||||
{
|
||||
|
||||
NSLog(@"closing tabviewitem");
|
||||
NSDebugLog(@"closing tabviewitem");
|
||||
[(GormInternalViewEditor *)[[tabView selectedTabViewItem] view]
|
||||
deactivate];
|
||||
currentView = nil;
|
||||
|
@ -187,6 +175,4 @@
|
|||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
|
@ -160,9 +160,6 @@ static BOOL currently_displaying = NO;
|
|||
{
|
||||
NSView *superview = [_editedObject superview];
|
||||
|
||||
// NSLog(@"ac %@ %@ %@", self, _editedObject, superview);
|
||||
|
||||
|
||||
[self setFrame: [_editedObject frame]];
|
||||
[self setBounds: [self frame]];
|
||||
|
||||
|
@ -190,8 +187,6 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
parent = [document parentEditorForEditor: self];
|
||||
|
||||
// NSLog(@"ac parent %@", parent);
|
||||
|
||||
if ([parent isKindOfClass: [GormViewEditor class]])
|
||||
[parent setNeedsDisplay: YES];
|
||||
else
|
||||
|
@ -250,7 +245,6 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
if (closed == NO)
|
||||
{
|
||||
// NSLog(@"%@ close", self);
|
||||
[self deactivate];
|
||||
|
||||
[document editor: self didCloseForObject: _editedObject];
|
||||
|
@ -258,23 +252,19 @@ static BOOL currently_displaying = NO;
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"%@ close but already closed", self);
|
||||
NSDebugLog(@"%@ close but already closed", self);
|
||||
}
|
||||
}
|
||||
|
||||
- (void) deactivate
|
||||
{
|
||||
// NSLog(@"%@ deactivate", self);
|
||||
|
||||
if (activated == YES)
|
||||
{
|
||||
NSView *superview = [self superview];
|
||||
|
||||
[self removeSubview: _editedObject];
|
||||
// NSLog(@"superview %@ %@", [superview subviews]);
|
||||
[superview replaceSubview: self
|
||||
with: _editedObject];
|
||||
// NSLog(@"superview %@ %@", [superview subviews]);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||
|
||||
|
@ -284,7 +274,6 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
// NSLog(@"%@ dealloc", self);
|
||||
if (closed == NO)
|
||||
[self close];
|
||||
|
||||
|
@ -851,7 +840,6 @@ static BOOL currently_displaying = NO;
|
|||
}
|
||||
else
|
||||
{
|
||||
// NSLog(@"seting frame %@", NSStringFromRect(frame));
|
||||
[self setFrame: frame];
|
||||
}
|
||||
}
|
||||
|
@ -1151,7 +1139,6 @@ static BOOL currently_displaying = NO;
|
|||
{
|
||||
if (anObject != _editedObject)
|
||||
{
|
||||
// NSLog(@"%@ windowAndRect: object unknown", self);
|
||||
return nil;
|
||||
}
|
||||
else
|
||||
|
@ -1190,12 +1177,6 @@ static BOOL currently_displaying = NO;
|
|||
return;
|
||||
}
|
||||
|
||||
// - (BOOL) acceptsTypeFromArray: (NSArray*)types
|
||||
// {
|
||||
// NSLog(@"I said why not !");
|
||||
// return [types containsObject: GormLinkPboardType];
|
||||
// }
|
||||
|
||||
- (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
|
||||
{
|
||||
NSPasteboard *dragPb;
|
||||
|
@ -1246,27 +1227,6 @@ static BOOL currently_displaying = NO;
|
|||
|
||||
- (void) mouseDown: (NSEvent*)theEvent
|
||||
{
|
||||
// the followinfg commented code was useless
|
||||
|
||||
// BOOL onKnob = NO;
|
||||
|
||||
// {
|
||||
// GormViewEditor *parent = [document parentEditorForEditor: self];
|
||||
|
||||
// if ([parent respondsToSelector: @selector(selection)] &&
|
||||
// [[parent selection] containsObject: _editedObject])
|
||||
// {
|
||||
// IBKnobPosition knob = IBNoneKnobPosition;
|
||||
// NSPoint mouseDownPoint =
|
||||
// [self convertPoint: [theEvent locationInWindow]
|
||||
// fromView: nil];
|
||||
// knob = GormKnobHitInRect([self bounds],
|
||||
// mouseDownPoint);
|
||||
// if (knob != IBNoneKnobPosition)
|
||||
// onKnob = YES;
|
||||
// }
|
||||
// }
|
||||
|
||||
if ([theEvent modifierFlags] & NSControlKeyMask)
|
||||
// start a action/outlet connection
|
||||
{
|
||||
|
@ -1291,11 +1251,6 @@ static BOOL currently_displaying = NO;
|
|||
else
|
||||
// just send the event to our parent
|
||||
{
|
||||
// NSLog(@"md %@ parent is %@ (%@)", self, parent, document);
|
||||
// NSLog(@"md %@ super %@, super's super %@,",
|
||||
// self, [self superview],
|
||||
// [[self superview] superview]);
|
||||
|
||||
if (parent)
|
||||
{
|
||||
[parent mouseDown: theEvent];
|
||||
|
@ -1356,20 +1311,10 @@ static BOOL currently_displaying = NO;
|
|||
{
|
||||
NSString *name;
|
||||
name = [dragPb stringForType: GormSoundPboardType];
|
||||
// NSLog(@"sound drag'n'dropping is not currently working, please fix it");
|
||||
if([(id)_editedObject respondsToSelector: @selector(setSound:)])
|
||||
{
|
||||
[(id)_editedObject setSound: [NSSound soundNamed: name]];
|
||||
}
|
||||
|
||||
/*
|
||||
else
|
||||
{
|
||||
int result = NSRunAlertPanel(NULL,
|
||||
_(@"The edited object does not accept sounds."),
|
||||
_(@"Cancel"));
|
||||
}
|
||||
*/
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
@ -1431,10 +1376,7 @@ static BOOL currently_displaying = NO;
|
|||
[self lockFocus];
|
||||
[self postDraw: rect];
|
||||
[self unlockFocus];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
- (void) displayRectIgnoringOpacity: (NSRect) rect
|
||||
|
@ -1467,9 +1409,6 @@ static BOOL currently_displaying = NO;
|
|||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@implementation GormViewEditor (ResponderAdditions)
|
||||
|
||||
- (void) keyDown: (NSEvent*)theEvent
|
||||
|
@ -1631,8 +1570,6 @@ static BOOL done_editing;
|
|||
didDrawBackground = [editField drawsBackground];
|
||||
[editField setDrawsBackground: YES];
|
||||
|
||||
// [editField display];
|
||||
|
||||
[nc addObserver: self
|
||||
selector: @selector(handleNotification:)
|
||||
name: NSControlTextDidEndEditingNotification
|
||||
|
|
|
@ -78,7 +78,6 @@
|
|||
NSPoint minMouse;
|
||||
NSRect firstRect = [view frame];
|
||||
NSRect lastRect = [view frame];
|
||||
// NSRect constrainRect = [view frame];
|
||||
NSPoint lastPoint = mouseDownPoint;
|
||||
NSPoint point = mouseDownPoint;
|
||||
NSView *superview;
|
||||
|
@ -345,8 +344,6 @@
|
|||
*/
|
||||
redrawRect = NSUnionRect(r, redrawRect);
|
||||
redrawRect = NSUnionRect(firstRect, redrawRect);
|
||||
// [superview displayRect: redrawRect];
|
||||
// [self makeSelectionVisible: YES];
|
||||
}
|
||||
|
||||
|
||||
|
@ -396,8 +393,6 @@
|
|||
BOOL shouldUpdateSelection = YES;
|
||||
BOOL mouseDidMove = NO;
|
||||
|
||||
// NSLog(@"hMOV %@", self);
|
||||
|
||||
eventMask = NSLeftMouseUpMask | NSLeftMouseDraggedMask
|
||||
| NSMouseMovedMask | NSPeriodicMask;
|
||||
|
||||
|
@ -1098,9 +1093,8 @@
|
|||
create: YES]];
|
||||
}
|
||||
}
|
||||
// [self makeSelectionVisible: NO];
|
||||
|
||||
[self selectObjects: array];
|
||||
// [self makeSelectionVisible: YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
{
|
||||
if (closed == NO)
|
||||
{
|
||||
// NSLog(@"%@ close", self);
|
||||
[self deactivate];
|
||||
|
||||
[self closeSubeditors];
|
||||
|
@ -47,7 +46,7 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
NSLog(@"%@ close but already closed", self);
|
||||
// NSLog(@"%@ close but already closed", self);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,13 +59,10 @@
|
|||
int count = [subeditorConnections count];
|
||||
int i;
|
||||
|
||||
// NSLog(@"start deactivating subeditors");
|
||||
for ( i = 0; i < count; i ++ )
|
||||
{
|
||||
// NSLog(@"%@", [[subeditorConnections objectAtIndex: i] source]);
|
||||
[[[subeditorConnections objectAtIndex: i] source] deactivate];
|
||||
}
|
||||
// NSLog(@"end deactivating subeditors");
|
||||
}
|
||||
|
||||
- (void) closeSubeditors
|
||||
|
@ -78,13 +74,10 @@
|
|||
int count = [subeditorConnections count];
|
||||
int i;
|
||||
|
||||
// NSLog(@"start subeditor's list");
|
||||
for ( i = 0; i < count; i ++ )
|
||||
{
|
||||
// NSLog(@"%@", [[subeditorConnections objectAtIndex: i] source]);
|
||||
[[[subeditorConnections objectAtIndex: i] source] close];
|
||||
}
|
||||
// NSLog(@"end subeditor's list");
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,7 +98,6 @@
|
|||
|
||||
if (value == YES)
|
||||
{
|
||||
// NSLog(@"sO %@ we are opened", self);
|
||||
[self silentlyResetSelection];
|
||||
[document setSelectionFromEditor: self];
|
||||
}
|
||||
|
@ -113,7 +105,6 @@
|
|||
{
|
||||
if (openedSubeditor != nil)
|
||||
{
|
||||
// NSLog(@"let's closed our subeditor");
|
||||
[self makeSubeditorResign];
|
||||
[self silentlyResetSelection];
|
||||
}
|
||||
|
@ -164,7 +155,6 @@
|
|||
{
|
||||
if (openedSubeditor != nil)
|
||||
{
|
||||
// NSLog(@"%@ makeSubeditorResign", self);
|
||||
[openedSubeditor makeSubeditorResign];
|
||||
[openedSubeditor setOpened: NO];
|
||||
openedSubeditor = nil;
|
||||
|
@ -235,7 +225,6 @@
|
|||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
// NSLog(@"adding %@", [objects objectAtIndex: i]);
|
||||
[selection addObject: [objects objectAtIndex: i]];
|
||||
}
|
||||
|
||||
|
|
|
@ -140,18 +140,21 @@
|
|||
"yank:",
|
||||
"zoom:",
|
||||
"setObject:",
|
||||
"updateMenuType:"
|
||||
"updateMenuType:",
|
||||
"updateAutoenable:"
|
||||
);
|
||||
Super = NSObject;
|
||||
};
|
||||
GormMenuAttributesInspector = {
|
||||
Actions = (
|
||||
"setObject:",
|
||||
"updateMenuType:"
|
||||
"updateMenuType:",
|
||||
"updateAutoenable:"
|
||||
);
|
||||
Outlets = (
|
||||
titleText,
|
||||
menuType
|
||||
menuType,
|
||||
autoenable
|
||||
);
|
||||
Super = IBInspector;
|
||||
};
|
||||
|
|
Binary file not shown.
|
@ -31,8 +31,10 @@
|
|||
{
|
||||
NSTextField *titleText;
|
||||
NSMatrix *menuType;
|
||||
id autoenable;
|
||||
}
|
||||
- (void) updateMenuType: (id)sender;
|
||||
- (void) updateAutoenable: (id)sender;
|
||||
@end
|
||||
|
||||
@implementation GormMenuAttributesInspector
|
||||
|
@ -63,7 +65,8 @@
|
|||
object = nil; // remove reference to old object...
|
||||
[super setObject: anObject];
|
||||
[titleText setStringValue: [object title]];
|
||||
|
||||
[autoenable setState: ([object autoenablesItems]?NSOnState:NSOffState)];
|
||||
|
||||
// set up the menu type matrix...
|
||||
if([doc windowsMenu] == anObject)
|
||||
{
|
||||
|
@ -112,6 +115,15 @@
|
|||
[doc setServicesMenu: nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) updateAutoenable: (id)sender
|
||||
{
|
||||
BOOL flag;
|
||||
|
||||
// look at the values passed back in the matrix.
|
||||
flag = ([autoenable state] == NSOnState) ? YES : NO;
|
||||
[object setAutoenablesItems: flag];
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue