Changeset 467 for trunk/ICeCoffEE


Ignore:
Timestamp:
04/17/08 02:12:15 (17 years ago)
Author:
Nicholas Riley
Message:

Disable on list boxes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEWebKit.m

    r457 r467  
    5757static id /* DOMRange */ selectedRange;
    5858
    59 - (void)mouseDown:(NSEvent *)e;
    60 {
    61     [downEvent release]; downEvent = nil;
    62     if (ICCF_enabled && ICCF_prefs.commandClickEnabled && ICCF_EventIsCommandMouseDown(e)) {
    63         if ([self respondsToSelector: @selector(_webView)]) {
    64             WebView *webView = [(WebHTMLView *)self _webView];
    65            
    66             // save selection: it may be deselected on super mouseDown
    67             selectedRange = [[webView selectedDOMRange] retain];
    68            
    69             // stop any URL launching from happening
    70             if ([webView isEditable]) {
    71                 policyDelegate = [[webView policyDelegate] retain];
    72                 [webView setPolicyDelegate: [ICeCoffEEWebPolicyDelegate sharedDelegate]];
    73             }
    74            
    75             downEvent = [e retain];
    76         }
    77     }
    78     [super mouseDown: e];
    79 }
    80 
    81 
    8259static BOOL ICCF_DOMParentOfClass(DOMNode *node, Class cls) {
    8360    do {
     
    9067#define ICCF_NodeIs(elt) [clickedNode isKindOfClass: NSClassFromString(@"DOMHTML"elt"Element")]
    9168#define ICCF_DOMParentIs(elt) ICCF_DOMParentOfClass(clickedNode, NSClassFromString(@"DOMHTML"elt"Element"))
     69
     70- (void)mouseDown:(NSEvent *)e;
     71{
     72    [downEvent release]; downEvent = nil;
     73    if (ICCF_enabled && ICCF_prefs.commandClickEnabled && ICCF_EventIsCommandMouseDown(e)) {
     74        if ([self respondsToSelector: @selector(_webView)]) {
     75            WebView *webView = [(WebHTMLView *)self _webView];
     76           
     77            // check that the Command-click isn't being used for discontiguous selection
     78            NSPoint viewClickPt = [webView convertPoint: [e locationInWindow] fromView: nil];
     79            NSDictionary *elementDict = [webView elementAtPoint: viewClickPt];
     80            DOMNode *clickedNode = [elementDict objectForKey: @"WebElementDOMNode"];
     81            if (clickedNode != nil && ICCF_NodeIs("Select")) {
     82                [super mouseDown: e];
     83                return;
     84            }
     85           
     86            // save selection: it may be deselected on super mouseDown
     87            selectedRange = [[webView selectedDOMRange] retain];
     88           
     89            // stop any URL launching from happening
     90            if ([webView isEditable]) {
     91                policyDelegate = [[webView policyDelegate] retain];
     92                [webView setPolicyDelegate: [ICeCoffEEWebPolicyDelegate sharedDelegate]];
     93            }
     94           
     95            downEvent = [e retain];
     96        }
     97    }
     98    [super mouseDown: e];
     99}
    92100
    93101- (void)mouseUp:(NSEvent *)e;
Note: See TracChangeset for help on using the changeset viewer.