• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CELL PROBLEM! HELP!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CELL PROBLEM! HELP!!!


  • Subject: CELL PROBLEM! HELP!!!
  • From: Gore <email@hidden>
  • Date: Thu, 18 Apr 2002 00:07:56 +0300

I have a checkbox cell in my outlineview, but I don't want it to change state if I click on the text, it should change state ONLY if I click the checkbox-box, how?! because I am editing the text in the cell, so I don't want it to change state if I edit the text. please help, thanks

here's the code in my mousedown method in the outlineview:

- (void)mouseDown:(NSEvent *)theEvent
{
NSPoint aPoint;
int column,row, xScale;
NSRect aRect;

aPoint=[self convertPoint: [theEvent locationInWindow] fromView: nil];
column=[self columnAtPoint: aPoint];
row=[self rowAtPoint: aPoint];

if (column == [self columnWithIdentifier: @"name"] &&
row != -1 &&
[theEvent modifierFlags]==0)
{
id rowObj = [self itemAtRow: row];

aRect=[self frameOfCellAtColumn:column row:row];
xScale=aRect.origin.x;

if (aPoint.x <= (xScale+20) && aPoint.x >= xScale) {
NSLog(@"status!");
[[self window] endEditingFor: self];
[rowObj setItemIsSelected: ([rowObj itemIsSelected]==0)?1:0 useMixed: NO useCat: YES];
[self selectRow: row byExtendingSelection: NO];
[self reloadData];
} else if (aPoint.x > (xScale+20)) {
NSLog(@"text!");
[super mouseDown: theEvent];

/* I MUST use [mouseDown:] else it ses:
*** Assertion failure in -[MainTableView editColumn:row:withEvent:select:], NSTableView.m:2207
Invalid parameter not satisfying: _lastSelectedRow == row
*/
[self editColumn: column row: row withEvent: theEvent select: YES];
} else
[super mouseDown: theEvent];
} else
[super mouseDown: theEvent];
}

I've been working on this damn problem in a very long time now and because it's cocoa there is probably some easy solution for this, I'm sure! =)

/ Gore
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: CELL PROBLEM! HELP!!!
      • From: j o a r <email@hidden>
    • Re: CELL PROBLEM! HELP!!!
      • From: Ondra Cada <email@hidden>
  • Prev by Date: toggleToolbarShown and titlebar widget
  • Next by Date: Re: CELL PROBLEM! HELP!!!
  • Previous by thread: toggleToolbarShown and titlebar widget
  • Next by thread: Re: CELL PROBLEM! HELP!!!
  • Index(es):
    • Date
    • Thread