home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / c / 11790 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1000 b 

  1. Path: sparky!uunet!vtserf!vtucs.cc.vt.edu!daves
  2. From: daves@vtucs.cc.vt.edu (Dave Sisson)
  3. Newsgroups: comp.lang.c
  4. Subject: Here's some pointers for TV and TMenuItems
  5. Keywords: TV, TMenuItem
  6. Message-ID: <5258@vtserf.cc.vt.edu>
  7. Date: 30 Jul 92 22:45:08 GMT
  8. Sender: usenet@vtserf.cc.vt.edu
  9. Organization: Virginia Tech, Blacksburg, VA
  10. Lines: 24
  11.  
  12.  
  13.     I (and later a co-worker) spent most of the afternoon trying to 
  14. figure out why my menu code wouldn't compile.  After some heavy duty
  15. looking into TMenuItem and TSubMenu (both which aren't in the help files)
  16. we discovered that Borland forgot to include an operator to concatenate
  17. TMenuItems.  Here's the short 4 lines of code that I hope they included
  18. in 3.1:
  19.  
  20. menu.h
  21.     TMenuItem& operator +(TMenuItem &i1, TMenuItem &i2);
  22.  
  23. menu.cpp
  24.     TMenuItem& operator +(TMenuItem &i1, TMenuItem &i2)
  25.     {
  26.     i1.next = &i2;
  27.  
  28.     return i1;
  29.     }
  30.  
  31.     Note:  you probably want to create your own menu.h and menu.cpp files
  32. instead of modifying their code.
  33.  
  34. --
  35.     Dave
  36.