BCB Mailing List
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BCB] BCB1: Popup Troubles
Here's what I have now:
TPopupMenu *ToolMenu = new TPopupMenu (this);
PopupMenu = ToolMenu;
ToolMenu->AutoPopup = true;
TMenuItem *ToolItem = new TMenuItem(this);
ToolItem->Caption = "About TToolOne";
ToolMenu->Items->Add(ToolItem);
I am trying to get the same effect as the sample
component "Pie" found in the examples. I still do
not have this right. It compiles but the new
menuitem does not appear.
____________________Reply Separator____________________
Subject: Re: [BCB] BCB1: Popup Troubles
Author: <bcb-list@nospam.orionlink.net>
Date: 5/3/99 8:50 AM
Do you assign the PopupMenu property of the desired component?
i.e
component->PopupMenu = ToolMenu;
----------
> From: robert_hunt@nospam.nass.usda.gov
> To: bcb-list@nospam.orionlink.net
> Subject: [BCB] BCB1: Popup Troubles
> Date: Friday, April 30, 1999 1:58 PM
>
>
> Dear Builders,
>
> I am trying something new and I am having some trouble getting
> popup menus to work from a component. I have read what is
> available in the help files and it has left me with a puzzle.
> What I want to have is an extra menu item attached to the
> popup menu that comes up when right clicking on the component
> which is placed on a form. Here's what I have added to the
> component's constructor:
>
> ToolMenu = new TPopupMenu (this);
> ToolItem = new TMenuItem (this);
> ToolItem->MenuIndex=0;
> ToolItem->Caption="&About ToolOne";
>
> Here's the menu item click event:
>
> void __fastcall TToolOne::TToolItemClick(TObject *Sender)
> {
> ShowMessage("TToolOne 1.2 by Robert Hunt, April 1999");
> }
>
> I seem to be missing some basic understanding of how to do
> this. Can anyone share with me an example or point me to
> more information?
>
> TIA,
> Robert
> rhunt@nospam.nass.usda.gov
W Komornicki's Home Page |
Main Index |
Thread Index