I am using C++ Builder 2009 and AdvStickyPopupMenu version 1.3.1.5
.
I am dynamically adding MenuItems to the
AdvStickyPopupMenu which is set up as seen below. I have two static TButtonBar
items across the top. When I click any of these MenuItems or ButtonBar items it
triggers the event AdvStickyPopupMenu1ButtonClick(TObject *Sender, int Index).
The index values for the TButtonBar start at 0 and move +1 to the right. The
index values for the MenuItems start a 0 and move +1 down the menu list. How can
I determine if the click came from a MenuItem or a TButtonBar? If I have Index
= 0 I can look that up as either a ButtonBar or a MenuItem as seen below.
.
AdvStickyPopupMenu1->ButtonBar->Items[0]->Caption;
AdvStickyPopupMenu1->MenuItems->Items[0]->Caption;
.
//--AdvStickyPopupMenu1->MenuItems->Add();
i = AdvStickyPopupMenu1->MenuItems->Count;
AdvStickyPopupMenu1->MenuItems->Items[(i-1)]->Caption="Edit Your Text";
AdvStickyPopupMenu1->MenuItems->Items[(i-1)]->Style = isMenuItem;
Edit4_M->Text=MyText;
AdvStickyPopupMenu1->MenuItems->Items[(i-1)]->Control=Edit4_M;
AdvStickyPopupMenu1->MenuItems->Items[(i-1)]->ImageIndex=134;
AdvStickyPopupMenu1->MenuItems->Items[(i-1)]->OnClick=NULL;
//--
.
PS I have the OnClick=NULL in an attempt to block the event from being called. This did not work the vent is still triggered.
Patrick Mikula.