home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!vtserf!vtucs.cc.vt.edu!daves
- From: daves@vtucs.cc.vt.edu (Dave Sisson)
- Newsgroups: comp.lang.c
- Subject: Here's some pointers for TV and TMenuItems
- Keywords: TV, TMenuItem
- Message-ID: <5258@vtserf.cc.vt.edu>
- Date: 30 Jul 92 22:45:08 GMT
- Sender: usenet@vtserf.cc.vt.edu
- Organization: Virginia Tech, Blacksburg, VA
- Lines: 24
-
-
- I (and later a co-worker) spent most of the afternoon trying to
- figure out why my menu code wouldn't compile. After some heavy duty
- looking into TMenuItem and TSubMenu (both which aren't in the help files)
- we discovered that Borland forgot to include an operator to concatenate
- TMenuItems. Here's the short 4 lines of code that I hope they included
- in 3.1:
-
- menu.h
- TMenuItem& operator +(TMenuItem &i1, TMenuItem &i2);
-
- menu.cpp
- TMenuItem& operator +(TMenuItem &i1, TMenuItem &i2)
- {
- i1.next = &i2;
-
- return i1;
- }
-
- Note: you probably want to create your own menu.h and menu.cpp files
- instead of modifying their code.
-
- --
- Dave
-