mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
Changes to make the implementation of IntefaceBuilder spec more precise in Gorm.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20442 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ec792b978b
commit
707a0260e7
9 changed files with 143 additions and 55 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
|||
2004-12-12 14:16 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormClassEditor.m: Implemented new methods.
|
||||
* GormGenericEditor.m: Implemented new methods.
|
||||
* GormLib/IBEditors.h: Added back some of the commented out
|
||||
methods and added also validateEditing and openSubeditorForObject:
|
||||
* GormLib/IBViewAdditions.h: Added the category IBCellAdditions
|
||||
as defined in the IB API Spec.
|
||||
* GormViewEditor.m: Added stub implementations for methods
|
||||
not implemented in the view editor. They are implemented in
|
||||
some of the lower level editors, but it still needs to be
|
||||
compliant.
|
||||
* GormViewWithSubviewsEditor.[hm]: Removed redundant method for
|
||||
deleteSelection.
|
||||
|
||||
2004-12-11 18:03 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormClassManager.m: Correction for reparenting of a class in
|
||||
|
|
|
@ -366,6 +366,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) copySelection
|
||||
{
|
||||
// does nothing.
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GormClassEditor (NSOutlineViewDataSource)
|
||||
|
|
|
@ -340,4 +340,15 @@
|
|||
{
|
||||
return (closed == NO);
|
||||
}
|
||||
|
||||
// stubs for protocol methods not implemented in this editor.
|
||||
- (void) validateEditing
|
||||
{
|
||||
// does nothing.
|
||||
}
|
||||
|
||||
- (void) drawSelection
|
||||
{
|
||||
// does nothing.
|
||||
}
|
||||
@end
|
||||
|
|
|
@ -323,36 +323,32 @@ static NSImage *horizontalImage;
|
|||
{
|
||||
BOOL onKnob = NO;
|
||||
|
||||
{
|
||||
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 (onKnob == YES)
|
||||
{
|
||||
if (parent)
|
||||
return [parent mouseDown: theEvent];
|
||||
else
|
||||
return [self noResponderFor: @selector(mouseDown:)];
|
||||
}
|
||||
}
|
||||
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 (onKnob == YES)
|
||||
{
|
||||
if (parent)
|
||||
return [parent mouseDown: theEvent];
|
||||
else
|
||||
return [self noResponderFor: @selector(mouseDown:)];
|
||||
}
|
||||
|
||||
{
|
||||
if ([parent isOpened] == NO)
|
||||
{
|
||||
NSDebugLog(@"md %@ calling my parent %@", self, parent);
|
||||
[parent mouseDown: theEvent];
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ([parent isOpened] == NO)
|
||||
{
|
||||
NSDebugLog(@"md %@ calling my parent %@", self, parent);
|
||||
[parent mouseDown: theEvent];
|
||||
return;
|
||||
}
|
||||
|
||||
// are we on the knob of a selected view ?
|
||||
{
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#define INCLUDED_IBEDITORS_H
|
||||
|
||||
#include <Foundation/NSObject.h>
|
||||
// #include <InterfaceBuilder/IBDocuments.h>
|
||||
|
||||
// forward references
|
||||
@class NSString;
|
||||
|
@ -46,25 +45,36 @@ extern NSString *IBClassNameChangedNotification;
|
|||
* must implement.
|
||||
*/
|
||||
@protocol IBSelectionOwners <NSObject>
|
||||
// - (unsigned) selectionCount;
|
||||
- (NSArray*) selection;
|
||||
// - (void) drawSelection;
|
||||
/**
|
||||
* The number of currently selected objects.
|
||||
*/
|
||||
- (unsigned) selectionCount;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Return the selection in an array.
|
||||
*/
|
||||
- (NSArray*) selection;
|
||||
|
||||
/**
|
||||
* Draw the selection.
|
||||
*/
|
||||
- (void) drawSelection;
|
||||
|
||||
/**
|
||||
* This method is used to draw or remove markup that identifies selected
|
||||
* objects within the object being edited.
|
||||
*/
|
||||
- (void) makeSelectionVisible: (BOOL)flag;
|
||||
|
||||
/*
|
||||
/**
|
||||
* This method changes the current selection to those objects in the array.
|
||||
*/
|
||||
- (void) selectObjects: (NSArray*)objects;
|
||||
|
||||
// /*
|
||||
// * This method places the current selection from the editor on the pasteboard.
|
||||
// */
|
||||
// - (void) copySelection;
|
||||
/**
|
||||
* This method places the current selection from the editor on the pasteboard.
|
||||
*/
|
||||
- (void) copySelection;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -97,6 +107,11 @@ extern NSString *IBClassNameChangedNotification;
|
|||
*/
|
||||
- (void) close;
|
||||
|
||||
/**
|
||||
* Close all subeditors associated with this editor.
|
||||
*/
|
||||
- (void) closeSubeditors;
|
||||
|
||||
/**
|
||||
* Deactivate an editor - removes it from the view hierarchy so that objects
|
||||
* can be archived without including the editor.
|
||||
|
@ -105,9 +120,9 @@ extern NSString *IBClassNameChangedNotification;
|
|||
*/
|
||||
- (void) deactivate;
|
||||
|
||||
// /*
|
||||
// * This method deletes all the objects in the current selection in the editor.
|
||||
// */
|
||||
/**
|
||||
* This method deletes all the objects in the current selection in the editor.
|
||||
*/
|
||||
- (void) deleteSelection;
|
||||
|
||||
/**
|
||||
|
@ -125,11 +140,18 @@ extern NSString *IBClassNameChangedNotification;
|
|||
*/
|
||||
- (void) orderFront;
|
||||
|
||||
/**
|
||||
* Opens the subeditor for an object when the object being edited is
|
||||
* double clicked by the user. If there is no sub-editor, return nil, otherwise
|
||||
* method will return the editor for the object.
|
||||
*/
|
||||
- (id<IBEditors>) openSubeditorForObject: (id)object;
|
||||
|
||||
/**
|
||||
* This method is used to add the contents of the pasteboard to the current
|
||||
* selection of objects within the editor.
|
||||
*/
|
||||
// - (void) pasteInSelection;
|
||||
- (void) pasteInSelection;
|
||||
|
||||
/**
|
||||
* Redraws the edited object
|
||||
|
@ -143,6 +165,12 @@ extern NSString *IBClassNameChangedNotification;
|
|||
*/
|
||||
- (BOOL) wantsSelection;
|
||||
|
||||
/**
|
||||
* Causes the editor to select the text being edited in the current text
|
||||
* field.
|
||||
*/
|
||||
- (void) validateEditing;
|
||||
|
||||
/**
|
||||
* This returns the window in which the editor is drawn.
|
||||
*/
|
||||
|
|
|
@ -28,11 +28,12 @@
|
|||
#include <InterfaceBuilder/IBDefines.h>
|
||||
#include <Foundation/NSGeometry.h>
|
||||
#include <AppKit/NSView.h>
|
||||
#include <AppKit/NSCell.h>
|
||||
|
||||
// forward references
|
||||
@class NSColor;
|
||||
|
||||
@interface NSView (ViewAdditions)
|
||||
@interface NSView (IBViewAdditions)
|
||||
- (BOOL) acceptsColor: (NSColor*)color atPoint: (NSPoint)point;
|
||||
- (BOOL) allowsAltDragging;
|
||||
- (void) depositColor: (NSColor*)color atPoint: (NSPoint)point;
|
||||
|
@ -41,4 +42,12 @@
|
|||
- (void) placeView: (NSRect)newFrame;
|
||||
@end
|
||||
|
||||
@interface NSCell (IBCellAdditions)
|
||||
- (void) cellWillAltDragWithSize: (NSSize)size;
|
||||
- (NSSize) maximumSizeForCellSize: (NSSize)size
|
||||
knobPosition: (IBKnobPosition)position;
|
||||
- (NSSize) minimumSizeForCellSize: (NSSize)size
|
||||
knobPosition: (IBKnobPosition)position;
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1361,11 +1361,6 @@ static BOOL currently_displaying = NO;
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void) deleteSelection
|
||||
{
|
||||
// does nothing...
|
||||
}
|
||||
|
||||
- (void) resetObject: (id)anObject
|
||||
{
|
||||
NS_DURING
|
||||
|
@ -1492,6 +1487,32 @@ static BOOL currently_displaying = NO;
|
|||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
}
|
||||
|
||||
// stubs for the remainder of the IBEditors protocol not implemented in this class.
|
||||
- (void) deleteSelection
|
||||
{
|
||||
// NSLog(@"deleteSelection should be defined in a subclass");
|
||||
}
|
||||
|
||||
- (void) validateEditing
|
||||
{
|
||||
// NSLog(@"validateEditing should be defined in a subclass");
|
||||
}
|
||||
|
||||
- (void) pasteInSelection
|
||||
{
|
||||
// NSLog(@"deleteSelection should be defined in a subclass");
|
||||
}
|
||||
|
||||
- (id<IBEditors>) openSubeditorForObject: (id) object
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) closeSubeditors
|
||||
{
|
||||
// NSLog(@"closeSubeditors should be defined in a subclass");
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
- (void) silentlyResetSelection;
|
||||
- (void) selectObjects: (NSArray *) objects;
|
||||
- (void) copySelection;
|
||||
- (void) deleteSelection;
|
||||
|
||||
/*
|
||||
* Close subeditors of this editor.
|
||||
|
|
|
@ -256,14 +256,18 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void) deleteSelection
|
||||
{
|
||||
NSLog(@"deleteSelection should be subclassed");
|
||||
}
|
||||
|
||||
- (BOOL) acceptsFirstResponder
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void) drawSelection
|
||||
{
|
||||
// doesn nothing.
|
||||
}
|
||||
|
||||
- (unsigned) selectionCount
|
||||
{
|
||||
return [selection count];
|
||||
}
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue