bsalsa - Delphi tips, tricks, code snippets,Samples Component Search Engine.

The current search engine database includes about 5000 Delphi web sites and growing...

By pressing the button, you can add the Search engine to your iGoogle. Add to Google


Go Back   EmbeddedWB - bsalsa forum > TEmbeddedWB component > TEmbeddedWB FAQ & Articles
Register FAQDonate Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-08-2009, 01:39 AM   #1
smot
Main Developer
 
smot's Avatar
 
Join Date: May 2006
Posts: 913
Post How to display a custom popup menu in TEmbeddedWB?

Question:

How to display a custom popup menu in TEmbeddedWB?

Answer:

a)

In the Object Inspector,

- assign a TPopupMenu to the EmbeddedWB

- Set DisabledPopupMenus := [rcmAll]

b)

- Assign a OnShowContextMenu handler in the Object Inspector
- Return S_OK (to disable all context menus)
- Popup a PopupMenu / the assigned TPopupMenu

Example: Only display a custom Popup menu for CONTEXT_MENU_IMAGE

Code:
procedure TForm1.EmbeddedWB1ShowContextMenu(Sender: TCustomEmbeddedWB;
  const dwID: Cardinal; const ppt: PPoint; const CommandTarget: IInterface;
  const Context: IDispatch; var Result: HRESULT);
begin
  if dwID = CONTEXT_MENU_IMAGE then
  begin
    Sender.PopupMenu.Popup(ppt.X, ppt.Y);
    Result := S_OK;
  end;
end;
smot is offline   Reply With Quote
Old 06-02-2010, 06:36 PM   #2
jacks2028
Junior Member
 
Join Date: Jun 2010
Posts: 4
You ask the question and you also give the answer very strange but That's very good information for sharing. This post is really nice. Now I know how to display custom pop-up menu in a embedded window.
jacks2028 is offline   Reply With Quote
Reply

Tags
contextmenu

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT +3. The time now is 11:24 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
bsalsa@gmail.com