Solved

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

Posted on 2004-10-13
6
666 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…

726 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