Re:How to un-popup a popup menu
Thanks, Peter.
Quote
>>Forget it, it will never work as you intend it to<<
But Word 97 does it. I wonder if any non-Microsoft products do it.
Maybe I've described my problem too narrowly. What I want is a regular menu
(or something that looks and behaves like a regular menu) somewhere other
than at the top of the form. In my case, I want a different menu on each
tab sheet of a page control.
It doesn't appear that I can get a regular menu to appear anywhere other
than at the top of the form. So I put a toolbar on the tab sheet, and added
a flat toolbutton. It looks right -- just like a menu. Setting the
DropdownMenu property of the toolbutton results in the problem I described:
Each time you click the toolbutton, it opens the popup rather than closing
it if it's already open. (So I tried unsuccessfully to write my own click
event code, as described earlier.)
If these Delphi controls are actually using the API controls, Word 97
appears to be using the same controls, except that Word 97 puts the toolbar
on a coolbar. So how does Word 97 have menus (which behave like real menus)
that appear at places other than the top of the form?
Quote
>>Even if you go to the trouble to use TrackPopupmenu and duplicate a lot
of
menu handling code in the Menus unit to get the message Windows sends to
the
menus owner when the menu is closed it will arrive *before* the button is
clicked. So if you reset your global flag in response to the message the
button will still always see the flag as False.<<
What if, in response to that message, I checked the location of the click
to see whether the click was on the button? In any event, it sounds too
complicated for me to write. Maybe this would be a good project for an
experienced component writer.