mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +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>
|
||||
|
||||
* GormCore/GormGModelWrapperLoader.m: Cleanup NSLog()
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
selectionBox,
|
||||
filePrefsView,
|
||||
filePrefsManager,
|
||||
filePrefsWindow
|
||||
filePrefsWindow,
|
||||
fileType
|
||||
);
|
||||
Super = NSDocument;
|
||||
};
|
||||
|
@ -50,4 +51,46 @@
|
|||
);
|
||||
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
|
||||
{
|
||||
return appVersion(1,1,0);
|
||||
return appVersion(1,1,2);
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
|
|
|
@ -292,24 +292,6 @@
|
|||
|
||||
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.
|
||||
selectedObject = obj;
|
||||
|
||||
|
|
|
@ -37,11 +37,6 @@
|
|||
|
||||
- (NSString*) editorClassName
|
||||
{
|
||||
if ([[self documentView] isKindOfClass: [NSTableView class]])
|
||||
{
|
||||
return [[self documentView] editorClassName];
|
||||
}
|
||||
|
||||
return @"GormScrollViewEditor";
|
||||
}
|
||||
@end
|
||||
|
@ -99,22 +94,28 @@
|
|||
if ([parent respondsToSelector: @selector(selection)] &&
|
||||
[[parent selection] containsObject: _EO])
|
||||
{
|
||||
IBKnobPosition knob = IBNoneKnobPosition;
|
||||
IBKnobPosition knob = IBNoneKnobPosition;
|
||||
NSPoint mouseDownPoint =
|
||||
[self convertPoint: [theEvent locationInWindow]
|
||||
fromView: nil];
|
||||
knob = GormKnobHitInRect([self bounds],
|
||||
mouseDownPoint);
|
||||
if (knob != IBNoneKnobPosition)
|
||||
onKnob = YES;
|
||||
{
|
||||
onKnob = YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (onKnob == YES)
|
||||
{
|
||||
if (parent)
|
||||
return [parent mouseDown: theEvent];
|
||||
{
|
||||
return [parent mouseDown: theEvent];
|
||||
}
|
||||
else
|
||||
return [self noResponderFor: @selector(mouseDown:)];
|
||||
{
|
||||
return [self noResponderFor: @selector(mouseDown:)];
|
||||
}
|
||||
}
|
||||
|
||||
if (opened == NO)
|
||||
|
@ -127,15 +128,30 @@
|
|||
isDescendantOf: documentViewEditor])
|
||||
{
|
||||
if (([self isOpened] == YES) && ([documentViewEditor isOpened] == NO))
|
||||
[documentViewEditor setOpened: YES];
|
||||
{
|
||||
[documentViewEditor setOpened: YES];
|
||||
}
|
||||
if ([documentViewEditor isOpened])
|
||||
[documentViewEditor mouseDown: theEvent];
|
||||
{
|
||||
[documentViewEditor mouseDown: theEvent];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSView *v = [_EO hitTest: [theEvent locationInWindow]];
|
||||
if (v && [v isKindOfClass: [NSScroller class]])
|
||||
[v mouseDown: theEvent];
|
||||
id r = [v nextResponder];
|
||||
|
||||
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];
|
||||
[self registerForDraggedTypes: [NSArray arrayWithObjects:
|
||||
IBViewPboardType, GormLinkPboardType, IBFormatterPboardType, nil]];
|
||||
[self registerForDraggedTypes: [NSArray arrayWithObjects: IBViewPboardType,
|
||||
GormLinkPboardType,
|
||||
IBFormatterPboardType,
|
||||
nil]];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -182,6 +200,7 @@
|
|||
{
|
||||
id v;
|
||||
NSRect frame;
|
||||
|
||||
v = [subview editedObject];
|
||||
frame = [v frame];
|
||||
frame = [parent convertRect: frame fromView: _EO];
|
||||
|
@ -194,7 +213,7 @@
|
|||
{
|
||||
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
|
||||
frame = [parent convertRect: frame fromView: _EO];
|
||||
[documentView setFrame: frame];
|
||||
|
@ -209,5 +228,4 @@
|
|||
|
||||
return newSelection;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
- (BOOL) isOpened;
|
||||
- (BOOL) canBeOpened;
|
||||
- (void) setOpened: (BOOL) value;
|
||||
- (void) frameDidChange: (id) sender;
|
||||
@end
|
||||
|
||||
@interface GormViewEditor (EditingAdditions)
|
||||
|
|
|
@ -374,7 +374,6 @@ static NSText *_textObject;
|
|||
}
|
||||
|
||||
- (unsigned) draggingUpdated: (id<NSDraggingInfo>)sender
|
||||
|
||||
{
|
||||
NSPasteboard *dragPb;
|
||||
NSArray *types;
|
||||
|
@ -384,6 +383,8 @@ static NSText *_textObject;
|
|||
if ([types containsObject: GormLinkPboardType] == YES)
|
||||
{
|
||||
id destination = nil;
|
||||
|
||||
/*
|
||||
NSView *hitView =
|
||||
[[tableView enclosingScrollView]
|
||||
hitTest:
|
||||
|
@ -405,9 +406,17 @@ static NSText *_textObject;
|
|||
|
||||
if (hitView == tableView)
|
||||
destination = tableView;
|
||||
*/
|
||||
|
||||
if (destination == nil)
|
||||
destination = _editedObject;
|
||||
{
|
||||
int col = 0;
|
||||
destination = _editedObject;
|
||||
if((col = [_editedObject selectedColumn]) != -1)
|
||||
{
|
||||
destination = [[_editedObject tableColumns] objectAtIndex: col];
|
||||
}
|
||||
}
|
||||
|
||||
[NSApp displayConnectionBetween: [NSApp connectSource]
|
||||
and: destination];
|
||||
|
@ -421,45 +430,7 @@ static NSText *_textObject;
|
|||
|
||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||
{
|
||||
NSPasteboard *dragPb;
|
||||
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;
|
||||
return ([self draggingUpdated: sender] == NSDragOperationLink);
|
||||
}
|
||||
|
||||
- (NSWindow *)windowAndRect: (NSRect *)prect
|
||||
|
|
|
@ -260,7 +260,7 @@ int defaultDateFormatIndex = 3;
|
|||
rect = [[(NSScrollView *)v contentView] frame];
|
||||
|
||||
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 setHorizontallyResizable: YES];
|
||||
[tv setVerticallyResizable: YES];
|
||||
|
|
|
@ -37,21 +37,65 @@
|
|||
|
||||
@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
|
||||
{
|
||||
if ([super activate])
|
||||
{
|
||||
if ([_editedObject isKindOfClass: [NSScrollView class]])
|
||||
textView = [(NSScrollView *)_editedObject documentView];
|
||||
{
|
||||
textView = [(NSScrollView *)_editedObject documentView];
|
||||
}
|
||||
else
|
||||
textView = (NSTextView *)_editedObject;
|
||||
{
|
||||
textView = (NSTextView *)_editedObject;
|
||||
}
|
||||
|
||||
// make the view post frame changes...
|
||||
[[textView enclosingScrollView] setPostsFrameChangedNotifications: YES];
|
||||
|
||||
return YES;
|
||||
}
|
||||
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;
|
||||
NSArray *types;
|
||||
|
@ -85,35 +129,34 @@
|
|||
}
|
||||
- (BOOL) performDragOperation: (id<NSDraggingInfo>)sender
|
||||
{
|
||||
NSPasteboard *dragPb;
|
||||
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;
|
||||
return ([self draggingUpdated: sender] == NSDragOperationLink);
|
||||
}
|
||||
|
||||
- (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
|
||||
forObject: (id) object
|
||||
{
|
||||
|
@ -128,4 +171,5 @@
|
|||
return [super windowAndRect: prect forObject: object];
|
||||
}
|
||||
}
|
||||
*/
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue