How put an OleControlSite in read-only [message #372086] |
Tue, 29 July 2003 08:30 |
Eclipse User |
|
|
|
Originally posted by: asra.choukri.hyperoffice.fr
Hi,
I try to put my OleControlSite in read-only.
In fact, I use the "DHTMLEdit.DHTMLEdit" programme Id to write HTML Text.
After, I would like to prohibit my user to write in my HTML editor.
Any ideas?
Thanks .
Asra.
Here my code:
/*****************************************/
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleAutomation;
import org.eclipse.swt.ole.win32.OleControlSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.ole.win32.Variant;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class ReadOnlyOle {
public static void main (String [] args) {
Display display = new Display ();
Shell shell = new Shell (display);
RowLayout fl = new RowLayout();
shell.setLayout(fl);
OleFrame oleFrameHtml = new OleFrame(shell,
SWT.BORDER);
OleControlSite controlSiteHtml = new OleControlSite(oleFrameHtml, SWT.NONE,
"DHTMLEdit.DHTMLEdit");
controlSiteHtml.setSize(200, 200);
controlSiteHtml.doVerb(OLE.OLEIVERB_SHOW);
OleAutomation automationHtml = new
OleAutomation(controlSiteHtml);
int[] rgids =
automationHtml.getIDsOfNames(new String[] {"DocumentHTML"});
Variant returned =
automationHtml.getProperty(rgids[0]);
Variant[] rgvars = new Variant[1];
rgvars[0] = new Variant("my text HTML");
automationHtml.setProperty(rgids[0], rgvars);
///PUT MY OLECONTROLSITE in READ-ONLY
.....????
shell.pack ();
shell.open ();
while (!shell.isDisposed ()) {
if (!display.readAndDispatch
()) display.sleep ();
}
display.dispose ();
}
}
/*****************************************/
|
|
|
|
Re: How put an OleControlSite in read-only [message #372107 is a reply to message #372086] |
Tue, 29 July 2003 14:15 |
Eclipse User |
|
|
|
Originally posted by: steve_northover.ca.ibm.com
You could try one of the standard OLE properties and hope that your control
supports it.
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/com/htm/ole
ctrl_32r7.asp
You can look at the API of DHTMLEdit and see of a non-standard property or
IDispatch does what you want.
"asra" <asra.choukri@hyperoffice.fr> wrote in message
news:bg5bb7$hjk$1@eclipse.org...
> Hi,
>
> I try to put my OleControlSite in read-only.
> In fact, I use the "DHTMLEdit.DHTMLEdit" programme Id to write HTML Text.
> After, I would like to prohibit my user to write in my HTML editor.
>
> Any ideas?
>
> Thanks .
> Asra.
>
>
>
> Here my code:
>
> /*****************************************/
> import org.eclipse.swt.SWT;
>
> import org.eclipse.swt.layout.RowLayout;
>
> import org.eclipse.swt.ole.win32.OLE;
>
> import org.eclipse.swt.ole.win32.OleAutomation;
>
> import org.eclipse.swt.ole.win32.OleControlSite;
>
> import org.eclipse.swt.ole.win32.OleFrame;
>
> import org.eclipse.swt.ole.win32.Variant;
>
> import org.eclipse.swt.widgets.Display;
>
> import org.eclipse.swt.widgets.Shell;
>
>
>
> public class ReadOnlyOle {
>
> public static void main (String [] args) {
>
> Display display = new Display ();
>
> Shell shell = new Shell (display);
>
> RowLayout fl = new RowLayout();
>
> shell.setLayout(fl);
>
>
>
> OleFrame oleFrameHtml = new OleFrame(shell,
> SWT.BORDER);
>
> OleControlSite controlSiteHtml = new OleControlSite(oleFrameHtml,
SWT.NONE,
> "DHTMLEdit.DHTMLEdit");
>
> controlSiteHtml.setSize(200, 200);
>
> controlSiteHtml.doVerb(OLE.OLEIVERB_SHOW);
>
> OleAutomation automationHtml = new
> OleAutomation(controlSiteHtml);
>
>
>
>
>
> int[] rgids =
> automationHtml.getIDsOfNames(new String[] {"DocumentHTML"});
>
> Variant returned =
> automationHtml.getProperty(rgids[0]);
>
> Variant[] rgvars = new Variant[1];
>
> rgvars[0] = new Variant("my text HTML");
>
> automationHtml.setProperty(rgids[0],
rgvars);
>
>
>
> ///PUT MY OLECONTROLSITE in READ-ONLY
> ....????
>
>
>
> shell.pack ();
>
> shell.open ();
>
> while (!shell.isDisposed ()) {
>
> if
(!display.readAndDispatch
> ()) display.sleep ();
>
> }
>
> display.dispose ();
>
>
>
> }
>
>
> }
>
> /*****************************************/
>
>
>
>
>
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03308 seconds