Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to set the size of an ActiveX control?
How to set the size of an ActiveX control? [message #452608] Wed, 23 March 2005 10:40 Go to next message
Thomas Kriechbaum is currently offline Thomas KriechbaumFriend
Messages: 12
Registered: July 2009
Junior Member
I have embedded a custom (inhouse developed) ActiveX control via the
OleControlFrame and OleControlSite classes. When displaying the control
(OLE.OLEIVERB_OPEN) its size is fixed by 32 x 32 pixels. Even changing
the layout (GridLoyout) or the boundaries of the frame or the site
doesn’t help. When displaying the control by OLE.OLEIVERB_PRIMARY it
shows up as dialog with the expected size.

Is it necessary to set some properties (width, height) of the ActiveX
control?

Thanks in advance,
Thomas
Re: How to set the size of an ActiveX control? [message #452721 is a reply to message #452608] Wed, 23 March 2005 14:41 Go to previous messageGo to next message
Christophe Cornu is currently offline Christophe CornuFriend
Messages: 304
Registered: July 2009
Senior Member
Maybe you need to invoke OleFrame.setBounds on your OleFrame instance every
time your widget (that hosts your ActiveX and probably extend SWT composite)
is resized.

Listener listener = new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Resize: {
frame.setBounds(getClientArea());
break;
}
....
};
addListener(SWT.Resize, listener);

where frame is a reference to your OleFrame.

That's how the SWT Browser widget is doing it on Windows, look for
SWT.Resize at
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Ecl ipse%20SWT%20Browser/win32/org/eclipse/swt/browser/Browser.j ava?rev=HEAD&content-type=text/vnd.viewcvs-markup

Chris
Re: How to set the size of an ActiveX control? [message #452756 is a reply to message #452608] Thu, 24 March 2005 13:30 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
This would depend on the ActiveX control. For most controls, they just take
the size of the OleFrame. The OleFrame calls
IOleInPlaceActiveObject.ResizeBorder every time the OleFrame resizes to
inform the ActiveX control about size changes. Do you implement
IOleInPlaceActiveObject.ResizeBorder in your activeX control? What happens
if you use OLEIVERB_INPLACEACTIVATE?


"Thomas Kriechbaum" <kriechbaum@grz.at> wrote in message
news:d1rlrq$n03$1@news.eclipse.org...
>I have embedded a custom (inhouse developed) ActiveX control via the
>OleControlFrame and OleControlSite classes. When displaying the control
>(OLE.OLEIVERB_OPEN) its size is fixed by 32 x 32 pixels. Even changing the
>layout (GridLoyout) or the boundaries of the frame or the site doesn
Re: How to set the size of an ActiveX control? [message #452770 is a reply to message #452756] Thu, 24 March 2005 16:10 Go to previous messageGo to next message
Thomas Kriechbaum is currently offline Thomas KriechbaumFriend
Messages: 12
Registered: July 2009
Junior Member
Veronika Irvine wrote:
> This would depend on the ActiveX control. For most controls, they just take
> the size of the OleFrame. The OleFrame calls
> IOleInPlaceActiveObject.ResizeBorder every time the OleFrame resizes to
> inform the ActiveX control about size changes. Do you implement
> IOleInPlaceActiveObject.ResizeBorder in your activeX control? What happens
> if you use OLEIVERB_INPLACEACTIVATE?

OLEIVERB_INPLACEACTIVATE causes the same situation.

We are using the XSal2 ActiveX control
(http://www.iceteagroup.com/Products/XSal2.htt) to wrap an existing
Centura/SQL Windows application. This ActiveX control probably does not
implement the required interface. I’m trying to get more details about
XSal2. By the way, in C# the size can be controlled by setting the
Width- and Height-property.

Has anybody already integrated a Centura/SQL Windows application into
Eclipse?
Re: How to set the size of an ActiveX control? [message #452772 is a reply to message #452721] Thu, 24 March 2005 16:11 Go to previous messageGo to next message
Thomas Kriechbaum is currently offline Thomas KriechbaumFriend
Messages: 12
Registered: July 2009
Junior Member
Christophe Cornu wrote:
> Maybe you need to invoke OleFrame.setBounds on your OleFrame instance every
> time your widget (that hosts your ActiveX and probably extend SWT composite)
> is resized.
>
> Listener listener = new Listener() {
> public void handleEvent(Event e) {
> switch (e.type) {
> case SWT.Resize: {
> frame.setBounds(getClientArea());
> break;
> }
> ...
> };
> addListener(SWT.Resize, listener);
>
> where frame is a reference to your OleFrame.
>
> That's how the SWT Browser widget is doing it on Windows, look for
> SWT.Resize at
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt/Ecl ipse%20SWT%20Browser/win32/org/eclipse/swt/browser/Browser.j ava?rev=HEAD&content-type=text/vnd.viewcvs-markup
>
> Chris

Implementing a listener doesn’t help. Probably, the ActiveX control
(XSal2 - http://www.iceteagroup.com/Products/XSal2.htt) that we are
using to integrate an existing Centura/SQL Windows application does not
provide the required interfaces (IOleInPlaceActiveObject).
Re: How to set the size of an ActiveX control? [message #452774 is a reply to message #452770] Thu, 24 March 2005 16:17 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
You could probably also set the width and height property in SWT using
OleAutomation.setProperty().

For more details about OleAutomation see:

http://www.eclipse.org/articles/Article-ActiveX%20Support%20 in%20SWT/ActiveX%20Support%20in%20SWT.html


"Thomas Kriechbaum" <kriechbaum@grz.at> wrote in message
news:d1utjj$sgp$1@news.eclipse.org...
> Veronika Irvine wrote:
>> This would depend on the ActiveX control. For most controls, they just
>> take the size of the OleFrame. The OleFrame calls
>> IOleInPlaceActiveObject.ResizeBorder every time the OleFrame resizes to
>> inform the ActiveX control about size changes. Do you implement
>> IOleInPlaceActiveObject.ResizeBorder in your activeX control? What
>> happens if you use OLEIVERB_INPLACEACTIVATE?
>
> OLEIVERB_INPLACEACTIVATE causes the same situation.
>
> We are using the XSal2 ActiveX control
> (http://www.iceteagroup.com/Products/XSal2.htt) to wrap an existing
> Centura/SQL Windows application. This ActiveX control probably does not
> implement the required interface. I
Re: How to set the size of an ActiveX control? [message #452859 is a reply to message #452774] Fri, 25 March 2005 09:05 Go to previous messageGo to next message
Thomas Kriechbaum is currently offline Thomas KriechbaumFriend
Messages: 12
Registered: July 2009
Junior Member
Veronika Irvine wrote:
> You could probably also set the width and height property in SWT using
> OleAutomation.setProperty().
>
> For more details about OleAutomation see:
>
> http://www.eclipse.org/articles/Article-ActiveX%20Support%20 in%20SWT/ActiveX%20Support%20in%20SWT.html

Width and Height are not properties of the XSal2 ActiceX control itself
(only ApplicationName and FormName are accessible via OleAutomation). I

I think, that the C# statements

axXSalForms1.Width = 400;
axXSalForms1.Height = 200;

can be compared to the SWT statements

OleFrame frame = ...;
frame.setBounds(1, 1, 400, 200);

What is the minimal set of interfaces an ActiveX control must implement
to be displayed within an OleFrame container (sorry, I’m not familiar
with ActiveX development at all)?
Re: How to set the size of an ActiveX control? [message #453298 is a reply to message #452859] Mon, 04 April 2005 20:17 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
SWT uses OleCreate for non-licensed ActiveX controls. See the MSDN for
information about interfaces OleCreate requires.

"Thomas Kriechbaum" <kriechbaum@grz.at> wrote in message
news:4243D455.4090908@grz.at...
> Veronika Irvine wrote:
>> You could probably also set the width and height property in SWT using
>> OleAutomation.setProperty().
>>
>> For more details about OleAutomation see:
>>
>> http://www.eclipse.org/articles/Article-ActiveX%20Support%20 in%20SWT/ActiveX%20Support%20in%20SWT.html
>
> Width and Height are not properties of the XSal2 ActiceX control itself
> (only ApplicationName and FormName are accessible via OleAutomation). I
>
> I think, that the C# statements
>
> axXSalForms1.Width = 400;
> axXSalForms1.Height = 200;
>
> can be compared to the SWT statements
>
> OleFrame frame = ...;
> frame.setBounds(1, 1, 400, 200);
>
> What is the minimal set of interfaces an ActiveX control must implement to
> be displayed within an OleFrame container (sorry, I
Previous Topic:SWT for Palm OS
Next Topic:JDOM runs in normal mode, crashes in Debug mode
Goto Forum:
  


Current Time: Thu Apr 18 06:42:54 GMT 2024

Powered by FUDForum. Page generated in 0.03037 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top