home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / ConversionScripts / PopUpConversion.tops < prev    next >
Encoding:
Text File  |  1996-01-23  |  2.7 KB  |  74 lines

  1.  
  2. /*********** PopUpConversion: declarations ***********/
  3.  
  4. replace "NSPopUpList" with "NSPopUpButton"
  5.  
  6. replace "\<AppKit/NSPopUpList.h>" with "<AppKit/NSPopUpButton.h>"
  7.  
  8. /*********** PopUpConversion: functions ***********/
  9.  
  10. replace "NSAttachPopUpList(<button>, <list>)" with same
  11.     error "PopUpConversion: NSAttachPopUpList() is obsolete. Use the NSPopUpButton class."
  12.  
  13. replace "NSCreatePopUpListButton(<button>, <list>)" with same
  14.     error "PopUpConversion: NSCreatePopUpListButton() is obsolete. Use the NSPopUpButton class."
  15.  
  16. /*********** PopUpConversion: obsolete ***********/
  17.  
  18. replacemethod "popUp:" with same
  19.     error "PopUpConversion: 'popUp:' is obsolete because it is no longer necessary."
  20.  
  21. replace "[<rec> buttonFrame]" with "[<rec> frame]" /*???*/
  22.  
  23. replacemethod "buttonFrame" with same
  24.     error "PopUpConversion: 'getButtonFrame:' is obsolete. Use the frame method instead"
  25.  
  26. /*********** PopUpConversion: prep for renaming ***********/
  27. replace "[[<rec> target] <old>]" with "[<rec> <new>]" 
  28.     where ("<old>", "<new>") isOneOf {
  29.     ("removeItemAtIndex:",  "removeItemAtIndex:"),
  30.     ("setPullsDown:",       "setPullsDown:"),
  31.     ("addItem:",            "addItemWithTitle:"),
  32.     ("insertItem:atIndex:", "insertItemWithTitle:atIndex:"),
  33.     ("removeItem:",         "removeItemWithTitle:"),
  34.     ("indexOfItem:",        "indexOfItemWithTitle:"),
  35.     ("selectedItem",        "titleOfSelectedItem"),
  36.     ("itemList",            "itemMatrix")
  37.     }
  38.  
  39. replace "[<rec> <old>]" with "[<rec> <new>]" 
  40.     where ("<old>", "<new>") isOneOf {
  41.     ("removeItemAtIndex:",  "removeItemAtIndex:"),
  42.     ("setPullsDown:",       "setPullsDown:"),
  43.     ("addItem:",            "addItemWithTitle:"),
  44.     ("insertItem:atIndex:", "insertItemWithTitle:atIndex:"),
  45.     ("removeItem:",         "removeItemWithTitle:"),
  46.     ("indexOfItem:",        "indexOfItemWithTitle:"),
  47.     ("selectedItem",        "titleOfSelectedItem"),
  48.     ("itemList",            "itemMatrix")
  49.     }
  50.     warning "PopUpConversion: This message should be sent to an NSPopUpButton, but is probably being sent to an NSPopUpList"
  51.    
  52. /*********** PopUpConversion: collapse messages which can be ***********/
  53.  
  54. replace "[[<rec> itemMatrix] selectedRow]" with "[<rec> indexOfSelectedItem]"
  55.  
  56. /*********** PopUpConversion: removeItemExceptions ***********/
  57.  
  58. replace "<t var> = [<rec> removeItem:<item>];" with "{
  59.     <t var> = [<rec> itemWithTitle:<item>]; 
  60.     [<rec> removeItemWithTitle:<item>];
  61.     }"
  62.  
  63. replace "<t var> = [<rec> removeItemAtIndex:<index>];" with "{
  64.     <t var> = [<rec> itemAtIndex:<index>];
  65.     [<rec> removeItemAtIndex:<index>];
  66.     }"
  67.  
  68.  
  69. /*********** PopUpConversion: Warn against using matrix directly  ***********/
  70.  
  71. replacemethod "itemMatrix" with same
  72.     warning "PopUpConversion: Consider NSPopUpButton methods instead of using itemMatrix to access items in a pop-up list."
  73.  
  74.