Solved

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

Posted on 2004-10-13
6
660 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
ID: 12305503
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
ID: 12305688
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
ID: 12316894
> 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
ID: 12398357
please send the code of your 3rd party popupMenu...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 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

21 Experts available now in Live!

Get 1:1 Help Now