mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Add basic implementation for more action methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33272 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
50c93b82e2
commit
ae4392c882
2 changed files with 125 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
2011-06-10 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSTextView_actions.m (-moveLeftAndModifySelection:,
|
||||
-moveRightAndModifySelection:, -moveWordLeft:,
|
||||
-moveWordLeftAndModifySelection:, -moveWordRight:,
|
||||
-moveWordRightAndModifySelection:, -setBaseWritingDirection:range:):
|
||||
Add basic implementation for these methods.
|
||||
|
||||
2011-06-09 13:49-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/GSTheme.m: Move notifications handling code to
|
||||
|
|
|
@ -986,6 +986,25 @@ check if there was a reason for that.
|
|||
}
|
||||
}
|
||||
|
||||
- (void) moveLeftAndModifySelection: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveForwardAndModifySelection: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveBackwardAndModifySelection: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveRight: (id)sender
|
||||
{
|
||||
NSRange range = [self selectedRange];
|
||||
|
@ -1006,6 +1025,24 @@ check if there was a reason for that.
|
|||
}
|
||||
}
|
||||
|
||||
- (void) moveRightAndModifySelection: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveBackwardAndModifySelection: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveForwardAndModifySelection: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveBackward: (id)sender
|
||||
{
|
||||
|
@ -1100,6 +1137,82 @@ check if there was a reason for that.
|
|||
select: YES];
|
||||
}
|
||||
|
||||
- (void) moveWordLeft: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveWordForward: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveWordBackward: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveWordLeftAndModifySelection: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveWordForwardAndModifySelection: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveWordBackwardAndModifySelection: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveWordRight: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveWordBackward: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveWordForward: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveWordRightAndModifySelection: (id)sender
|
||||
{
|
||||
NSParagraphStyle *parStyle;
|
||||
NSWritingDirection writingDirection;
|
||||
|
||||
parStyle = [[self typingAttributes]
|
||||
objectForKey: NSParagraphStyleAttributeName];
|
||||
writingDirection = [parStyle baseWritingDirection];
|
||||
|
||||
if (writingDirection == NSWritingDirectionRightToLeft)
|
||||
{
|
||||
[self moveWordBackwardAndModifySelection: sender];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self moveWordForwardAndModifySelection: sender];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) moveToBeginningOfDocument: (id)sender
|
||||
{
|
||||
[self _moveTo: 0
|
||||
|
@ -1563,7 +1676,10 @@ and layout is left-to-right */
|
|||
- (void) setBaseWritingDirection: (NSWritingDirection)direction
|
||||
range: (NSRange)range
|
||||
{
|
||||
// FIXME
|
||||
if (!_tf.is_rich_text)
|
||||
return;
|
||||
|
||||
[_textStorage setBaseWritingDirection: direction range: range];
|
||||
}
|
||||
|
||||
- (void) toggleBaseWritingDirection: (id)sender
|
||||
|
|
Loading…
Reference in a new issue