Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix for left/right cursors in CPBrowser #1663

Merged
merged 1 commit into from Feb 10, 2013
Jump to file or symbol
Failed to load files and symbols.
+18 −27
Split
View
@@ -425,11 +425,26 @@
- (void)keyDown:(CPEvent)anEvent
{
- var column = [self selectedColumn];
- if (column === -1)
+ var key = [anEvent charactersIgnoringModifiers],
+ column = [self selectedColumn];
+
+ if (column === CPNotFound)
return;
- [_tableViews[column] keyDown:anEvent];
+ if (key === CPLeftArrowFunctionKey || key === CPRightArrowFunctionKey)
+ {
+ if (key === CPLeftArrowFunctionKey)
+ {
+ var previousColumn = column - 1,
+ selectedRow = [self selectedRowInColumn:previousColumn];
+
+ [self selectRow:selectedRow inColumn:previousColumn];
+ }
+ else
+ [self selectRow:0 inColumn:column + 1];
+ }
+ else
+ [_tableViews[column] keyDown:anEvent];
}
// SIZING
@@ -838,30 +853,6 @@ var _CPBrowserResizeControlBackgroundImage = nil;
[super dragViewForRowsWithIndexes:dragRows tableColumns:theTableColumns event:dragEvent offset:dragViewOffset];
}
-- (void)moveUp:(id)sender
-{
- [super moveUp:sender];
- [_browser selectRow:[self selectedRow] inColumn:[_browser selectedColumn]];
-}
-
-- (void)moveDown:(id)sender
-{
- [super moveDown:sender];
- [_browser selectRow:[self selectedRow] inColumn:[_browser selectedColumn]];
-}
-
-- (void)moveLeft:(id)sender
-{
- var previousColumn = [_browser selectedColumn] - 1,
- selectedRow = [_browser selectedRowInColumn:previousColumn];
-
- [_browser selectRow:selectedRow inColumn:previousColumn];
-}
-
-- (void)moveRight:(id)sender
-{
- [_browser selectRow:0 inColumn:[_browser selectedColumn] + 1];
-}
@end