mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +00:00
* English.lproj/GormDocument.gorm: Added section in file section
to show fileType. * GormCore/GormFilePrefsManager.m: Changed version number from 1,1,0 to 1,1,2. * GormCore/GormInspectorsManager.m: Removed kludge from setCurrentInspector:. * GormCore/GormScrollViewEditor.m: Remove code which returns the table view editor in editorClassName. In mouseDown: remove check in mouseDown: for NSScroller and subclasses. * GormCore/GormViewEditor.h: Declare frameDidChange: * Palettes/3Containers/GormTableViewEditor.m: Remove redundant implementation of performDragOperation:. Call draggingUpdated instead. * Palettes/4Data/DataPalette.m: Change minimum size. * Palettes/4Data/GormTextViewEditor.m: Add handleNotification: and add initWithObject:inDocument:. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23700 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1fbfdd1200
commit
3ec0137332
10 changed files with 187 additions and 109 deletions
19
ChangeLog
19
ChangeLog
|
@ -1,3 +1,22 @@
|
||||||
|
2006-10-01 22:23-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* English.lproj/GormDocument.gorm: Added section in file section
|
||||||
|
to show fileType.
|
||||||
|
* GormCore/GormFilePrefsManager.m: Changed version number from
|
||||||
|
1,1,0 to 1,1,2.
|
||||||
|
* GormCore/GormInspectorsManager.m: Removed kludge from
|
||||||
|
setCurrentInspector:.
|
||||||
|
* GormCore/GormScrollViewEditor.m: Remove code which returns
|
||||||
|
the table view editor in editorClassName. In mouseDown:
|
||||||
|
remove check in mouseDown: for NSScroller and subclasses.
|
||||||
|
* GormCore/GormViewEditor.h: Declare frameDidChange:
|
||||||
|
* Palettes/3Containers/GormTableViewEditor.m: Remove redundant
|
||||||
|
implementation of performDragOperation:. Call draggingUpdated
|
||||||
|
instead.
|
||||||
|
* Palettes/4Data/DataPalette.m: Change minimum size.
|
||||||
|
* Palettes/4Data/GormTextViewEditor.m: Add handleNotification:
|
||||||
|
and add initWithObject:inDocument:.
|
||||||
|
|
||||||
2006-09-30 23:09-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
2006-09-30 23:09-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* GormCore/GormGModelWrapperLoader.m: Cleanup NSLog()
|
* GormCore/GormGModelWrapperLoader.m: Cleanup NSLog()
|
||||||
|
|
|
@ -30,7 +30,8 @@
|
||||||
selectionBox,
|
selectionBox,
|
||||||
filePrefsView,
|
filePrefsView,
|
||||||
filePrefsManager,
|
filePrefsManager,
|
||||||
filePrefsWindow
|
filePrefsWindow,
|
||||||
|
fileType
|
||||||
);
|
);
|
||||||
Super = NSDocument;
|
Super = NSDocument;
|
||||||
};
|
};
|
||||||
|
@ -50,4 +51,46 @@
|
||||||
);
|
);
|
||||||
Super = NSObject;
|
Super = NSObject;
|
||||||
};
|
};
|
||||||
|
NewClass = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NSButton;
|
||||||
|
};
|
||||||
|
NewClass1 = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NewClass;
|
||||||
|
};
|
||||||
|
NewClass2 = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NSButton;
|
||||||
|
};
|
||||||
|
NewClass3 = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NewClass2;
|
||||||
|
};
|
||||||
|
NewClass4 = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NewClass3;
|
||||||
|
};
|
||||||
|
NewClass5 = {
|
||||||
|
Actions = (
|
||||||
|
);
|
||||||
|
Outlets = (
|
||||||
|
);
|
||||||
|
Super = NSOpenGLView;
|
||||||
|
};
|
||||||
}
|
}
|
Binary file not shown.
|
@ -85,7 +85,7 @@ NSString *formatVersion(int version)
|
||||||
|
|
||||||
+ (int) currentVersion
|
+ (int) currentVersion
|
||||||
{
|
{
|
||||||
return appVersion(1,1,0);
|
return appVersion(1,1,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
|
|
|
@ -292,24 +292,6 @@
|
||||||
|
|
||||||
NSDebugLog(@"current %i",current);
|
NSDebugLog(@"current %i",current);
|
||||||
|
|
||||||
// Operate on the document view if the selected object is a NSScrollView
|
|
||||||
if ([obj isKindOfClass: [NSScrollView class]] &&
|
|
||||||
[(NSScrollView *)obj documentView])
|
|
||||||
{
|
|
||||||
id docView = [(NSScrollView *)obj documentView];
|
|
||||||
|
|
||||||
// FIXME: Really need to find a more generalized way to do this.
|
|
||||||
if ([docView isKindOfClass: [NSTableView class]])
|
|
||||||
{
|
|
||||||
obj = docView;
|
|
||||||
if ([obj selectedColumn] != -1)
|
|
||||||
{
|
|
||||||
obj = [[obj tableColumns] objectAtIndex:
|
|
||||||
[obj selectedColumn]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// refresh object.
|
// refresh object.
|
||||||
selectedObject = obj;
|
selectedObject = obj;
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
|
|
||||||
- (NSString*) editorClassName
|
- (NSString*) editorClassName
|
||||||
{
|
{
|
||||||
if ([[self documentView] isKindOfClass: [NSTableView class]])
|
|
||||||
{
|
|
||||||
return [[self documentView] editorClassName];
|
|
||||||
}
|
|
||||||
|
|
||||||
return @"GormScrollViewEditor";
|
return @"GormScrollViewEditor";
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
@ -99,22 +94,28 @@
|
||||||
if ([parent respondsToSelector: @selector(selection)] &&
|
if ([parent respondsToSelector: @selector(selection)] &&
|
||||||
[[parent selection] containsObject: _EO])
|
[[parent selection] containsObject: _EO])
|
||||||
{
|
{
|
||||||
IBKnobPosition knob = IBNoneKnobPosition;
|
IBKnobPosition knob = IBNoneKnobPosition;
|
||||||
NSPoint mouseDownPoint =
|
NSPoint mouseDownPoint =
|
||||||
[self convertPoint: [theEvent locationInWindow]
|
[self convertPoint: [theEvent locationInWindow]
|
||||||
fromView: nil];
|
fromView: nil];
|
||||||
knob = GormKnobHitInRect([self bounds],
|
knob = GormKnobHitInRect([self bounds],
|
||||||
mouseDownPoint);
|
mouseDownPoint);
|
||||||
if (knob != IBNoneKnobPosition)
|
if (knob != IBNoneKnobPosition)
|
||||||
onKnob = YES;
|
{
|
||||||
|
onKnob = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (onKnob == YES)
|
if (onKnob == YES)
|
||||||
{
|
{
|
||||||
if (parent)
|
if (parent)
|
||||||
return [parent mouseDown: theEvent];
|
{
|
||||||
|
return [parent mouseDown: theEvent];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return [self noResponderFor: @selector(mouseDown:)];
|
{
|
||||||
|
return [self noResponderFor: @selector(mouseDown:)];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opened == NO)
|
if (opened == NO)
|
||||||
|
@ -127,15 +128,30 @@
|
||||||
isDescendantOf: documentViewEditor])
|
isDescendantOf: documentViewEditor])
|
||||||
{
|
{
|
||||||
if (([self isOpened] == YES) && ([documentViewEditor isOpened] == NO))
|
if (([self isOpened] == YES) && ([documentViewEditor isOpened] == NO))
|
||||||
[documentViewEditor setOpened: YES];
|
{
|
||||||
|
[documentViewEditor setOpened: YES];
|
||||||
|
}
|
||||||
if ([documentViewEditor isOpened])
|
if ([documentViewEditor isOpened])
|
||||||
[documentViewEditor mouseDown: theEvent];
|
{
|
||||||
|
[documentViewEditor mouseDown: theEvent];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSView *v = [_EO hitTest: [theEvent locationInWindow]];
|
NSView *v = [_EO hitTest: [theEvent locationInWindow]];
|
||||||
if (v && [v isKindOfClass: [NSScroller class]])
|
id r = [v nextResponder];
|
||||||
[v mouseDown: theEvent];
|
|
||||||
|
if([v respondsToSelector: @selector(setNextResponder:)])
|
||||||
|
{
|
||||||
|
// this is done to prevent a responder loop.
|
||||||
|
[v setNextResponder: nil];
|
||||||
|
[v mouseDown: theEvent];
|
||||||
|
[v setNextResponder: r];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[v mouseDown: theEvent];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,8 +174,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
selection = [[NSMutableArray alloc] initWithCapacity: 5];
|
selection = [[NSMutableArray alloc] initWithCapacity: 5];
|
||||||
[self registerForDraggedTypes: [NSArray arrayWithObjects:
|
[self registerForDraggedTypes: [NSArray arrayWithObjects: IBViewPboardType,
|
||||||
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
|
GormLinkPboardType,
|
||||||
|
IBFormatterPboardType,
|
||||||
|
nil]];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -182,6 +200,7 @@
|
||||||
{
|
{
|
||||||
id v;
|
id v;
|
||||||
NSRect frame;
|
NSRect frame;
|
||||||
|
|
||||||
v = [subview editedObject];
|
v = [subview editedObject];
|
||||||
frame = [v frame];
|
frame = [v frame];
|
||||||
frame = [parent convertRect: frame fromView: _EO];
|
frame = [parent convertRect: frame fromView: _EO];
|
||||||
|
@ -194,7 +213,7 @@
|
||||||
{
|
{
|
||||||
NSRect frame = [documentView frame];
|
NSRect frame = [documentView frame];
|
||||||
|
|
||||||
// in this case the view editor is the documentView and
|
// In this case the view editor is the documentView and
|
||||||
// we need to add the internal view back into the superview
|
// we need to add the internal view back into the superview
|
||||||
frame = [parent convertRect: frame fromView: _EO];
|
frame = [parent convertRect: frame fromView: _EO];
|
||||||
[documentView setFrame: frame];
|
[documentView setFrame: frame];
|
||||||
|
@ -209,5 +228,4 @@
|
||||||
|
|
||||||
return newSelection;
|
return newSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
- (BOOL) isOpened;
|
- (BOOL) isOpened;
|
||||||
- (BOOL) canBeOpened;
|
- (BOOL) canBeOpened;
|
||||||
- (void) setOpened: (BOOL) value;
|
- (void) setOpened: (BOOL) value;
|
||||||
|
- (void) frameDidChange: (id) sender;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface GormViewEditor (EditingAdditions)
|
@interface GormViewEditor (EditingAdditions)
|
||||||
|
|
|
@ -374,7 +374,6 @@ static NSText *_textObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
||||||
|
|
||||||
{
|
{
|
||||||
NSPasteboard *dragPb;
|
NSPasteboard *dragPb;
|
||||||
NSArray *types;
|
NSArray *types;
|
||||||
|
@ -384,6 +383,8 @@ static NSText *_textObject;
|
||||||
if ([types containsObject: GormLinkPboardType] == YES)
|
if ([types containsObject: GormLinkPboardType] == YES)
|
||||||
{
|
{
|
||||||
id destination = nil;
|
id destination = nil;
|
||||||
|
|
||||||
|
/*
|
||||||
NSView *hitView =
|
NSView *hitView =
|
||||||
[[tableView enclosingScrollView]
|
[[tableView enclosingScrollView]
|
||||||
hitTest:
|
hitTest:
|
||||||
|
@ -405,9 +406,17 @@ static NSText *_textObject;
|
||||||
|
|
||||||
if (hitView == tableView)
|
if (hitView == tableView)
|
||||||
destination = tableView;
|
destination = tableView;
|
||||||
|
*/
|
||||||
|
|
||||||
if (destination == nil)
|
if (destination == nil)
|
||||||
destination = _editedObject;
|
{
|
||||||
|
int col = 0;
|
||||||
|
destination = _editedObject;
|
||||||
|
if((col = [_editedObject selectedColumn]) != -1)
|
||||||
|
{
|
||||||
|
destination = [[_editedObject tableColumns] objectAtIndex: col];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[NSApp displayConnectionBetween: [NSApp connectSource]
|
[NSApp displayConnectionBetween: [NSApp connectSource]
|
||||||
and: destination];
|
and: destination];
|
||||||
|
@ -421,45 +430,7 @@ static NSText *_textObject;
|
||||||
|
|
||||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||||
{
|
{
|
||||||
NSPasteboard *dragPb;
|
return ([self draggingUpdated: sender] == NSDragOperationLink);
|
||||||
NSArray *types;
|
|
||||||
|
|
||||||
dragPb = [sender draggingPasteboard];
|
|
||||||
types = [dragPb types];
|
|
||||||
if ([types containsObject: GormLinkPboardType] == YES)
|
|
||||||
{
|
|
||||||
id destination = nil;
|
|
||||||
NSView *hitView =
|
|
||||||
[[tableView enclosingScrollView]
|
|
||||||
hitTest:
|
|
||||||
[[[tableView enclosingScrollView] superview]
|
|
||||||
convertPoint: [sender draggingLocation]
|
|
||||||
fromView: nil]];
|
|
||||||
|
|
||||||
if (hitView == [tableView headerView])
|
|
||||||
{
|
|
||||||
NSPoint p = [hitView convertPoint: [sender draggingLocation]
|
|
||||||
fromView: nil];
|
|
||||||
int columnNumber =
|
|
||||||
[(NSTableHeaderView*) hitView columnAtPoint: p];
|
|
||||||
|
|
||||||
if (columnNumber != -1)
|
|
||||||
destination = [[tableView tableColumns]
|
|
||||||
objectAtIndex: columnNumber];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hitView == tableView)
|
|
||||||
destination = tableView;
|
|
||||||
|
|
||||||
if (destination == nil)
|
|
||||||
destination = _editedObject;
|
|
||||||
|
|
||||||
[NSApp displayConnectionBetween: [NSApp connectSource]
|
|
||||||
and: destination];
|
|
||||||
[NSApp startConnecting];
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSWindow *)windowAndRect: (NSRect *)prect
|
- (NSWindow *)windowAndRect: (NSRect *)prect
|
||||||
|
|
|
@ -260,7 +260,7 @@ int defaultDateFormatIndex = 3;
|
||||||
rect = [[(NSScrollView *)v contentView] frame];
|
rect = [[(NSScrollView *)v contentView] frame];
|
||||||
|
|
||||||
tv = [[NSTextView alloc] initWithFrame: rect];
|
tv = [[NSTextView alloc] initWithFrame: rect];
|
||||||
[tv setMinSize: NSMakeSize(0.0, 0.0)];
|
[tv setMinSize: NSMakeSize(108.0, 143.0)];
|
||||||
[tv setMaxSize: NSMakeSize(1.0E7,1.0E7)];
|
[tv setMaxSize: NSMakeSize(1.0E7,1.0E7)];
|
||||||
[tv setHorizontallyResizable: YES];
|
[tv setHorizontallyResizable: YES];
|
||||||
[tv setVerticallyResizable: YES];
|
[tv setVerticallyResizable: YES];
|
||||||
|
|
|
@ -37,21 +37,65 @@
|
||||||
|
|
||||||
@implementation GormTextViewEditor
|
@implementation GormTextViewEditor
|
||||||
|
|
||||||
|
- (id) initWithObject: (id)anObject
|
||||||
|
inDocument: (id<IBDocuments>)aDocument
|
||||||
|
{
|
||||||
|
if((self = [super initWithObject: anObject inDocument: aDocument]) != nil)
|
||||||
|
{
|
||||||
|
id sv = [anObject enclosingScrollView];
|
||||||
|
[self registerForDraggedTypes: [NSArray arrayWithObjects: IBViewPboardType,
|
||||||
|
GormLinkPboardType,
|
||||||
|
IBFormatterPboardType,
|
||||||
|
nil]];
|
||||||
|
|
||||||
|
// subscribe to frame changes of the superview...
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||||
|
selector: @selector(handleNotification:)
|
||||||
|
name: NSViewFrameDidChangeNotification
|
||||||
|
object: sv];
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL) activate
|
- (BOOL) activate
|
||||||
{
|
{
|
||||||
if ([super activate])
|
if ([super activate])
|
||||||
{
|
{
|
||||||
if ([_editedObject isKindOfClass: [NSScrollView class]])
|
if ([_editedObject isKindOfClass: [NSScrollView class]])
|
||||||
textView = [(NSScrollView *)_editedObject documentView];
|
{
|
||||||
|
textView = [(NSScrollView *)_editedObject documentView];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
textView = (NSTextView *)_editedObject;
|
{
|
||||||
|
textView = (NSTextView *)_editedObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
// make the view post frame changes...
|
||||||
|
[[textView enclosingScrollView] setPostsFrameChangedNotifications: YES];
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
- (void) deactivate
|
||||||
|
{
|
||||||
|
[super deactivate];
|
||||||
|
[[textView enclosingScrollView] setPostsFrameChangedNotifications: NO];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (unsigned) draggingEntered: (id<NSDraggingInfo>)sender
|
||||||
|
{
|
||||||
|
return [self draggingUpdated: sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
||||||
{
|
{
|
||||||
NSPasteboard *dragPb;
|
NSPasteboard *dragPb;
|
||||||
NSArray *types;
|
NSArray *types;
|
||||||
|
@ -85,35 +129,34 @@
|
||||||
}
|
}
|
||||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||||
{
|
{
|
||||||
NSPasteboard *dragPb;
|
return ([self draggingUpdated: sender] == NSDragOperationLink);
|
||||||
NSArray *types;
|
|
||||||
|
|
||||||
dragPb = [sender draggingPasteboard];
|
|
||||||
types = [dragPb types];
|
|
||||||
if ([types containsObject: GormLinkPboardType] == YES)
|
|
||||||
{
|
|
||||||
id destination = nil;
|
|
||||||
NSView *hitView =
|
|
||||||
[[textView enclosingScrollView]
|
|
||||||
hitTest:
|
|
||||||
[[[textView enclosingScrollView] superview]
|
|
||||||
convertPoint: [sender draggingLocation]
|
|
||||||
fromView: nil]];
|
|
||||||
|
|
||||||
if ((hitView == textView) || (hitView == [textView superview]))
|
|
||||||
destination = textView;
|
|
||||||
|
|
||||||
if (destination == nil)
|
|
||||||
destination = _editedObject;
|
|
||||||
|
|
||||||
[NSApp displayConnectionBetween: [NSApp connectSource]
|
|
||||||
and: destination];
|
|
||||||
[NSApp startConnecting];
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
return YES;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) handleNotification: (id) notification
|
||||||
|
{
|
||||||
|
id view = [notification object];
|
||||||
|
NSRect frame = [view frame];
|
||||||
|
NSSize size;
|
||||||
|
|
||||||
|
if([view hasVerticalScroller])
|
||||||
|
{
|
||||||
|
NSSize s = [[view verticalScroller] frame].size;
|
||||||
|
frame.size.width -= (s.width + 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
if([view hasHorizontalScroller])
|
||||||
|
{
|
||||||
|
NSSize s = [[view horizontalScroller] frame].size;
|
||||||
|
frame.size.height -= (s.height + 5);
|
||||||
|
}
|
||||||
|
|
||||||
|
size = frame.size;
|
||||||
|
|
||||||
|
[textView setMinSize: size];
|
||||||
|
[textView setFrame: frame];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
- (NSWindow *)windowAndRect: (NSRect *)prect
|
- (NSWindow *)windowAndRect: (NSRect *)prect
|
||||||
forObject: (id) object
|
forObject: (id) object
|
||||||
{
|
{
|
||||||
|
@ -128,4 +171,5 @@
|
||||||
return [super windowAndRect: prect forObject: object];
|
return [super windowAndRect: prect forObject: object];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue