Changeset 376


Ignore:
Timestamp:
Jun 16, 2006, 12:04:29 AM (17 years ago)
Author:
livings124
Message:

Add context menu to file table

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/English.lproj/InfoWindow.nib/classes.nib

    r354 r376  
    11{
    22    IBClasses = (
    3         {CLASS = FileTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; },
     3        {
     4            CLASS = FileTableView;
     5            LANGUAGE = ObjC;
     6            OUTLETS = {fContextMenu = NSMenu; };
     7            SUPERCLASS = NSTableView;
     8        },
    49        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
    510        {
  • trunk/macosx/English.lproj/InfoWindow.nib/info.nib

    r375 r376  
    44<dict>
    55        <key>IBDocumentLocation</key>
    6         <string>94 65 356 240 0 0 1440 878 </string>
     6        <string>69 61 356 240 0 0 1152 842 </string>
     7        <key>IBEditorPositions</key>
     8        <dict>
     9                <key>549</key>
     10                <string>69 306 75 68 0 0 1152 842 </string>
     11        </dict>
    712        <key>IBFramework Version</key>
    813        <string>446.1</string>
     
    1722        <key>IBOpenObjects</key>
    1823        <array>
     24                <integer>549</integer>
    1925                <integer>5</integer>
    2026        </array>
    2127        <key>IBSystem Version</key>
    22         <string>8I1119</string>
     28        <string>8I127</string>
    2329</dict>
    2430</plist>
  • trunk/macosx/FileTableView.h

    r337 r376  
    2727@interface FileTableView : NSTableView
    2828{
     29    IBOutlet NSMenu * fContextMenu;
    2930}
    3031
  • trunk/macosx/FileTableView.m

    r337 r376  
    3333}
    3434
     35- (NSMenu *) menuForEvent: (NSEvent *) e
     36{
     37    int row = [self rowAtPoint: [self convertPoint: [e locationInWindow] fromView: nil]];
     38   
     39    if (row >= 0)
     40    {
     41        if (![self isRowSelected: row])
     42            [self selectRowIndexes: [NSIndexSet indexSetWithIndex: row]
     43                byExtendingSelection: NO];
     44    }
     45    else
     46        [self deselectAll: self];
     47   
     48    return fContextMenu;
     49}
     50
    3551@end
  • trunk/macosx/TorrentTableView.m

    r360 r376  
    116116- (NSMenu *) menuForEvent: (NSEvent *) e
    117117{
    118     NSPoint point;
    119     int row;
    120 
    121     point = [self convertPoint: [e locationInWindow] fromView: nil];
    122     row = [self rowAtPoint: point];
    123    
    124     if( row >= 0 )
     118    int row = [self rowAtPoint: [self convertPoint: [e locationInWindow] fromView: nil]];
     119   
     120    if (row >= 0)
    125121    {
    126122        if (![self isRowSelected: row])
Note: See TracChangeset for help on using the changeset viewer.