Commit 56fdc7dc authored by darin's avatar darin

Tools:

        * Scripts/update-alex-localizable-strings: Fix it so that the line
	numbers in error messages will be accurate.

WebCore:

	- fixed 3027460 -- text areas don't have focus rectangles
	- fixed 2937204 -- text areas have solid black borders

        * kwq/KWQSignal.mm: (KWQSignal::disconnect):
	Add a special case so we don't hear about finishedParsing all the time.

        * kwq/KWQTextArea.mm:
        (-[KWQTextArea initWithFrame:]): Use a bezel border, not a line border.
        (-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix bug where it would
	return a bogus value for an empty text area.
        (-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Use setSelectedRange:
	ratherr than setMarkedText:selectedRange:.
        (-[KWQTextArea drawRect:]): Draw a focus ring if our text view is first responder.
        (-[KWQTextArea _KWQ_setKeyboardFocusRingNeedsDisplay]): Added.
        (-[KWQTextAreaTextView becomeFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
        (-[KWQTextAreaTextView resignFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
        (-[NSView _KWQ_setKeyboardFocusRingNeedsDisplay]): Calls the same thing on parent.

        * WebCore.pbproj/project.pbxproj: PB is a cruel master.

WebBrowser:

	- fixed problem I introduced where text would get too close to the right button

        * LocationTextField.m: (-[LocationTextField didShowOrHideRightButton]):
	Add back logic to adjust the right border. I removed this because it was incompatible
	with my changes, but now I made a new compatible version by adding a new method.

        * TextFieldWithControls.h: Rename showRightButton: to setIsShowingRightButton:,
	and added isShowingRightButton, and didShowOrHideRightButton methods.
        * TextFieldWithControls.m:
        (-[TextFieldWithControls isShowingRightButton]): Added.
        (-[TextFieldWithControls didShowOrHideRightButton]): Added.
        (-[TextFieldWithControls setIsShowingRightButton:]): Call didShowOrHideRightButton at
	the right moment so we can properly respond to any changes it makes to the cell.

        * BrowserWindowController.m: (-[BrowserWindowController updateSnapBackButtons]):
	Update for method name change.

        * WebBrowser.pbproj/project.pbxproj: PB is a cruel master.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4e042174
2002-11-15 Darin Adler <darin@apple.com>
- fixed 3027460 -- text areas don't have focus rectangles
- fixed 2937204 -- text areas have solid black borders
* kwq/KWQSignal.mm: (KWQSignal::disconnect):
Add a special case so we don't hear about finishedParsing all the time.
* kwq/KWQTextArea.mm:
(-[KWQTextArea initWithFrame:]): Use a bezel border, not a line border.
(-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix bug where it would
return a bogus value for an empty text area.
(-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Use setSelectedRange:
ratherr than setMarkedText:selectedRange:.
(-[KWQTextArea drawRect:]): Draw a focus ring if our text view is first responder.
(-[KWQTextArea _KWQ_setKeyboardFocusRingNeedsDisplay]): Added.
(-[KWQTextAreaTextView becomeFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[KWQTextAreaTextView resignFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[NSView _KWQ_setKeyboardFocusRingNeedsDisplay]): Calls the same thing on parent.
* WebCore.pbproj/project.pbxproj: PB is a cruel master.
2002-11-15 Maciej Stachowiak <mjs@apple.com>
* khtml/html/html_formimpl.cpp:
......
2002-11-15 Darin Adler <darin@apple.com>
- fixed 3027460 -- text areas don't have focus rectangles
- fixed 2937204 -- text areas have solid black borders
* kwq/KWQSignal.mm: (KWQSignal::disconnect):
Add a special case so we don't hear about finishedParsing all the time.
* kwq/KWQTextArea.mm:
(-[KWQTextArea initWithFrame:]): Use a bezel border, not a line border.
(-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix bug where it would
return a bogus value for an empty text area.
(-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Use setSelectedRange:
ratherr than setMarkedText:selectedRange:.
(-[KWQTextArea drawRect:]): Draw a focus ring if our text view is first responder.
(-[KWQTextArea _KWQ_setKeyboardFocusRingNeedsDisplay]): Added.
(-[KWQTextAreaTextView becomeFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[KWQTextAreaTextView resignFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[NSView _KWQ_setKeyboardFocusRingNeedsDisplay]): Calls the same thing on parent.
* WebCore.pbproj/project.pbxproj: PB is a cruel master.
2002-11-15 Maciej Stachowiak <mjs@apple.com>
* khtml/html/html_formimpl.cpp:
......
2002-11-15 Darin Adler <darin@apple.com>
- fixed 3027460 -- text areas don't have focus rectangles
- fixed 2937204 -- text areas have solid black borders
* kwq/KWQSignal.mm: (KWQSignal::disconnect):
Add a special case so we don't hear about finishedParsing all the time.
* kwq/KWQTextArea.mm:
(-[KWQTextArea initWithFrame:]): Use a bezel border, not a line border.
(-[KWQTextArea getCursorPositionAsIndex:inParagraph:]): Fix bug where it would
return a bogus value for an empty text area.
(-[KWQTextArea setCursorPositionToIndex:inParagraph:]): Use setSelectedRange:
ratherr than setMarkedText:selectedRange:.
(-[KWQTextArea drawRect:]): Draw a focus ring if our text view is first responder.
(-[KWQTextArea _KWQ_setKeyboardFocusRingNeedsDisplay]): Added.
(-[KWQTextAreaTextView becomeFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[KWQTextAreaTextView resignFirstResponder]): Call _KWQ_setKeyboardFocusRingNeedsDisplay.
(-[NSView _KWQ_setKeyboardFocusRingNeedsDisplay]): Calls the same thing on parent.
* WebCore.pbproj/project.pbxproj: PB is a cruel master.
2002-11-15 Maciej Stachowiak <mjs@apple.com>
* khtml/html/html_formimpl.cpp:
......
......@@ -72,6 +72,7 @@
F58C8A07025BD3BC018635CA,
F531DDEC02F0C34D018635CA,
);
hasScannedForEncodings = 1;
isa = PBXProject;
knownRegions = (
English,
......
......@@ -65,7 +65,8 @@ void KWQSignal::connect(const KWQSlot &slot)
void KWQSignal::disconnect(const KWQSlot &slot)
{
#if !ERROR_DISABLED
if (!_slots.contains(slot)) {
if (!_slots.contains(slot)
&& !KWQNamesMatch(_name, SIGNAL(finishedParsing()))) {
ERROR("disconnecting a signal that wasn't connected, %s", _name);
}
#endif
......
......@@ -49,6 +49,10 @@
to construct the text with inserted \n.
*/
@interface NSView (KWQTextArea)
- (void)_KWQ_setKeyboardFocusRingNeedsDisplay;
@end
@interface KWQTextAreaTextView : NSTextView
{
}
......@@ -97,7 +101,7 @@ const float LargeNumberForText = 1.0e7;
[self setHasVerticalScroller:YES];
[self setHasHorizontalScroller:NO];
[self setBorderType:NSLineBorder];
[self setBorderType:NSBezelBorder];
[self _createTextView];
......@@ -163,7 +167,6 @@ const float LargeNumberForText = 1.0e7;
wrap = f;
}
- (BOOL)wordWrap
{
return wrap;
......@@ -171,7 +174,9 @@ const float LargeNumberForText = 1.0e7;
- (void)setText:(NSString *)s
{
//NSLog(@"extraLineFragmentTextContainer before setString: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
[textView setString:s];
//NSLog(@"extraLineFragmentTextContainer after setString: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
}
- (NSString *)text
......@@ -187,7 +192,7 @@ const float LargeNumberForText = 1.0e7;
unsigned numberOfGlyphs = [layoutManager numberOfGlyphs];
while (NSMaxRange(glyphRange) < numberOfGlyphs) {
(void)[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
characterRange = [layoutManager characterRangeForGlyphRange:glyphRange actualGlyphRange:NULL];
if (line == lineCount) {
return [[[textView textStorage] attributedSubstringFromRange:characterRange] string];
......@@ -205,7 +210,7 @@ const float LargeNumberForText = 1.0e7;
int lineCount = 0;
while (NSMaxRange(glyphRange) < numberOfGlyphs) {
(void)[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
lineCount++;
}
return lineCount;
......@@ -228,21 +233,16 @@ const float LargeNumberForText = 1.0e7;
- (void)setFrame:(NSRect)frameRect
{
NSRect textFrame;
NSSize contentSize;
[super setFrame:frameRect];
if ([self wordWrap]){
contentSize = [NSScrollView contentSizeForFrameSize:frameRect.size hasHorizontalScroller:[self hasHorizontalScroller] hasVerticalScroller:[self hasVerticalScroller] borderType:[self borderType]];
textFrame = [textView frame];
if ([self wordWrap]) {
NSSize contentSize = [NSScrollView contentSizeForFrameSize:frameRect.size hasHorizontalScroller:[self hasHorizontalScroller] hasVerticalScroller:[self hasVerticalScroller] borderType:[self borderType]];
NSRect textFrame = [textView frame];
textFrame.size.width = contentSize.width;
contentSize.height = LargeNumberForText;
[textView setFrame: textFrame];
[[textView textContainer] setContainerSize: contentSize];
[textView setFrame:textFrame];
[[textView textContainer] setContainerSize:contentSize];
}
//if (frameRect.size.width > 0 && frameRect.size.height > 0 && textView == nil)
// [self _createTextView];
}
- (int)paragraphs
......@@ -350,7 +350,7 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
int lineCount = 0;
while (NSMaxRange(glyphRange) < numberOfGlyphs) {
(void)[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
[layoutManager lineFragmentRectForGlyphAtIndex:NSMaxRange(glyphRange) effectiveRange:&glyphRange];
lineCount++;
}
......@@ -362,24 +362,30 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
NSString *text = [textView string];
NSRange selectedRange = [textView selectedRange];
if (selectedRange.location == NSNotFound) {
*index = 0;
*paragraph = 0;
} else {
int num = [self paragraphs];
int i;
NSRange range;
for (i = 0; i < num; i++) {
range = RangeOfParagraph(text, i);
if (range.location + range.length > selectedRange.location) {
break;
}
}
*index = 0;
*paragraph = 0;
*paragraph = num;
*index = selectedRange.location - range.location;
if (selectedRange.location == NSNotFound) {
return;
}
int num = [self paragraphs];
if (num == 0) {
return;
}
int i;
NSRange range;
for (i = 0; i < num; i++) {
range = RangeOfParagraph(text, i);
if (range.location + range.length > selectedRange.location) {
break;
}
}
*paragraph = num;
*index = selectedRange.location - range.location;
}
- (void)setCursorPositionToIndex:(int)index inParagraph:(int)paragraph
......@@ -387,15 +393,17 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
NSString *text = [textView string];
NSRange range = RangeOfParagraph(text, paragraph);
if (range.location == NSNotFound) {
[textView setMarkedText:@"" selectedRange:NSMakeRange([text length], 0)];
[textView setSelectedRange:NSMakeRange([text length], 0)];
} else {
[textView setMarkedText:@"" selectedRange:NSMakeRange(range.location + index, 0)];
[textView setSelectedRange:NSMakeRange(range.location + index, 0)];
}
}
- (void)setFont:(NSFont *)font
{
//NSLog(@"extraLineFragmentTextContainer before setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
[textView setFont:font];
//NSLog(@"extraLineFragmentTextContainer after setFont: is %@", [[textView layoutManager] extraLineFragmentTextContainer]);
}
- (BOOL)becomeFirstResponder
......@@ -440,6 +448,20 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
return YES;
}
- (void)drawRect:(NSRect)rect
{
[super drawRect:rect];
if ([[self window] firstResponder] == textView) {
NSSetFocusRingStyle(NSFocusRingOnly);
NSRectFill([self bounds]);
}
}
- (void)_KWQ_setKeyboardFocusRingNeedsDisplay
{
[self setKeyboardFocusRingNeedsDisplayInRect:[self bounds]];
}
@end
@implementation KWQTextAreaTextView
......@@ -464,6 +486,14 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
{
[super becomeFirstResponder];
[self selectAll:nil];
[self _KWQ_setKeyboardFocusRingNeedsDisplay];
return YES;
}
- (BOOL)resignFirstResponder
{
[super resignFirstResponder];
[self _KWQ_setKeyboardFocusRingNeedsDisplay];
return YES;
}
......@@ -498,3 +528,12 @@ static NSRange RangeOfParagraph(NSString *text, int paragraph)
}
@end
@implementation NSView (KWQTextArea)
- (void)_KWQ_setKeyboardFocusRingNeedsDisplay
{
[[self superview] _KWQ_setKeyboardFocusRingNeedsDisplay];
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment