mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 03:51:22 +00:00
Fix first responder methods, editing Form titles, etc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@14773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
32516ef426
commit
22a40338e5
8 changed files with 79 additions and 49 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,31 @@
|
|||
2002-10-13 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* ClassInformation.plist: Added NSDocumentController and
|
||||
NSDocument methods to FirstResponder (openDocument,
|
||||
revertDocumentToSaved:, saveAllDocuments:, saveDocument:,
|
||||
saveDocumentAs:, saveDocumentTo:).
|
||||
|
||||
* GormInspectorsManager.m (-setCurrentInspector:): Show empty
|
||||
inspector only when count = 0. If no inspector name is
|
||||
returned by object, show GormNotApplicableInspector.
|
||||
|
||||
* GormMatrixEditor.m (-mouseDown:): Edit titles of forms, etc
|
||||
on double-click.
|
||||
|
||||
* Palettes/0Menus/GormMenuEditor.m (-mouseDown:): Move variables
|
||||
to beginning of block for gcc 2.X
|
||||
|
||||
* Palettes/0Menus/main.m (-finishInstantiate): Change actions
|
||||
to appropriate NSDocument methods.
|
||||
|
||||
* Palettes/2Controls/inspectors.m ([NSStepper
|
||||
-sizeInspectorClassName]): Remove so normal size inspector is
|
||||
used.
|
||||
|
||||
* Palettes/4Data/inspectors.m ([GormImageViewAttributesInspector
|
||||
-_setValuesFromControl:]): Show error panel if entered image file
|
||||
is not found (Needs proper image handling).
|
||||
|
||||
2002-10-13 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Gorm.m: Implemented methods necessary to read the
|
||||
|
|
|
@ -60,8 +60,9 @@
|
|||
moveWordBackwardAndModifySelection:,
|
||||
moveWordForward:,
|
||||
moveWordForwardAndModifySelection:,
|
||||
newDocument:,
|
||||
ok:,
|
||||
open:,
|
||||
openDocument:,
|
||||
orderBack:,
|
||||
orderFront:,
|
||||
orderFrontColorPanel:,
|
||||
|
@ -82,8 +83,13 @@
|
|||
performZoom:,
|
||||
print:,
|
||||
raiseBaseline:,
|
||||
revertDocumentToSaved:,
|
||||
runPageLayout:,
|
||||
runToolbarCustomizationPalette:,
|
||||
saveAllDocuments:,
|
||||
saveDocument:,
|
||||
saveDocumentAs:,
|
||||
saveDocumentTo:,
|
||||
scrollLineDown:,
|
||||
scrollLineUp:,
|
||||
scrollPageDown:,
|
||||
|
@ -610,4 +616,4 @@
|
|||
Super = NSResponder;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -391,7 +391,7 @@
|
|||
NSStringFromClass([obj class])]];
|
||||
}
|
||||
|
||||
if (count == 0 || count > 1)
|
||||
if (count == 0)
|
||||
{
|
||||
newInspector = @"GormEmptyInspector";
|
||||
}
|
||||
|
@ -426,6 +426,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (newInspector == nil)
|
||||
newInspector = @"GormNotApplicableInspector";
|
||||
|
||||
if ([oldInspector isEqual: newInspector] == NO)
|
||||
{
|
||||
/*
|
||||
|
|
|
@ -325,6 +325,11 @@ static BOOL done_editing;
|
|||
column: col];
|
||||
|
||||
[document setSelectionFromEditor: self];
|
||||
if (selected != nil && ([theEvent clickCount] == 2) )
|
||||
{
|
||||
[self editTitleWithEvent: theEvent];
|
||||
return;
|
||||
}
|
||||
|
||||
[self setNeedsDisplay: YES];
|
||||
}
|
||||
|
@ -338,35 +343,6 @@ static BOOL done_editing;
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
- (void) mouseDown: (NSEvent*)theEvent
|
||||
{
|
||||
int row, col;
|
||||
id obj;
|
||||
NSPoint loc = [theEvent locationInWindow];
|
||||
|
||||
//
|
||||
// Double-click on a cell allows one to edit the cell title
|
||||
//
|
||||
if (selected != nil && ([theEvent clickCount] == 2) )
|
||||
{
|
||||
[self editTitleWithEvent: theEvent];
|
||||
return;
|
||||
}
|
||||
|
||||
// Find which cell the mouse is in
|
||||
loc = [matrix convertPoint: loc fromView: nil];
|
||||
if ([matrix getRow: &row column: &col forPoint: loc] == NO)
|
||||
return;
|
||||
|
||||
obj = [matrix cellAtRow: row column: col];
|
||||
if (obj != nil && obj != selected)
|
||||
{
|
||||
[self selectObjects: [NSArray arrayWithObject: obj]];
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
- (void) makeSelectionVisible: (BOOL)flag
|
||||
{
|
||||
if (selected != nil)
|
||||
|
|
|
@ -142,12 +142,14 @@
|
|||
|
||||
if ([theEvent clickCount] == 2)
|
||||
{
|
||||
id cell;
|
||||
NSTextField *tf;
|
||||
NSRect frame;
|
||||
[self makeSelectionVisible: NO];
|
||||
[self selectObjects: [NSArray array]];
|
||||
id cell = [rep menuItemCellForItemAtIndex: pos];
|
||||
NSTextField *tf =
|
||||
[[NSTextField alloc] initWithFrame: [self bounds]];
|
||||
NSRect frame = (NSRect)[cell titleRectForBounds:
|
||||
cell = [rep menuItemCellForItemAtIndex: pos];
|
||||
tf = [[NSTextField alloc] initWithFrame: [self bounds]];
|
||||
frame = (NSRect)[cell titleRectForBounds:
|
||||
[rep rectOfItemAtIndex: pos]];
|
||||
NSLog(@"cell %@ (%@)", cell, [cell stringValue]);
|
||||
frame.origin.y += 3;
|
||||
|
|
|
@ -137,25 +137,25 @@
|
|||
*/
|
||||
m = [GormNSMenu new];
|
||||
[m addItemWithTitle: @"Open..."
|
||||
action: @selector(open:)
|
||||
action: @selector(openDocument:)
|
||||
keyEquivalent: @"o"];
|
||||
[m addItemWithTitle: @"New"
|
||||
action: @selector(new:)
|
||||
action: @selector(newDocument:)
|
||||
keyEquivalent: @"n"];
|
||||
[m addItemWithTitle: @"Save..."
|
||||
action: @selector(save:)
|
||||
action: @selector(saveDocument:)
|
||||
keyEquivalent: @"s"];
|
||||
[m addItemWithTitle: @"Save As..."
|
||||
action: @selector(saveAs:)
|
||||
action: @selector(saveDocumentAs:)
|
||||
keyEquivalent: @"S"];
|
||||
[m addItemWithTitle: @"Save To..."
|
||||
action: @selector(saveTo:)
|
||||
action: @selector(saveDocumentTo:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Save All"
|
||||
action: @selector(saveAll:)
|
||||
action: @selector(saveAllDocuments:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"revert To Saved"
|
||||
action: @selector(revertToSaved:)
|
||||
action: @selector(revertDocumentToSaved:)
|
||||
keyEquivalent: @""];
|
||||
[m addItemWithTitle: @"Close"
|
||||
action: @selector(close:)
|
||||
|
|
|
@ -997,11 +997,6 @@
|
|||
return @"GormStepperAttributesInspector";
|
||||
}
|
||||
|
||||
- (NSString*) sizeInspectorClassName
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface GormStepperAttributesInspector : IBInspector
|
||||
|
|
|
@ -183,7 +183,27 @@ extern NSArray *predefinedDateFormats, *predefinedNumberFormats;
|
|||
{
|
||||
if (control == iconField)
|
||||
{
|
||||
[object setImage: [NSImage imageNamed: VSTR([control stringValue])] ];
|
||||
NSString *name = [control stringValue];
|
||||
NSImage *image;
|
||||
if (name == nil || [name isEqual: @""])
|
||||
{
|
||||
[object setImage: nil];
|
||||
return;
|
||||
}
|
||||
image = [NSImage imageNamed: name];
|
||||
if (image == nil)
|
||||
{
|
||||
image = [[NSImage alloc] initByReferencingFile: name];
|
||||
if (image)
|
||||
[image setName: name];
|
||||
}
|
||||
if (image == nil)
|
||||
{
|
||||
NSRunAlertPanel(@"Gorm ImageView", @"Cannot find image",
|
||||
@"OK", NULL, NULL);
|
||||
return;
|
||||
}
|
||||
[object setImage: image ];
|
||||
}
|
||||
else if (control == borderMatrix)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue