Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Why doens't my MouseTrackListener work?...
Why doens't my MouseTrackListener work?... [message #441443] Mon, 16 August 2004 13:38 Go to next message
Eclipse UserFriend
Originally posted by: tim.seed.lvs.co.uk

Hi all.

I'm trying to add a MouseTrackListener to an OleControlSite. I add the
listener and then nothing happens. Could anyone out there help me?

Here is the code.

public HierarchicalFlexGrid(final Composite shell, int style) {
try {
composite = new Composite(shell, style);
frame = new OleFrame(composite, SWT.NULL);
controlSite = new OleControlSite(frame, SWT.NONE,
"MSHierarchicalFlexGridLib.MSHFlexGrid");
controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
} catch (SWTError e) {
System.out.println("Unable to open activeX control");
return;
}

grid = new OleAutomation(controlSite);

composite.setLayout(new FormLayout());

FormData formDataFrame = new FormData();
formDataFrame.top = new FormAttachment(0,0);
formDataFrame.left = new FormAttachment(0,0);
formDataFrame.right = new FormAttachment(100,0);
formDataFrame.bottom = new FormAttachment(100,0);
frame.setLayoutData(formDataFrame);

/* try and mimick the look and feel of an SWT table / ListView
control */
setGridColor(COLOR_GREY);
setAllowBigSelection(false);
setFixedRows(1);
setFixedCols(0);
setBackColorBkg(getBackColor());
setGridColorFixed(COLOR_GREY);
setGridLinesFixed(C_flexGridFlat);
setAppearance(C_flexFlat);
setAutoResize(true);
setScrollTrack(true);

// the multiLineText control is a permanently hidden control
// that is used to calculate word wrapping in cells
multiLineText = new Text(composite, SWT.WRAP);
multiLineText.setVisible(false);
FormData formData = new FormData();
formData.top = new FormAttachment(frame, 0, 128);
formData.left = new FormAttachment(frame, 0, 16384);
multiLineText.setLayoutData(formData);

controlSite.addMouseTrackListener(new MouseTrackAdapter() {
public void mouseEnter(MouseEvent e) {
System.out.println("Enter");
}

public void mouseExit(MouseEvent e) {
System.out.println("Exit");
}

public void mouseHover(MouseEvent e) {
System.out.println("Hover");
}
});
}
Re: Why doens't my MouseTrackListener work?... [message #441548 is a reply to message #441443] Mon, 16 August 2004 21:48 Go to previous messageGo to next message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
ActiveX Controls each have their own defined events which you must access
through OleControlSite.addEventListener.

The Control you are looking at seems to have an EnterCell and LeaveCell
event but nothing that looks like the equivalent of hover:


http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/mshflx98/dt_vbctlMSHFlexGridControl_E.asp

However, you should look at the typelibrary info for you control to see if
there is one.


"Tim Seed" <tim.seed@lvs.co.uk> wrote in message
news:cfqdd4$qbm$1@eclipse.org...
> Hi all.
>
> I'm trying to add a MouseTrackListener to an OleControlSite. I add the
> listener and then nothing happens. Could anyone out there help me?
>
> Here is the code.
>
> public HierarchicalFlexGrid(final Composite shell, int style) {
> try {
> composite = new Composite(shell, style);
> frame = new OleFrame(composite, SWT.NULL);
> controlSite = new OleControlSite(frame, SWT.NONE,
> "MSHierarchicalFlexGridLib.MSHFlexGrid");
> controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
> } catch (SWTError e) {
> System.out.println("Unable to open activeX control");
> return;
> }
>
> grid = new OleAutomation(controlSite);
>
> composite.setLayout(new FormLayout());
>
> FormData formDataFrame = new FormData();
> formDataFrame.top = new FormAttachment(0,0);
> formDataFrame.left = new FormAttachment(0,0);
> formDataFrame.right = new FormAttachment(100,0);
> formDataFrame.bottom = new FormAttachment(100,0);
> frame.setLayoutData(formDataFrame);
>
> /* try and mimick the look and feel of an SWT table / ListView
> control */
> setGridColor(COLOR_GREY);
> setAllowBigSelection(false);
> setFixedRows(1);
> setFixedCols(0);
> setBackColorBkg(getBackColor());
> setGridColorFixed(COLOR_GREY);
> setGridLinesFixed(C_flexGridFlat);
> setAppearance(C_flexFlat);
> setAutoResize(true);
> setScrollTrack(true);
>
> // the multiLineText control is a permanently hidden control
> // that is used to calculate word wrapping in cells
> multiLineText = new Text(composite, SWT.WRAP);
> multiLineText.setVisible(false);
> FormData formData = new FormData();
> formData.top = new FormAttachment(frame, 0, 128);
> formData.left = new FormAttachment(frame, 0, 16384);
> multiLineText.setLayoutData(formData);
>
> controlSite.addMouseTrackListener(new MouseTrackAdapter() {
> public void mouseEnter(MouseEvent e) {
> System.out.println("Enter");
> }
>
> public void mouseExit(MouseEvent e) {
> System.out.println("Exit");
> }
>
> public void mouseHover(MouseEvent e) {
> System.out.println("Hover");
> }
> });
> }
>
>
Re: Why doens't my MouseTrackListener work?... [message #441611 is a reply to message #441548] Tue, 17 August 2004 11:41 Go to previous message
Eclipse UserFriend
Originally posted by: tim.seed.lvs.co.uk

