Changeset 279

Show
Ignore:
Timestamp:
01/01/08 18:31:04 (1 year ago)
Author:
wolf
Message:

[NEW] JRShellView: finish off all command selector TODOs and add spreadsheet listing arrow-keys-to-NSText-selector-mapping.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cocoa/JRShellView/JRShellView.m

    r278 r279  
    55 
    66        ***************************************************************************/ 
     7 
     8// Note the CommandsWeJustLetPassThrough section is mostly just to document I've 
     9// considered these methods and decided their default behavior is acceptable. 
    710 
    811#import "JRShellView.h" 
     
    1922- (IBAction)pageUpAndModifySelection:(id)sender; 
    2023- (IBAction)pageDownAndModifySelection:(id)sender; 
     24- (IBAction)moveToBeginningOfParagraphAndModifySelection:(id)sender; 
    2125@end 
    2226 
     
    162166#ifdef CommandsWeJustLetPassThrough 
    163167- (void)scrollPageUp:(id)sender_ { // ctl-up, ctl-shift-up, pageUp 
    164         NSLog(@"TODO scrollPageUp:"); 
    165168        [super scrollPageUp:sender_]; 
    166169} 
     
    170173        [super moveLeft:sender_]; // Implement in terms of moveLeft. 
    171174} 
    172 - (void)moveToBeginningOfParagraph:(id)sender_ { // opt-up (moveBackward: + moveToBeginningOfParagraph:) 
    173         NSLog(@"TODO moveBackward: + moveToBeginningOfParagraph:"); 
    174         [super moveToBeginningOfParagraph:sender_]; 
     175- (void)moveToBeginningOfParagraph:(id)sender_ { // ctl-a; opt-up (moveBackward: + moveToBeginningOfParagraph:) 
     176    if ([self selectionIsInImmutableSection]) { 
     177        [super moveToBeginningOfParagraph:sender_]; 
     178    } else { 
     179        [self setSelectedRange:NSMakeRange(commandStart, 0)]; // We're line-oriented, so treat it like cmd-left. 
     180    } 
     181
     182- (void)moveToBeginningOfParagraphAndModifySelection:(id)sender_ { // ctl-shift-a; opt-shift-up (deleteBackward: + moveToBeginningOfParagraphAndModifySelection:) 
     183    if ([self selectionIsInImmutableSection]) { 
     184        [super moveToBeginningOfParagraphAndModifySelection:sender_]; 
     185    } else { 
     186        // We're line-oriented, so treat it like cmd-shift-left. 
     187        unsigned oldSelectionLocation = [self selectedRange].location; 
     188        [self setSelectedRange:NSMakeRange(commandStart, (oldSelectionLocation - commandStart))]; 
     189    } 
    175190} 
    176191- (void)moveUpAndModifySelection:(id)sender_ { // shift-up 
    177         NSLog(@"TODO moveUpAndModifySelection:"); 
    178         [super moveUpAndModifySelection:sender_]; 
     192    if ([self selectionIsInImmutableSection]) { 
     193        [super moveUpAndModifySelection:sender_]; 
     194    } else { 
     195        [self moveUp:sender_]; // Treat like a normal up. 
     196    } 
    179197} 
    180198- (void)moveParagraphBackwardAndModifySelection:(id)sender_ { // opt-shift-up 
    181         NSLog(@"TODO moveParagraphBackwardAndModifySelection:"); 
    182         [super moveParagraphBackwardAndModifySelection:sender_]; 
     199    if ([self selectionIsInImmutableSection]) { 
     200        [super moveParagraphBackwardAndModifySelection:sender_]; 
     201    } else { 
     202        [self moveUp:sender_]; // Treat like a normal up. 
     203    } 
    183204} 
    184205- (void)moveToBeginningOfDocument:(id)sender_ { // cmd-up 
    185         NSLog(@"TODO moveToBeginningOfDocument:"); 
    186         [super moveToBeginningOfDocument:sender_]; 
     206    if ([self selectionIsInImmutableSection]) { 
     207        [super moveToBeginningOfDocument:sender_]; 
     208    } else { 
     209        [self moveUp:sender_]; // Treat like a normal up. 
     210    } 
    187211} 
    188212- (void)moveToBeginningOfDocumentAndModifySelection:(id)sender_ { // cmd-shift-up 
    189         NSLog(@"TODO moveToBeginningOfDocumentAndModifySelection:"); 
    190         [super moveToBeginningOfDocumentAndModifySelection:sender_]; 
     213    if ([self selectionIsInImmutableSection]) { 
     214        [super moveToBeginningOfDocumentAndModifySelection:sender_]; 
     215    } else { 
     216        [self moveUp:sender_]; // Treat like a normal up. 
     217    } 
    191218} 
    192219 
     
    220247    } 
    221248} 
     249 
     250#ifdef CommandsWeJustLetPassThrough 
    222251- (void)scrollPageDown:(id)sender_ { // ctl-down, ctl-shift-down, pageDown 
    223         NSLog(@"TODO scrollPageDown:"); 
    224252        [super scrollPageDown:sender_]; 
    225253} 
     
    227255        [super moveRight:sender_]; // Implement in terms of moveRight. 
    228256} 
    229 - (void)moveToEndOfParagraph:(id)sender_ { // opt-down (moveForward: + moveToEndOfParagraph:) 
    230         NSLog(@"TODO moveForward: + moveToEndOfParagraph:"); 
     257- (void)moveToEndOfParagraph:(id)sender_ { // ctl-e; opt-down (moveForward: + moveToEndOfParagraph:) 
    231258        [super moveToEndOfParagraph:sender_]; 
    232259} 
    233260- (void)moveDownAndModifySelection:(id)sender_ { // shift-down 
    234         NSLog(@"TODO moveDownAndModifySelection:"); 
    235261        [super moveDownAndModifySelection:sender_]; 
    236262} 
    237263- (void)moveParagraphForwardAndModifySelection:(id)sender_ { // opt-shift-down 
    238         NSLog(@"TODO moveParagraphForwardAndModifySelection:"); 
    239264        [super moveParagraphForwardAndModifySelection:sender_]; 
    240265} 
    241  
    242 #ifdef CommandsWeJustLetPassThrough 
    243266- (void)moveToEndOfDocument:(id)sender_ { // cmd-down 
    244         NSLog(@"TODO moveToEndOfDocument:"); 
    245267        [super moveToEndOfDocument:sender_]; 
    246268} 
    247 #endif 
    248  
    249269- (void)moveToEndOfDocumentAndModifySelection:(id)sender_ { // cmd-shift-down 
    250         NSLog(@"TODO moveToEndOfDocumentAndModifySelection:"); 
    251270        [super moveToEndOfDocumentAndModifySelection:sender_]; 
    252271} 
     272#endif 
    253273 
    254274#pragma mark Left 
     
    306326 
    307327#ifdef CommandsWeJustLetPassThrough 
    308  
    309328- (void)moveRight:(id)sender_ { // right 
    310         NSLog(@"TODO moveRight:"); 
    311329        [super moveRight:sender_]; 
    312330} 
    313331- (void)moveToEndOfLine:(id)sender_ { // ctl-right, cmd-right 
    314         NSLog(@"TODO moveToEndOfLine:"); 
     332    // TODO implement moveSubWordForeward: on ctl-right. 
    315333        [super moveToEndOfLine:sender_]; 
    316334} 
    317335- (void)moveWordRight:(id)sender_ { // opt-right 
    318         NSLog(@"TODO moveWordRight:"); 
    319336        [super moveWordRight:sender_]; 
    320337} 
    321338- (void)moveRightAndModifySelection:(id)sender_ { // shift-right 
    322         NSLog(@"TODO moveRightAndModifySelection:"); 
    323339        [super moveRightAndModifySelection:sender_]; 
    324340} 
    325341- (void)moveToEndOfLineAndModifySelection:(id)sender_ { // ctl-shift-right, cmd-shift-right 
    326         NSLog(@"TODO moveToEndOfLineAndModifySelection:"); 
    327342        [super moveToEndOfLineAndModifySelection:sender_]; 
    328343} 
    329344- (void)moveWordRightAndModifySelection:(id)sender_ { // opt-shift-right 
    330         NSLog(@"TODO moveWordRightAndModifySelection:"); 
    331345        [super moveWordRightAndModifySelection:sender_]; 
    332346} 
    333  
    334347#endif 
    335348 
     
    342355} 
    343356 
     357#pragma mark pageUp 
     358 
    344359#ifdef CommandsWeJustLetPassThrough 
    345  
    346 #pragma mark pageUp 
    347  
    348360- (void)pageUp:(id)sender_ { // opt-pageUp, opt-shift-pageUp 
    349         NSLog(@"TODO pageUp:"); 
    350         [super pageUp:sender_]; 
    351 
     361    [super pageUp:sender_]; 
     362
     363#endif 
     364 
    352365- (void)pageUpAndModifySelection:(id)sender_ { // shift-pageUp 
    353         NSLog(@"TODO pageUpAndModifySelection:"); 
    354         [super pageUpAndModifySelection:sender_]; 
     366    if ([self selectionIsInImmutableSection]) { 
     367        [super pageUpAndModifySelection:sender_]; 
     368    } else { 
     369        //  Treat like like cmd-shift-left. 
     370        unsigned oldSelectionLocation = [self selectedRange].location; 
     371        [self setSelectedRange:NSMakeRange(commandStart, (oldSelectionLocation - commandStart))]; 
     372    } 
    355373} 
    356374 
    357375#pragma mark pageDown 
    358376 
     377#ifdef CommandsWeJustLetPassThrough 
    359378- (void)pageDown:(id)sender_ { // opt-pageDown, opt-shift-pageDown 
    360         NSLog(@"TODO pageDown:"); 
    361379        [super pageDown:sender_]; 
    362380} 
    363381- (void)pageDownAndModifySelection:(id)sender_ { // shift-pageDown 
    364         NSLog(@"TODO pageDownAndModifySelection:"); 
    365382        [super pageDownAndModifySelection:sender_]; 
    366383} 
    367  
    368384#endif 
    369385 
  • trunk/cocoa/JRShellView/JRShellViewDemo/JRShellViewDemo.xcodeproj/wolf.mode1v3

    r277 r279  
    198198        <array/> 
    199199        <key>OpenEditors</key> 
    200         <array/> 
     200        <array> 
     201                <dict> 
     202                        <key>Content</key> 
     203                        <dict> 
     204                                <key>PBXProjectModuleGUID</key> 
     205                                <string>794BBC430D2B6590008D059A</string> 
     206                                <key>PBXProjectModuleLabel</key> 
     207                                <string>JRShellView.m</string> 
     208                                <key>PBXSplitModuleInNavigatorKey</key> 
     209                                <dict> 
     210                                        <key>Split0</key> 
     211                                        <dict> 
     212                                                <key>PBXProjectModuleGUID</key> 
     213                                                <string>794BBC440D2B6590008D059A</string> 
     214                                                <key>PBXProjectModuleLabel</key> 
     215                                                <string>JRShellView.m</string> 
     216                                                <key>_historyCapacity</key> 
     217                                                <integer>0</integer> 
     218                                                <key>bookmark</key> 
     219                                                <string>794BBC460D2B6590008D059A</string> 
     220                                                <key>history</key> 
     221                                                <array> 
     222                                                        <string>794BBC450D2B6590008D059A</string> 
     223                                                </array> 
     224                                        </dict> 
     225                                        <key>SplitCount</key> 
     226                                        <string>1</string> 
     227                                </dict> 
     228                                <key>StatusBarVisibility</key> 
     229                                <true/> 
     230                        </dict> 
     231                        <key>Geometry</key> 
     232                        <dict> 
     233                                <key>Frame</key> 
     234                                <string>{{0, 20}, {1056, 1277}}</string> 
     235                                <key>PBXModuleWindowStatusBarHidden2</key> 
     236                                <false/> 
     237                                <key>RubberWindowFrame</key> 
     238                                <string>838 217 1056 1318 0 0 2560 1578 </string> 
     239                        </dict> 
     240                </dict> 
     241        </array> 
    201242        <key>PerspectiveWidths</key> 
    202243        <array> 
     
    383424                        <key>TableOfContents</key> 
    384425                        <array> 
    385                                 <string>79A4908A0D2B0460008FEBAE</string> 
     426                                <string>794BBC300D2B3355008D059A</string> 
    386427                                <string>1CE0B1FE06471DED0097A5F4</string> 
    387                                 <string>79A4908B0D2B0460008FEBAE</string> 
     428                                <string>794BBC310D2B3355008D059A</string> 
    388429                                <string>1CE0B20306471E060097A5F4</string> 
    389430                                <string>1CE0B20506471E060097A5F4</string> 
     
    519560        <key>WindowOrderList</key> 
    520561        <array> 
    521                 <string>1C78EAAD065D492600B07095</string> 
    522562                <string>1CD10A99069EF8BA00B06720</string> 
    523563                <string>79AEA9B00D29CC0E00A2C50F</string> 
    524                 <string>79A4909A0D2B0BD3008FEBAE</string> 
    525                 <string>79A4909B0D2B0BD3008FEBAE</string> 
     564                <string>1C78EAAD065D492600B07095</string> 
     565                <string>794BBC430D2B6590008D059A</string> 
    526566                <string>/Users/wolf/code/trac/cocoa/JRShellView/JRShellViewDemo/JRShellViewDemo.xcodeproj</string> 
    527567        </array> 
     
    604644                        <array> 
    605645                                <string>79AEA9B00D29CC0E00A2C50F</string> 
    606                                 <string>79A490920D2B0BD3008FEBAE</string> 
     646                                <string>794BBC320D2B3355008D059A</string> 
    607647                                <string>1CD0528F0623707200166675</string> 
    608648                                <string>XCMainBuildResultsModuleGUID</string> 
     
    646686                                                                                <key>sizes</key> 
    647687                                                                                <array> 
    648                                                                                         <string>{{0, 0}, {316, 201}}</string> 
    649                                                                                         <string>{{316, 0}, {378, 201}}</string> 
     688                                                                                        <string>{{0, 0}, {316, 202}}</string> 
     689                                                                                        <string>{{316, 0}, {378, 202}}</string> 
    650690                                                                                </array> 
    651691                                                                        </dict> 
     
    662702                                                                                <key>sizes</key> 
    663703                                                                                <array> 
    664                                                                                         <string>{{0, 0}, {694, 201}}</string> 
    665                                                                                         <string>{{0, 201}, {694, 180}}</string> 
     704                                                                                        <string>{{0, 0}, {694, 202}}</string> 
     705                                                                                        <string>{{0, 202}, {694, 179}}</string> 
    666706                                                                                </array> 
    667707                                                                        </dict> 
     
    696736                                                                        </array> 
    697737                                                                        <key>Frame</key> 
    698                                                                         <string>{{316, 0}, {378, 201}}</string> 
     738                                                                        <string>{{316, 0}, {378, 202}}</string> 
    699739                                                                        <key>RubberWindowFrame</key> 
    700740                                                                        <string>1319 1019 694 422 0 0 2560 1578 </string> 
     
    724764                        <array> 
    725765                                <string>1CD10A99069EF8BA00B06720</string> 
    726                                 <string>79A490930D2B0BD3008FEBAE</string> 
     766                                <string>794BBC330D2B3355008D059A</string> 
    727767                                <string>1C162984064C10D400B95A72</string> 
    728                                 <string>79A490940D2B0BD3008FEBAE</string> 
    729                                 <string>79A490950D2B0BD3008FEBAE</string> 
    730                                 <string>79A490960D2B0BD3008FEBAE</string> 
    731                                 <string>79A490970D2B0BD3008FEBAE</string> 
    732                                 <string>79A490980D2B0BD3008FEBAE</string> 
     768                                <string>794BBC340D2B3355008D059A</string> 
     769                                <string>794BBC350D2B3355008D059A</string> 
     770                                <string>794BBC360D2B3355008D059A</string> 
     771                                <string>794BBC370D2B3355008D059A</string> 
     772                                <string>794BBC380D2B3355008D059A</string> 
    733773                        </array> 
    734774                        <key>ToolbarConfiguration</key> 
     
    857897                                        <array> 
    858898                                                <dict> 
     899                                                        <key>BecomeActive</key> 
     900                                                        <true/> 
    859901                                                        <key>ContentConfiguration</key> 
    860902                                                        <dict> 
     
    869911                                                                <string>{{0, 0}, {650, 209}}</string> 
    870912                                                                <key>RubberWindowFrame</key> 
    871                                                                 <string>1744 1042 650 250 0 0 2560 1578 </string> 
     913                                                                <string>1895 1110 650 250 0 0 2560 1578 </string> 
    872914                                                        </dict> 
    873915                                                        <key>Module</key> 
     
    892934                        <array> 
    893935                                <string>1C78EAAD065D492600B07095</string> 
    894                                 <string>79A490990D2B0BD3008FEBAE</string> 
     936                                <string>794BBC390D2B3355008D059A</string> 
    895937                                <string>1C78EAAC065D492600B07095</string> 
    896938                        </array> 
     
    898940                        <string>xcode.toolbar.config.consoleV3</string> 
    899941                        <key>WindowString</key> 
    900                         <string>1744 1042 650 250 0 0 2560 1578 </string> 
     942                        <string>1895 1110 650 250 0 0 2560 1578 </string> 
    901943                        <key>WindowToolGUID</key> 
    902944                        <string>1C78EAAD065D492600B07095</string> 
    903945                        <key>WindowToolIsVisible</key> 
    904                         <false/> 
     946                        <true/> 
    905947                </dict> 
    906948                <dict> 
  • trunk/cocoa/JRShellView/JRShellViewDemo/JRShellViewDemo.xcodeproj/wolf.pbxuser

    r277 r279  
    3838                                ); 
    3939                        }; 
    40                         PBXPerProjectTemplateStateSaveDate = 220922966; 
    41                         PBXWorkspaceStateSaveDate = 220922966; 
     40                        PBXPerProjectTemplateStateSaveDate = 220934981; 
     41                        PBXWorkspaceStateSaveDate = 220934981; 
     42                }; 
     43                perUserProjectItems = { 
     44                        794BBC450D2B6590008D059A /* PBXTextBookmark */ = 794BBC450D2B6590008D059A /* PBXTextBookmark */; 
     45                        794BBC460D2B6590008D059A /* PBXTextBookmark */ = 794BBC460D2B6590008D059A /* PBXTextBookmark */; 
    4246                }; 
    4347                sourceControlManager = 79AEA9A40D29CB0A00A2C50F /* Source Control */; 
    4448                userBuildSettings = { 
    4549                }; 
     50        }; 
     51        794BBC450D2B6590008D059A /* PBXTextBookmark */ = { 
     52                isa = PBXTextBookmark; 
     53                fRef = 79AEA9A60D29CB1100A2C50F /* JRShellView.m */; 
     54                name = "JRShellView.m: 192"; 
     55                rLen = 39; 
     56                rLoc = 7308; 
     57                rType = 0; 
     58                vrLen = 1106; 
     59                vrLoc = 12964; 
     60        }; 
     61        794BBC460D2B6590008D059A /* PBXTextBookmark */ = { 
     62                isa = PBXTextBookmark; 
     63                fRef = 79AEA9A60D29CB1100A2C50F /* JRShellView.m */; 
     64                name = "JRShellView.m: 1"; 
     65                rLen = 0; 
     66                rLoc = 0; 
     67                rType = 0; 
     68                vrLen = 2865; 
     69                vrLoc = 0; 
    4670        }; 
    4771        795A7F90099D0E3600450061 /* AppController.h */ = { 
     
    102126        79AEA9A60D29CB1100A2C50F /* JRShellView.m */ = { 
    103127                uiCtxt = { 
    104                         sepNavIntBoundsRect = "{{0, 0}, {997, 6622}}"; 
    105                         sepNavSelRange = "{3378, 0}"; 
    106                         sepNavVisRange = "{1847, 3619}"; 
     128                        sepNavIntBoundsRect = "{{0, 0}, {997, 6650}}"; 
     129                        sepNavSelRange = "{0, 0}"; 
     130                        sepNavVisRange = "{0, 2865}"; 
    107131                        sepNavWindowFrame = "{{838, 185}, {1056, 1350}}"; 
    108132                };