mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Added nextKeyView to views withing gmodel to allow user to tab between buttons. Fixed a bug in NSBrowser. Made some corrections to NSSpellChecker and [NSTextView checkSpelling:]
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10641 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a77949a8e6
commit
016e021fc1
5 changed files with 173 additions and 69 deletions
25
ChangeLog
25
ChangeLog
|
@ -1,3 +1,28 @@
|
|||
2001-08-03 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* Panels/SpellPanel.gmodel
|
||||
Made changes to nextKeyView so that the user can tab between
|
||||
the buttons
|
||||
|
||||
* Source/NSBrowser.m [NSBrowser keyDown:] added check after call to
|
||||
[NSBrowser selectedColumn] so that the rest of the method is skipped
|
||||
if the value is -1 (no column selected). This was producing a
|
||||
segmentation fault.
|
||||
|
||||
* Source/NSTextView.m
|
||||
[NSTextView checkSpelling:] to call [NSSpellChecker
|
||||
checkSpellingOfString: startingAt:language:wrap:
|
||||
inSpellDocumentWithTag:wordCount:]
|
||||
so that the spell document tag can easily be passed in.
|
||||
|
||||
* Source/NSSpellChecker.m
|
||||
modified calls [NSSpellChecker _findNext:], [NSSpellChecker _ignore:]
|
||||
& [NSSpellChecker _correct] to get the first responder from the
|
||||
mainWindow instead of getting the text view directly.
|
||||
This is consistent with behavior observed under OPENSTEP4.2
|
||||
and allows the document being checked to be anywhere on the
|
||||
responder chain.
|
||||
|
||||
2001-08-02 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Headers/gnustep/gui/NSApplication.h: Remove duplicate
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
backgroundColor = "Object 8";
|
||||
backingType = 2;
|
||||
becomesKeyOnlyIfNeeded = NO;
|
||||
contentFrame = "{x=428.000000; y=164.000000; width=186.000000; height=304.000000}";
|
||||
contentFrame = "{x=311.000000; y=220.000000; width=186.000000; height=304.000000}";
|
||||
contentView = "Object 12";
|
||||
frameAutosaveName = nil;
|
||||
hidesOnDeactivate = YES;
|
||||
|
@ -654,7 +654,16 @@
|
|||
"Object 73",
|
||||
"Object 75",
|
||||
"Object 77",
|
||||
"Object 78"
|
||||
"Object 78",
|
||||
"Object 80",
|
||||
"Object 82",
|
||||
"Object 83",
|
||||
"Object 84",
|
||||
"Object 85",
|
||||
"Object 86",
|
||||
"Object 87",
|
||||
"Object 88",
|
||||
"Object 89"
|
||||
);
|
||||
isa = NSMutableArray;
|
||||
};
|
||||
|
@ -804,6 +813,61 @@
|
|||
source = "Object 11";
|
||||
};
|
||||
"Object 79" = {isa = NSString; string = initialFirstResponder; };
|
||||
"Object 80" = {
|
||||
destination = "Object 17";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 14";
|
||||
};
|
||||
"Object 81" = {isa = NSString; string = nextKeyView; };
|
||||
"Object 82" = {
|
||||
destination = "Object 22";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 17";
|
||||
};
|
||||
"Object 83" = {
|
||||
destination = "Object 19";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 22";
|
||||
};
|
||||
"Object 84" = {
|
||||
destination = "Object 28";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 30";
|
||||
};
|
||||
"Object 85" = {
|
||||
destination = "Object 21";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 28";
|
||||
};
|
||||
"Object 86" = {
|
||||
destination = "Object 34";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 21";
|
||||
};
|
||||
"Object 87" = {
|
||||
destination = "Object 14";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 34";
|
||||
};
|
||||
"Object 88" = {
|
||||
destination = "Object 30";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 32";
|
||||
};
|
||||
"Object 89" = {
|
||||
destination = "Object 32";
|
||||
isa = IMOutletConnector;
|
||||
label = "Object 81";
|
||||
source = "Object 24";
|
||||
};
|
||||
RootObject = {Connections = "Object 38"; Objects = "Object 1"; isa = GMModel; };
|
||||
TopLevelObjects = (RootObject);
|
||||
Version = 1;
|
||||
|
|
|
@ -2474,77 +2474,79 @@ static double rint(double a)
|
|||
IMP lcarc = [self methodForSelector: lcarcSel];
|
||||
|
||||
selectedColumn = [self selectedColumn];
|
||||
bc = [_browserColumns objectAtIndex:
|
||||
selectedColumn];
|
||||
matrix = [bc columnMatrix];
|
||||
n = [matrix numberOfRows];
|
||||
s = [matrix selectedRow];
|
||||
|
||||
if (!_charBuffer)
|
||||
if(selectedColumn != -1)
|
||||
{
|
||||
_charBuffer = [characters substringToIndex: 1];
|
||||
RETAIN(_charBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (([theEvent timestamp] - _lastKeyPressed < 2000.0)
|
||||
&& (_alphaNumericalLastColumn == selectedColumn))
|
||||
bc = [_browserColumns objectAtIndex:
|
||||
selectedColumn];
|
||||
matrix = [bc columnMatrix];
|
||||
n = [matrix numberOfRows];
|
||||
s = [matrix selectedRow];
|
||||
|
||||
if (!_charBuffer)
|
||||
{
|
||||
NSString *transition;
|
||||
transition = [_charBuffer
|
||||
stringByAppendingString:
|
||||
[characters substringToIndex: 1]];
|
||||
RELEASE(_charBuffer);
|
||||
_charBuffer = transition;
|
||||
_charBuffer = [characters substringToIndex: 1];
|
||||
RETAIN(_charBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RELEASE(_charBuffer);
|
||||
_charBuffer = [characters substringToIndex: 1];
|
||||
RETAIN(_charBuffer);
|
||||
if (([theEvent timestamp] - _lastKeyPressed < 2000.0)
|
||||
&& (_alphaNumericalLastColumn == selectedColumn))
|
||||
{
|
||||
NSString *transition;
|
||||
transition = [_charBuffer
|
||||
stringByAppendingString:
|
||||
[characters substringToIndex: 1]];
|
||||
RELEASE(_charBuffer);
|
||||
_charBuffer = transition;
|
||||
RETAIN(_charBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RELEASE(_charBuffer);
|
||||
_charBuffer = [characters substringToIndex: 1];
|
||||
RETAIN(_charBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_alphaNumericalLastColumn = selectedColumn;
|
||||
_lastKeyPressed = [theEvent timestamp];
|
||||
|
||||
sv = [((*lcarc)(self, lcarcSel, s, selectedColumn))
|
||||
stringValue];
|
||||
|
||||
if (([sv length] > 0)
|
||||
&& ([sv hasPrefix: _charBuffer]))
|
||||
return;
|
||||
|
||||
for (i = s+1; i < n; i++)
|
||||
{
|
||||
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
|
||||
|
||||
_alphaNumericalLastColumn = selectedColumn;
|
||||
_lastKeyPressed = [theEvent timestamp];
|
||||
|
||||
sv = [((*lcarc)(self, lcarcSel, s, selectedColumn))
|
||||
stringValue];
|
||||
|
||||
if (([sv length] > 0)
|
||||
&& ([sv hasPrefix: _charBuffer]))
|
||||
return;
|
||||
|
||||
for (i = s+1; i < n; i++)
|
||||
{
|
||||
[self selectRow: i
|
||||
inColumn: selectedColumn];
|
||||
[matrix scrollCellToVisibleAtRow: i column: 0];
|
||||
[matrix performClick: self];
|
||||
return;
|
||||
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
|
||||
stringValue];
|
||||
if (([sv length] > 0)
|
||||
&& ([sv hasPrefix: _charBuffer]))
|
||||
{
|
||||
[self selectRow: i
|
||||
inColumn: selectedColumn];
|
||||
[matrix scrollCellToVisibleAtRow: i column: 0];
|
||||
[matrix performClick: self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < s; i++)
|
||||
{
|
||||
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
|
||||
stringValue];
|
||||
if (([sv length] > 0)
|
||||
&& ([sv hasPrefix: _charBuffer]))
|
||||
{
|
||||
[self selectRow: i
|
||||
inColumn: selectedColumn];
|
||||
[matrix scrollCellToVisibleAtRow: i column: 0];
|
||||
[matrix performClick: self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < s; i++)
|
||||
{
|
||||
sv = [((*lcarc)(self, lcarcSel, i, selectedColumn))
|
||||
stringValue];
|
||||
if (([sv length] > 0)
|
||||
&& ([sv hasPrefix: _charBuffer]))
|
||||
{
|
||||
[self selectRow: i
|
||||
inColumn: selectedColumn];
|
||||
[matrix scrollCellToVisibleAtRow: i column: 0];
|
||||
[matrix performClick: self];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
_lastKeyPressed = 0.;
|
||||
}
|
||||
|
||||
|
|
|
@ -333,9 +333,7 @@ static int __documentTag = 0;
|
|||
{
|
||||
int wordCount = 0;
|
||||
NSRange r = NSMakeRange(0,0);
|
||||
id responder = [[[[NSApplication sharedApplication] mainWindow] contentView] documentView];
|
||||
|
||||
_currentTag = [responder spellCheckerDocumentTag];
|
||||
|
||||
r = [self checkSpellingOfString: stringToCheck
|
||||
startingAt: startingOffset
|
||||
language: _language
|
||||
|
@ -505,7 +503,7 @@ inSpellDocumentWithTag:(int)tag
|
|||
- _findNext: (id)sender
|
||||
{
|
||||
BOOL processed = NO;
|
||||
id responder = [[[[NSApplication sharedApplication] mainWindow] contentView] documentView];
|
||||
id responder = [[[NSApplication sharedApplication] mainWindow] firstResponder];
|
||||
|
||||
processed = [responder tryToPerform: @selector(checkSpelling:)
|
||||
with: _spellPanel];
|
||||
|
@ -565,7 +563,7 @@ inSpellDocumentWithTag:(int)tag
|
|||
- _ignore: (id)sender
|
||||
{
|
||||
BOOL processed = NO;
|
||||
id responder = [[[[NSApplication sharedApplication] mainWindow] contentView] documentView];
|
||||
id responder = [[[NSApplication sharedApplication] mainWindow] firstResponder];
|
||||
|
||||
processed = [responder tryToPerform: @selector(ignoreSpelling:)
|
||||
with: _wordField];
|
||||
|
@ -589,7 +587,7 @@ inSpellDocumentWithTag:(int)tag
|
|||
- _correct: (id)sender
|
||||
{
|
||||
BOOL processed = NO;
|
||||
id responder = [[[[NSApplication sharedApplication] mainWindow] contentView] documentView];
|
||||
id responder = [[[NSApplication sharedApplication] mainWindow] firstResponder];
|
||||
|
||||
processed = [responder tryToPerform: @selector(changeSpelling:)
|
||||
with: _wordField];
|
||||
|
@ -648,6 +646,17 @@ inSpellDocumentWithTag:(int)tag
|
|||
[[NSApp _listener] _languagesForPopUpButton]];
|
||||
[_accessoryView setDelegate: self];
|
||||
[_accessoryView setDoubleAction: @selector(_correct:)];
|
||||
|
||||
[_findNextButton setKeyEquivalent: @"n"];
|
||||
[_ignoreButton setKeyEquivalent: @"i"];
|
||||
[_learnButton setKeyEquivalent: @"l"];
|
||||
[_forgetButton setKeyEquivalent: @"f"];
|
||||
[_guessButton setKeyEquivalent: @"g"];
|
||||
[_correctButton setKeyEquivalent: @"c"];
|
||||
[_correctButton setImagePosition: NSImageRight];
|
||||
[_correctButton setImage: [NSImage imageNamed: @"common_ret"]];
|
||||
[_correctButton setAlternateImage: [NSImage imageNamed: @"common_retH"]];
|
||||
[_spellPanel makeFirstResponder: _correctButton];
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -813,11 +813,15 @@ static NSNotificationCenter *nc;
|
|||
- (void) checkSpelling: (id)sender
|
||||
{
|
||||
NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker];
|
||||
|
||||
NSRange errorRange;
|
||||
int count = 0;
|
||||
|
||||
errorRange = [sp checkSpellingOfString: [_textStorage string]
|
||||
startingAt: NSMaxRange (_selected_range)];
|
||||
errorRange = [sp checkSpellingOfString: [self string]
|
||||
startingAt: NSMaxRange (_selected_range)
|
||||
language: [sp language]
|
||||
wrap: YES
|
||||
inSpellDocumentWithTag: [self spellCheckerDocumentTag]
|
||||
wordCount: &count];
|
||||
|
||||
if (errorRange.length)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue