Solved

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

Posted on 2004-10-13
6
667 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

691 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