Thanks for the help Veronika.


Veronika Irvine wrote:

> ActiveX Controls each have their own defined events which you must access
> through OleControlSite.addEventListener.

> The Control you are looking at seems to have an EnterCell and LeaveCell
> event but nothing that looks like the equivalent of hover:


>
http://msdn.microsoft.com/library/default.asp?url=/library/e n-us/mshflx98/dt_vbctlMSHFlexGridControl_E.asp

> However, you should look at the typelibrary info for you control to see if
> there is one.


> "Tim Seed" <tim.seed@lvs.co.uk> wrote in message
> news:cfqdd4$qbm$1@eclipse.org...
> > Hi all.
> >
> > I'm trying to add a MouseTrackListener to an OleControlSite. I add the
> > listener and then nothing happens. Could anyone out there help me?
> >
> > Here is the code.
> >
> > public HierarchicalFlexGrid(final Composite shell, int style) {
> > try {
> > composite = new Composite(shell, style);
> > frame = new OleFrame(composite, SWT.NULL);
> > controlSite = new OleControlSite(frame, SWT.NONE,
> > "MSHierarchicalFlexGridLib.MSHFlexGrid");
> > controlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
> > } catch (SWTError e) {
> > System.out.println("Unable to open activeX control");
> > return;
> > }
> >
> > grid = new OleAutomation(controlSite);
> >
> > composite.setLayout(new FormLayout());
> >
> > FormData formDataFrame = new FormData();
> > formDataFrame.top = new FormAttachment(0,0);
> > formDataFrame.left = new FormAttachment(0,0);
> > formDataFrame.right = new FormAttachment(100,0);
> > formDataFrame.bottom = new FormAttachment(100,0);
> > frame.setLayoutData(formDataFrame);
> >
> > /* try and mimick the look and feel of an SWT table / ListView
> > control */
> > setGridColor(COLOR_GREY);
> > setAllowBigSelection(false);
> > setFixedRows(1);
> > setFixedCols(0);
> > setBackColorBkg(getBackColor());
> > setGridColorFixed(COLOR_GREY);
> > setGridLinesFixed(C_flexGridFlat);
> > setAppearance(C_flexFlat);
> > setAutoResize(true);
> > setScrollTrack(true);
> >
> > // the multiLineText control is a permanently hidden control
> > // that is used to calculate word wrapping in cells
> > multiLineText = new Text(composite, SWT.WRAP);
> > multiLineText.setVisible(false);
> > FormData formData = new FormData();
> > formData.top = new FormAttachment(frame, 0, 128);
> > formData.left = new FormAttachment(frame, 0, 16384);
> > multiLineText.setLayoutData(formData);
> >
> > controlSite.addMouseTrackListener(new MouseTrackAdapter() {
> > public void mouseEnter(MouseEvent e) {
> > System.out.println("Enter");
> > }
> >
> > public void mouseExit(MouseEvent e) {
> > System.out.println("Exit");
> > }
> >
> > public void mouseHover(MouseEvent e) {
> > System.out.println("Hover");
> > }
> > });
> > }
> >
> >
Previous Topic:How to add a ToolItem on a CTabItem to close it?
Next Topic:RCP general question
Goto Forum:
  


Current Time: Thu Mar 28 16:10:44 GMT 2024

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

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

Back to the top