Solved

Delphi PopupMenu replacing with 3rd party component. (Newbie)

Posted on 2004-10-13
6
659 Views
Last Modified: 2007-12-19
Hi,

I am working on a soure code with TreeView component and with dynamically changing PopupMenu for this TreeView files and folders. However, I am required to change this Popupmenu with a 3d party Popupmenu with more fetaures and customization. I was able to replicate all previous Popupmenu Items onto the new one but the new 3rd party Popupmenu still lacks the basic (enabling/disabling menuitem) options for TreeView items.

I am unable to find information in source code to enable/disable menuitems on new Popupmenu for certain events for TreeView files/folders or even dynamically appearing new popupmenu-items for TreeView-items.

For example: for a TreeView item 'A' right clicking it displays Popupmenu with options (A and B) where 'A' is disabled (to select) and 'B' is enabled. But on new popupmenu both (A and B) are enabled all the time.

Thanks.

- Ad.
0
Comment
Question by:mdadnan
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 50 total points
Comment Utility
procedure TForm1.ListView1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  crs    : TPoint;
begin
  if (Button = mbRight) then
    begin
      // right mouse button clicked - popup the menu
      GetCursorPos(crs);
      // get the selected item
      if ListView1.Selected.Caption = 'A' then
        begin
          // disable item "Test"
          PopupMenu1.Items.Find('Test').Enabled := False;
          // popup the menu
          PopupMenu1.Popup(crs.X, crs.Y);
        end;
    end;
end;
0
 

Author Comment

by:mdadnan
Comment Utility
Thank you for your brief explanation. But I know the structure to work out the basics. But I am having problem finding the similar structure (used all possible means) in the original source code for a particular menu item.

My question is should I continue looking in the main sourcecode or menuitem with function can be loaded from a resource file?

Thank you for your reply.
0
 
LVL 12

Expert Comment

by:Ivanov_G
Comment Utility
> I am required to change this Popupmenu with a 3d party Popupmenu with more fetaures
> and customization

http://www.cooldev.com/coolmenuspro.html
http://www.torry.net/pages.php?id=149
0
 

Expert Comment

by:krypto2000
Comment Utility
please send the code of your 3rd party popupMenu...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now