home *** CD-ROM | disk | FTP | other *** search
Wrap
/*************************************************************************************** NXTableView -> NSTableView ****************************************************************************************/ /* Can't do anything about these because they are used other places in the appkit - setMode:(int) newMode; - (int)mode; - (void)setAllowsMultipleSelection:(BOOL)flag; - (BOOL)allowsMultipleSelection; */ replace "[<rec> setColumnHeadingVisible:<noArg>]" with "[<rec> setHeaderView:nil]" where "<noArg>" isOneOf { "NO", "No", "0" } replacemethod "setColumnHeadingVisible:" with same error "TableViewConversion: setColumnHeadingVisible: is obsolete. To hide the heading use setHeaderView:nil. To show a heading set the header view to something appropriate (like setHeaderView:[[[NSTableHeaderView alloc] init] autorelease])" replace "[<rec> isColumnHeadingVisible]" with "([<rec> headerView] != nil)" replacemethod "isColumnHeadingVisible" with "headerView" warning "TableViewConversion: The column heading is always visible if there is a header view (i.e. if [myTableView headerView] != nil)" /* - setIntercell:(const NXSize *)aSize; - (void)setIntercellSpacing:(NSSize)aSize; */ replacemethod "setIntercell:<size>" with "setIntercellSpacing:<size>" { replace "<rettype>" with "(void)" replace "<size_type>" with "(NSSize)" replace "<size_arg>" with "*<size_arg>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" } /* - getIntercell:(NXSize *)theSize; - (NSSize)intercellSpacing; */ replacemethod "getIntercell:<size>" with "intercellSpacing" { replace "<rettype>" with "(NSSize)" replace "<call>" with "*<size_arg> = <call>" replace "<implementation>" with " NSSize <size_param>; <implementation>" } within ("<implementation>") { replace "<size_param>->" with "*<size_param>." replace "<size_param>" with "&<size_param>" replace "return self;" with "return <size_param>;" replace "return (self);" with "return (<size_param>);" replace "return NULL;" with "return NSZeroSize;" replace "return (NULL);" with "return (NSZeroSize);" replace "return nil;" with "return NSZeroSize;" replace "return (nil);" with "return (NSZeroSize);" } /* - (BOOL)isGridVisible; - (BOOL)drawsGrid; - (BOOL)doesAllowVectorReordering; - (BOOL)allowsColumnReordering; - (BOOL)doesAllowVectorResizing; - (BOOL)allowsColumnResizing; - (BOOL)doesAllowEmptySel; - (BOOL)allowsEmptySelection; - columnList; - (NSArray *)tableColumns; */ replacemethod "<old>" with "<new>" where ("<old>", "<new>") isOneOf { ("isGridVisible", "drawsGrid") ("doesAllowVectorReordering", "allowsColumnReordering") ("doesAllowVectorResizing", "allowsColumnResizing") ("doesAllowEmptySel", "allowsEmptySelection") ("columnList", "tableColumns") } /* - setGridVisible:(BOOL)flag; - (void)setDrawsGrid:(BOOL)flag; - allowVectorReordering:(BOOL)flag; - (void)setAllowsColumnReordering:(BOOL)flag; - allowVectorResizing:(BOOL) flag; - (void)setAllowsColumnResizing:(BOOL)flag; - allowEmptySel:(BOOL)flag; - (void)setAllowsEmptySelection:(BOOL)flag; */ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(void)" } within ("<implementation>") { replace "return self;" with "return;" replace "return (self);" with "return;" } where ("<old>", "<new>") isOneOf { ("setGridVisible:", "setDrawsGrid:") ("allowVectorReordering:", "setAllowsColumnReordering:") ("allowVectorResizing:", "setAllowsColumnResizing:") ("allowEmptySel:", "setAllowsEmptySelection:") } /* - (unsigned int)columnCount; - (int)numberOfColumns; - (unsigned int)rowCount; - (int)numberOfRows; - (unsigned int)selectedRowCount; - (int)numberOfSelectedRows; - (unsigned int)selectedColumnCount; - (int)numberOfSelectedColumns; */ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(int)" } where ("<old>", "<new>") isOneOf { ("columnCount", "numberOfColumns") ("rowCount", "numberOfRows") ("selectedRowCount", "numberOfSelectedRows") ("selectedColumnCount", "numberOfSelectedColumns") } /* - (id <NXTableVectors>)columnAt:(unsigned int)aPosition; */ replace "[<rec> columnAt:<pos>]" with "[[<rec> tableColumns] objectAtIndex:<pos>]" replacemethod "columnAt:" with same error "TableViewConversion: columnAt: is obsolete. TableView now uses NSTableColumns instead of TableVectors. To get a table column use [[myTableView tableColumns] objectAtIndex:theIndex]." /* - addColumn:identifier withTitle:(const char *)title; */ replace "[<rec> addColumn:<ident> withTitle:<title>]" with "{ NSTableColumn *myTableColumn = [[NSTableColumn alloc] initWithIdentifier:<ident>]; [[myTableColumn headerCell] setStringValue:<title>]; [<rec> addTableColumn:myTableColumn]; [myTableColumn release]; }" /* - addColumn:identifier withFormatter:formatter andTitle:(const char *)title at:(unsigned int) aPosition; */ replace "[<rec> addColumn:<ident> withFormatter:<formatter> andTitle:<title> at:<pos>]" with "{ NSTableColumn *myTableColumn = [[NSTableColumn alloc] initWithIdentifier:<ident>]; [[myTableColumn headerCell] setStringValue:<title>]; [<rec> addTableColumn:myTableColumn]; [myTableColumn release]; [<rec> moveColumn:([<rec> numberOfColumns] - 1) toColumn:<pos>]; }" warning "TableViewConversion: Formatters (in this case <formatter>) are obsolete. Use cells to format data in NSTableView" /* - addColumn:aColumn at:(unsigned int) aPosition; */ replace "[<rec> addColumn:<col> at:<pos>]" with "[<rec> addTableColumn:<col>], [<rec> moveColumn:([<rec> numberOfColumns] - 1) toColumn:<pos>]" replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. To add a column create the appropriate NSTableColumn and call addTableColumn:." where "<sel>" isOneOf { "addColumn:withTitle:", "addColumn:withFormatter:andTitle:at:" "addColumn:at:" } /* - removeColumnAt:(unsigned int) aPosition; */ replace "[<rec> removeColumnAt:<pos>]" with "[<rec> removeTableColumn:[[<rec> tableColumns] objectAtIndex:<pos>]]" replacemethod "removeColumnAt:" with same error "TableViewConversion: removeColumnAt: is obsolete. Remove the NSTableColumn using removeTableColumn:" /* - (BOOL)moveColumnFrom:(unsigned int)oldPos to:(unsigned int)newPos; - (void)moveColumn:(int)column toColumn:(int)newIndex; */ replacemethod "moveColumnFrom:<oldPos> to:<newPos>" with "moveColumn:<oldPos> toColumn:<newPos>" { replace "<oldPos_type>" with "(int)" replace "<newPos_type>" with "(int)" replace "<rettype>" with "(void)" } within ("<implementation>") { replace "return" with same error "TableViewConversion: moveColumn:toColumn: does not return a failure status." } /* - (BOOL)isRowSelected:(unsigned int)row; - (BOOL)isRowSelected:(int)row; - (BOOL)isColumnSelected:(unsigned int)column; - (BOOL)isColumnSelected:(int)row; */ replacemethod "<old>" with "same" { replace "<myArg_type>" with "(int)" } where "<old>" isOneOf { "isRowSelected:<myArg>" "isColumnSelected:<myArg>" } /* - setRowSelectionOn:(unsigned int) start :(unsigned int) end to:(BOOL) flag; - (void)selectRow:(int)row byExtendingSelection:(BOOL)extend; */ replacemethod "setRowSelectionOn:<start> :<end> to:" with same error "TableViewConversion: setRowSelectionOn::to: is obsolete. Loop through from <start> to <end> setting the selection with selectRow:byExtendingSelection:" /* - setColumnSelectionOn:(unsigned int) start :(unsigned int) end to:(BOOL) flag; - (void)selectColumn:(int)column byExtendingSelection:(BOOL)extend; */ replacemethod "setColumnSelectionOn:<start> :<end> to:" with same error "TableViewConversion: setColumnSelectionOn::to: is obsolete. Loop through from <start> to <end> setting the selection with selectColumn:byExtendingSelection:" /* - selectRow:(unsigned int)row byExtension:(BOOL)flag; - (void)selectRow:(int)row byExtendingSelection:(BOOL)extend; - selectColumn:(unsigned int)column byExtension:(BOOL)flag; - (void)selectColumn:(int)column byExtendingSelection:(BOOL)extend; */ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(void)" replace "<pos_type>" with "(int)" } within ("<implementation>") { replace "return self;" with "return;" replace "return (self);" with "return;" } where ("<old>", "<new>") isOneOf { ("selectRow:<pos> byExtension:", "selectRow:<pos> byExtendingSelection:") ("selectColumn:<pos> byExtension:", "selectColumn:<pos> byExtendingSelection:") } /* - deselectRow:(unsigned int)row; - (void)deselectRow:(int)row; - deselectColumn:(unsigned int)column; - (void)deselectColumn:(int)column; - scrollRowToVisible:(unsigned int)row; - (void)scrollRowToVisible:(int)row; - scrollColumnToVisible:(unsigned int)column; - (void)scrollColumnToVisible:(int)column; */ replacemethod "<sel>" with same { replace "<rettype>" with "(void)" replace "<pos_type>" with "(int)" } within ("<implementation>") { replace "return self;" with "return;" replace "return (self);" with "return;" } where "<sel>" isOneOf { "deselectRow:<pos>" "deselectColumn:<pos>" "scrollRowToVisible:<pos>" "scrollColumnToVisible:<pos>" } /* - (unsigned int)selectedRowAfter:(unsigned int)aRow; */ replacemethod "selectedRowAfter:" with same warning "TableViewConversion: Use selectedRowEnumerator to enumerate the selection." /* - (unsigned int)selectedColumnAfter:(unsigned int)aColumn; */ replacemethod "selectedColumnAfter:" with same warning "TableViewConversion: Use selectedColumnEnumerator to enumerate the selection." /* - reloadData:sender; - (void)reloadData; - layoutChanged:sender; - (void)tile; */ replacemethod "<old>" with "<new>" { replace "<rettype>" with "(void)" } within ("<implementation>") { replace "return self;" with "return;" replace "return (self);" with "return;" } where ("<old>", "<new>") isOneOf { ("reloadData:", "reloadData") ("layoutChanged:", "tile") } /* - columnHeading; - (NSTableHeaderView *)headerView; */ replacemethod "columnHeading" with "headerView" { replace "<rettype>" with "(NSTableHeaderView *)" } /* - setColumnHeading:newColumnHeading; - (void)setHeaderView:(NSTableHeaderView *)headerView; */ replacemethod "setColumnHeading:<view>" with "setHeaderView:<view>" { replace "<rettype>" with "(void)" replace "<view_type>" with "(NSTableHeaderView *)" } within ("<implementation>") { replace "return self;" with "return;" replace "return (self);" with "return;" } /* - tableViewDidChangeSelection:aTableView; NSTableViewSelectionDidChangeNotification */ replacemethod "tableViewDidChangeSelection:" with same warning "TableViewConversion: You should register the NSTableViewSelectionDidChangeNotification" /* - (BOOL)tableViewWillChangeSelection:aTableView; - (BOOL)selectionShouldChangeInTableView:(NSTableView *)aTableView; */ replacemethod "tableViewWillChangeSelection:<tableView>" with "selectionShouldChangeInTableView:<tableView>" { replace "<tableView_type>" with "(NSTableView *)" } /* - tableView:sender movedColumnFrom:(unsigned int) old to:(unsigned int) new; NSTableViewColumnDidMoveNotification; // @"NSOldColumn", @"NSNewColumn" */ replacemethod "tableView:movedColumnFrom:to:" with same warning "TableViewConversion: You should register the NSTableViewColumnDidMoveNotification. It is userInfo dictionary contains the keys NSOldColumn and NSNewColumn" /* - rowsChangedFrom:(unsigned int)startRow to:(unsigned int)endRow; */ replacemethod "rowsChangedFrom:to:" with same error "TableViewConversion: 'rowsChangedFrom:to:' is obsolete; just setNeedsDisplayInRect: for rectOfRow: for each row that changed" /* - columnsChangedFrom:(unsigned int)startColumn to:(unsigned int)endColumn; */ replacemethod "columnsChangedFrom:to:" with same error "TableViewConversion: 'columnsChangedFrom:to:' is obsolete; just setNeedsDisplayInRect: for rectOfColumn: for each column that changed" /* - (BOOL)dynamicRows; - (BOOL)dynamicColumns; - rowList; - (id <NXTableVectors>) rowAt:(unsigned int) aPosition; - addRow:identifier withTitle:(const char *) title; - addRow:identifier withFormatter:formatter andTitle:(const char *) title at:(unsigned int) aPosition; - addRow:aRow at:(unsigned int) aPosition; - removeRowAt:(unsigned int) aPosition; - (BOOL) moveRowFrom:(unsigned int) oldPos to:(unsigned int) newPos; - tableView:sender movedRowFrom:(unsigned int) old to:(unsigned int) new; - rowHeading; - setRowHeading:newRowHeading; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. All rows are dynamic and columns are static. If a row changes, just cause it to be redisplayed with setNeedsDisplayInRect:" where "<sel>" isOneOf { "dynamicRows", "rowList", "dynamicColumns" "rowAt:" "addRow:withTitle:" "addRow:withFormatter:andTitle:at:" "addRow:at:" "removeRowAt:" "moveRowFrom:to:" "tableView:movedRowFrom:to:" "rowHeading" "setRowHeading:" } /* - setRowHeadingVisible:(BOOL)flag; - (BOOL)isRowHeadingVisible; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. Rows do not have headings." where "<sel>" isOneOf { "setRowHeadingVisible:", "isRowHeadingVisible" } /* - sendAction:(SEL) anAction to:anObject forSelectedRows:(BOOL) flag; - sendAction:(SEL) anAction to:anObject forSelectedColumns:(BOOL) flag; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete." where "<sel>" isOneOf { "sendAction:to:forSelectedRows:", "sendAction:to:forSelectedColumns:" } /* - formatterAt:(unsigned int) row :(unsigned int) column; - editFieldAt:(unsigned int) row :(unsigned int) column; - endEditing; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. TableView now uses cells instead of formatters." where "<sel>" isOneOf { "formatterAt::", "editFieldAt::" "endEditing" } replace "NXTableView" with "NSTableView" /*************************************************************************************** NXFormatter ****************************************************************************************/ /* - getValueAt:(unsigned int) row :(unsigned int) column withAttributes:(id <NXTableVectors>) rowAttrs :(id <NXTableVectors>) columnAttrs usePositions:(BOOL) useRowPos :(BOOL) useColumnPos; - drawFieldAt:(unsigned int) row :(unsigned int) column inside:(NXRect *) frame inView:view withAttributes:(id <NXTableVectors>) rowAttrs :(id <NXTableVectors>) columnAttrs usePositions:(BOOL) useRowPos :(BOOL) useColumnPos; - beginBatching:(id <NXTableVectors>) attrs; - resetBatching:(id <NXTableVectors>) attrs; - endBatching; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. TableView now uses cells instead of formatters." where "<sel>" isOneOf { "getValueAt::withAttributes::usePositions::" "drawFieldAt::inside:inView:withAttributes::usePositions::" "beginBatching:" "resetBatching:" "endBatching" } replace "NXFormatter" with same error "TableViewConversion: TableView now uses cells instead of formatters. Use an NSCell or subclass to display data in a table view." /*************************************************************************************** NXImageFormatter ****************************************************************************************/ replace "NXImageFormatter" with same error "TableViewConversion: TableView now uses cells instead of formatters. Use an NSImageCell to display images in a table view." /*************************************************************************************** NXEditableFormatter ****************************************************************************************/ replace "NXEditableFormatter" with same error "TableViewConversion: TableView now uses cells instead of formatters. Use an NSTextFieldCell to edit text in a table view." /* - (BOOL) formatterWillChangeValueFor:identifier at:(unsigned int) position sender:sender; - (BOOL) formatterWillChangeValueFor:identifier at:(unsigned int) position to:aValue sender:sender; - formatterDidChangeValueFor:identifier at:(unsigned int) position to:aValue sender:sender; - (BOOL) formatterWillChangeValueFor:rowIdentifier :columnIdentifier sender:sender; - (BOOL) formatterWillChangeValueFor:rowIdentifier :columnIdentifier to:aValue sender:sender; - formatterDidChangeValueFor:rowIdentifier :columnIdentifier to:aValue sender:sender; - (BOOL) formatterDidEndEditing:sender endChar:(unsigned short)whyEnd; */ replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. TableView now uses cells instead of formatters. Cells can have NSFormatters to format and validate data." where "<sel>" isOneOf { "formatterWillChangeValueFor:at:sender:" "formatterWillChangeValueFor:at:to:sender:" "formatterDidChangeValueFor:at:to:sender:" "formatterWillChangeValueFor::sender:" "formatterWillChangeValueFor::to:sender:" "formatterDidChangeValueFor::to:sender:" "formatterDidEndEditing:endChar:" } /*************************************************************************************** NXTextFormatter ****************************************************************************************/ replace "NXTextFormatter" with same error "TableViewConversion: TableView now uses cells instead of formatters. Use an NSTextFieldCell to display text in a table view." /*************************************************************************************** NXTableVector ****************************************************************************************/ replace "NXTableVector" with same error "TableViewConversion: NXTableVector is obsolete. NSTableView has dynamic rows and static columns. The columns are NSTableColumn objects." /*************************************************************************************** NXTableProtocols ****************************************************************************************/ /* * Object(NXTableDataSources) */ /* - (unsigned int) rowCount; - (int)numberOfRowsInTableView:(NSTableView *)tableView; */ replacemethod "rowCount" with "numberOfRowsInTableView:<tableView>" { replace "<rettype>" with "(int)" replace "<tableView_type>" with "(NSTableView *)" replace "<tableView_param>" with "theTableView" } /* - (unsigned int)columnCount; */ replacemethod "columnCount" with same error "TableViewConversion: columnCount is obsolete. Columns are static so the data source will never be asked for the number of columns." /* - getValueFor:identifier at:(unsigned int) aPosition into:aValue; - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row; */ replacemethod "getValueFor:<ident> at:<row> into:<value>" with "tableView:<tableView> objectValueForTableColumn:<tableColumn> row:<row>" { replace "<rettype>" with "(id)" replace "<tableView_type>" with "(NSTableView *)" replace "<tableColumn_type>" with "(NSTableColumn *)" replace "<row_type>" with "(int)" replace "<tableView_param>" with "theTableView" replace "<tableColumn_param>" with "theTableColumn" replace "<call>" with "<value_arg> = <call>" replace "<tableColumn_arg>" with "[<tableView_arg> tableColumnWithIdentifier:<ident_arg>]" replace "<implementation>" with " id <ident_param> = [theTableColumn identifier]; NSData *<value_param>; <implementation>" } /* - setValueFor:identifier at:(unsigned int) aPosition from:aValue; - (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row; */ replacemethod "setValueFor:<ident> at:<row> from:<value>" with "tableView:<tableView> setObjectValue:<value> forTableColumn:<tableColumn> row:<row>" { replace "<rettype>" with "(void)" replace "<tableView_type>" with "(NSTableView *)" replace "<tableColumn_type>" with "(NSTableColumn *)" replace "<row_type>" with "(int)" replace "<value_type>" with "(id)" replace "<tableView_param>" with "theTableView" replace "<tableColumn_param>" with "theTableColumn" replace "<call>" with "<value_arg> = <call>" replace "<tableColumn_arg>" with "[<tableView_arg> tableColumnWithIdentifier:<ident_arg>]" replace "<implementation>" with " id <ident_param> = [theTableColumn identifier]; NSData *<value_param>; <implementation>" } replacemethod "<sel>" with same error "TableViewConversion: <sel> is obsolete. Columns are static and rows are dynamic. Rows do not have identifiers. Use - (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row; or - (void)tableView:(NSTableView *)tableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row;" where "<sel>" isOneOf { "getValueFor::into:" "setValueFor::from:" }