home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / Extras / SubMenus / README < prev   
Encoding:
Text File  |  1995-05-03  |  1.5 KB  |  31 lines

  1. The files in this directory contained modifications that allow the menuBar
  2. class to support cascading submenus. The changes are:
  3.  
  4. * Change CmdList to derive from Cmd. This is interesting in several ways,
  5. because it makes a CmdList be a Cmd itself. That is, you can execute a
  6. CmdList. This opens the door to all kinds of possibilities - creating
  7. "macros" that consist of lists of Cmds that can be executed in sequence,
  8. history mechanisms, multi-level undo, etc. With respect to supporting
  9. submenus, it specifically allows a CmdList to contain other CmdList
  10. objects.
  11.  
  12. * Change MenuBar to "know" that CmdLists may contain other CmdLists. The
  13. new implementation works recursively to create a submenu for each CmdList
  14. it encounters. So if a CmdList contains nested CmdLists, cascading menus
  15. will be created. The only reasonable way I have come up with to do this is
  16. to have MenuBar explicitly test the type of each object on a list, using
  17. the className() method, and to cast any CmdList object as needed. While a
  18. bit ugly, this approach is consistent with the design of the Cmd
  19. architecture. Cmd's don't know anything about thier presentation - classes
  20. like MenuBar have to know what they are working with and create the
  21. appropriate presentation.
  22.  
  23. * MenuDemoWindow.C deomstrates how to construct a nest list of Cmds based
  24. on these changes.
  25.  
  26. To try these features, move the four MotifApp files into the MotifApp
  27. directory and rebuild. Move MenuDemoWindow to the ch9 directory and
  28. rebuild.
  29.  
  30.  
  31.