Informal protocol declaring additional delegate methods for MOExtendedTableView.
Informal protocol declaring additional delegate methods for MOExtendedTableView. MOExtendedTableView defines a number of additional optional methods that will be sent to the table's delegate if it implements them.
tableView:handleDeleteKeyEvent: |
- ( BOOL ) tableView: (id ) sender handleDeleteKeyEvent: (NSEvent *) event;
Support for catching typing of backspace or delete. MOExtendedTableView will call this method if the user types Backspace or Delete or Del while there is no cell editing going on (when editing is going on, the editing cell handles the key as a normal text editing command).
One common implementation of this method makes backspace delete the selected rows. To do this simply implement this method and call [sender delete:self].
- sender
- The sending MOExtendedTableView.
- event
- The key event.
tableView:handleReturnKeyEvent: |
- ( BOOL ) tableView: (id ) sender handleReturnKeyEvent: (NSEvent *) event;
Support for catching typing of return or enter. MOExtendedTableView will call this method if the user types Return or Enter while there is no cell editing going on (when cell editing is going on, the Return or Enter is handled by the cell being edited and usually causes editing to end and (depending on whether row-based editing is enabled) editing to transfer to another cell in the table).
One common implementation of this method makes return add new rows. To do this simply implement this method and call [sender createNewRow:self].
- sender
- The sending MOExtendedTableView.
- event
- The key event.
tableView:willReturnMenu:forTableColumn:row:event: |
- ( NSMenu *) tableView: (id ) sender willReturnMenu: (NSMenu *) menu forTableColumn: (NSTableColumn *) column row: (int ) rowNum event: (NSEvent *) event;
Support for modifying or replacing a context menu before it is shown. If the dataCell for the column and row has a menu, it will be passed in as the menu parameter, otherwise, if the table itself has a menu, it will be passed as the menu paramter. If no menu can be found the menu paramter will be nil. If menu is non-nil, the delegate is free to modify it and return it, or to return a totally different NSMenu. In any case, this can return nil to prevent any menu from popping.
If you change the dataCell's or the table's menu, be aware that the changes will be permanent unless and until a subsequent call to this method changes them again (or you change them directly through other means). One reason you might change the menu is if your delegate implements the actions for its items, but you want to use the same NSMenu instance for multiple instances of the table/delegate combo. In this case, before showing the menu for any given table, this method might set the targets of the menu's items to the appropriate delegate instance (ie the receiving delegate instance).
- sender
- The sending MOExtendedTableView.
- menu
- The dataCell's or table's menu, if any.
- column
- The NSTableColumn, might be nil if click was not over any column.
- rowNum
- The row that was clicked, might be -1 if click was not over any row.
- event
- The event that prompted popping the context menu.
(Last Updated 3/20/2005)