Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Eno  
View profile  
 More options May 22 2008, 5:06 am
Newsgroups: comp.lang.smalltalk.dolphin
From: Eno <tg...@ms22.hinet.net>
Date: Thu, 22 May 2008 17:06:07 +0800
Local: Thurs, May 22 2008 5:06 am
Subject: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Hi,
  Firefox had every control of the browser activities, including the
browser contents editing, context menus modification, web 2.0
integration, addons etc, all these functions are quite fasicinating and
promising, I wondered whether Dolphin can achieve the same capacity,
using his URLPresenter/IWebBrowser2 ( exposing more functions of the
wrapped control ) ?
  First of all, can we modify/custom URLPresenter's context menus (
which is IE one by default ) to add new menuitem to trigger my own
search function etc ?

Best regards


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Udo Schneider  
View profile  
 More options May 22 2008, 5:09 pm
Newsgroups: comp.lang.smalltalk.dolphin
From: Udo Schneider <Udo.Schnei...@homeaddress.de>
Date: Thu, 22 May 2008 23:09:13 +0200
Local: Thurs, May 22 2008 5:09 pm
Subject: Re: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Eno,

>   First of all, can we modify/custom URLPresenter's context menus (
> which is IE one by default ) to add new menuitem to trigger my own
> search function etc ?

I'm not quite sure whether it's possible to customize the default menu
dynamically. You can do it globally (see
http://msdn.microsoft.com/en-us/library/aa741313(VS.85).aspx#Controll...
for more information) by tweaking the Registry Entries.

You can however replace it completely.

URLPresenterWithContextMenu (in package "US Internet Explorer
Extensions") allows you to control which context menu is displayed in a
WebControl:

    * If the presenters view #allowContextMenu aspect is false no
context menu will be shown. Neither a custom one nor the default one.
    * If the presenters view #allowContextMenu aspect is true it depends
on #contextMenu. If #contextMenu is not nil it will be displayed. If it
is nil the default one will be used.

Behind the scenes this presenter implements the
IDocHostUIHandlerDispatch interface to get queries for some UI events.
The interesting one here is ShowContextMenu() which allows you to
allow/prevent the display of the default context menu. I'm using this
method for the logic using #allowContextMenu and #contextMenu.

However for using this presenter no digging into COM is needed. Simply
use #allowContextMenu and #contextMenu as written above.

You can download the most recent version of my goodies here:
http://readthesourceluke.blogspot.com/

Hope this helps.

CU,

Udo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eno  
View profile  
 More options May 23 2008, 11:32 pm
Newsgroups: comp.lang.smalltalk.dolphin
From: Eno <tg...@ms22.hinet.net>
Date: Sat, 24 May 2008 11:32:49 +0800
Local: Fri, May 23 2008 11:32 pm
Subject: Re: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Hi Udo:

Udo Schneider wrote:
> Behind the scenes this presenter implements the
> IDocHostUIHandlerDispatch interface to get queries for some UI events.
> The interesting one here is ShowContextMenu() which allows you to
> allow/prevent the display of the default context menu. I'm using this
> method for the logic using #allowContextMenu and #contextMenu.

  Thanks again for your great help to fill in the missing stones, it
would be better if the #todo are implemented in futher update versions
of your packages.
  BTW, another question, could I get the selected text in the browser
from the underlying MSHTML controller ( via IWebBrowser2::get_Document
to get IHtmlDocument2 ?)

Best reguards.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eno  
View profile  
 More options May 24 2008, 4:42 am
Newsgroups: comp.lang.smalltalk.dolphin
From: Eno <tg...@ms22.hinet.net>
Date: Sat, 24 May 2008 16:42:00 +0800
Subject: Re: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Hi,
I found the following code work as I needed:

URLPresenter>>documentSelection
    | browser    |
   browser := self view controlDispatch.
   ^browser  document selection createRange text.

    It's just a quick workout, I think, without creating new
ImpType/IDispatch objects. Formal resolution might be needed.

Best regards.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Udo Schneider  
View profile  
 More options May 25 2008, 1:18 pm
Newsgroups: comp.lang.smalltalk.dolphin
From: Udo Schneider <Udo.Schnei...@homeaddress.de>
Date: Sun, 25 May 2008 19:18:22 +0200
Local: Sun, May 25 2008 1:18 pm
Subject: Re: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Eno,

>   Thanks again for your great help to fill in the missing stones, it
> would be better if the #todo are implemented in futher update versions
> of your packages.

The #todo Symbol and the comment are misleading - my mistake. Returning
E_NOTIMPL is perfectly legal for the non-implemented methods in this
interface. It simply tells the caller to use the default processing.
So we only return S_OK for the context menu stuff where we really do
something.

>   BTW, another question, could I get the selected text in the browser
> from the underlying MSHTML controller ( via IWebBrowser2::get_Document
> to get IHtmlDocument2 ?)

Just uploaded a new version. URLPresenter now has getSelectedText
methods for your convenience.

CU,

Udo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Udo Schneider  
View profile  
 More options May 25 2008, 1:20 pm
Newsgroups: comp.lang.smalltalk.dolphin
From: Udo Schneider <Udo.Schnei...@homeaddress.de>
Date: Sun, 25 May 2008 19:20:11 +0200
Local: Sun, May 25 2008 1:20 pm
Subject: Re: How to add/modify contextmenu of URLPresenter/IWebBrowser2 ?
Eno,

>     It's just a quick workout, I think, without creating new
> ImpType/IDispatch objects. Formal resolution might be needed.

This is fine - I'm doing nothing else in my goodies. However you should
wrap this in an exception handler as the Control throws errors. An
example is calling this method w/o selected text in the browser. This
sometimes throws errors as well.

CU,

Udo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »