home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / MatrixAndCellConversion.tops < prev    next >
Text File  |  1995-05-12  |  4KB  |  126 lines

  1.  
  2. /*********** GeneralAPIConversion: simple name changes ***********/
  3.  
  4. replacemethod "changeButtonTitle:<flag>" with "setPullsDown:<flag>" {
  5.     replace "<flag_arg>" with "!(<flag_arg>)"
  6.     }
  7.     within ("<implementation>") {
  8.         replace "<flag_param>" with "!<flag_param>"
  9.     }
  10.  
  11.  
  12. /*********** MatrixAndCellConversion: obsolete method call replacements ***********/
  13.  
  14. replace "[<obj> <t methodName>:<value> at:<index>]" with "[[<obj> cellAtIndex:<index>] <t methodName>:<value>]"
  15.     where "<t methodName>" isOneOf {
  16.     "setTag",
  17.     "setTarget",
  18.     "setAction",
  19.     "setStringValue",
  20.     "setIntValue",
  21.     "setFloatValue",
  22.     "setDoubleValue"
  23.     }
  24.  
  25. replace "[<obj> <t methodName>:<index>]" with "[[<obj> cellAtIndex:<index>] <t cellMethodName>]"
  26. where ("<t methodName>", "<t cellMethodName>") isOneOf {
  27.     ("stringValueAt", "stringValue"),
  28.     ("intValueAt", "intValue"),
  29.     ("floatValueAt", "floatValue"),
  30.     ("doubleValueAt", "doubleValue")
  31. }
  32.  
  33. replace "[<obj> insertEntry:<title> atIndex:<index> tag:<tag> target:<target> action:<action>];"
  34. with "{
  35.     [<obj> insertEntry:<title> atIndex:<index>];
  36.     [[<obj> cellAtIndex:<index>] setTag:<tag>];
  37.     [[<obj> cellAtIndex:<index>] setTarget:<target>];
  38.     [[<obj> cellAtIndex:<index>] setAction:<action>];
  39.     }"
  40.        
  41. replace "<w w>[<obj> addEntry:<title> tag:<tag> target:<target> action:<action>];"
  42. with "{
  43.     id _cell;
  44.     [<obj> addEntry:<title>];
  45.     _cell = [<obj> cellAtIndex:[[<obj> cells] count] - 1];
  46.     [_cell setTag:<tag>];
  47.     [_cell setTarget:<target>];
  48.     [_cell setAction:<action>];
  49.     }"
  50.  
  51.     
  52. replace "[<obj> <t methodName>:<value> atRow:<row> column:<col>]"
  53. with "[[<obj> cellAtRow:<row> column:<col>] <t methodName>:<value>]"
  54. where "<methodName>" isOneOf {
  55.     "setTag",
  56.     "setTarget",
  57.     "setAction"
  58. }
  59.  
  60. replace "[<obj> setTag:<value> target:<target> action:<action> at:<row> :<col>];"
  61. with "{
  62.     id _cell = [<obj> cellAtRow:<row> column:<col>];
  63.     [_cell setTag:<value>];
  64.     [_cell setTarget:<target>];
  65.     [_cell setAction:<action>];<
  66.     }"
  67.  
  68. replace "[<obj> incrementState]" with "[<obj> setState:![<obj>  state]]"
  69.     warning "MatrixAndCellConversion: 'setState:' used to be 'incrementState' ; this conversion is not valid for multistate cells"
  70.  
  71. /*********** MatrixAndCellConversion: obsolete methods ***********/
  72.  
  73. replacemethod "<sel>" with same
  74.     error "MatrixAndCellConversion: 'setReaction' and 'reaction' are obsolete ; remove any related 'unlockFocus' calls"
  75.     where "<sel>" isOneOf {
  76.     "setReaction:",
  77.     "reaction"
  78.     }
  79.  
  80. replacemethod "<sel>" with same
  81.     error "MatrixAndCellConversion: <sel> is obolete ; use a cell method"
  82.     where "<sel>" isOneOf {
  83.     "addEntry:tag:target:action:",
  84.     "doubleValueAt:",
  85.     "floatValueAt:",
  86.     "insertEntry:at:tag:target:action:",
  87.     "intValueAt:",
  88.     "setAction:at:",
  89.     "setAction:at::",
  90.     "setDoubleValue:at:",
  91.     "setFloatValue:at:",
  92.     "setIntValue:at:",
  93.     "setStringValue:at:",
  94.     "setTag:at:",
  95.     "setTag:at::",
  96.     "setTag:target:action:at::",
  97.     "setTarget:at:",
  98.     "setTarget:at::",
  99.     "stringValueAt:",
  100.     }
  101.  
  102. replacemethod "incrementState" with same
  103.     error "MatrixAndCellConversion: 'incrementState' is obsolete ; use 'setState:'"
  104.     
  105. replace "[<matrix> cellCount]" with "[[<matrix> cells] count]"
  106.  
  107. /*********** MatrixAndCellConversion: simple name changes ***********/
  108.  
  109. replacemethod "<old>" with "<new>"
  110.     where ("<old>", "<new>") isOneOf {
  111.     ("addItem:action:keyEquivalent:", "addItemWithTitle:action:keyEquivalent:"),
  112.     ("clearSelectedCell", "deselectAllCells"),
  113.     ("doubleValueAt:", "doubleValueAtIndex:"),
  114.     ("drawCellAt:" "drawCellAtIndex:"),
  115.     ("insertEntry:at:", "insertEntry:atIndex:"),
  116.     ("insertItem:at:", "insertItem:atIndex:"),
  117.     ("removeEntryAt:" , "removeEntryAtIndex:"),
  118.     ("removeItemAt:", "removeItemAtIndex:"),
  119.     ("selectTextAt:", "selectTextAtIndex:"),
  120.     ("selectedIndex", "indexOfSelectedItem"),
  121.     ("setItemList:", "setItemMatrix:"),
  122.     ("setTitle:at:", "setTitle:atIndex:"),
  123.     ("titleAt:", "titleAtIndex:"),
  124.     ("cellList", "cells")
  125.     }
  126.