[osg-users] Cursor problem under Windows

2009-06-12 Thread Serge Lages
Hi all,

Currently (the SVN version of OSG), hidding the cursor under Windows has no
effect. Setting cursor to false on the traits or making something like :

osgViewer::ViewerBase::Windowswindows;

viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
windows.end(); ++itr)
{
   (*itr)-useCursor(false);
}

Doesn't work, I always see the cursor...
Any idea on which modification has break things ? The same code was working
for me some weeks ago, but I can't tell which revision it was...

Thanks !

Best regards,

-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cursor problem under Windows

2009-06-12 Thread Serge Lages
I have an update, using :

osgViewer::ViewerBase::Windowswindows;

viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
windows.end(); ++itr)
 {
//(*itr)-useCursor(false);
(*itr)-setCursor(osgViewer::GraphicsWindow::MouseCursor::NoCursor);
 }

Instead of setting useCursor(false) works, the cursor is invisible.

On Fri, Jun 12, 2009 at 12:23 PM, Serge Lages serge.la...@gmail.com wrote:

 Hi all,

 Currently (the SVN version of OSG), hidding the cursor under Windows has no
 effect. Setting cursor to false on the traits or making something like :

 osgViewer::ViewerBase::Windowswindows;

 viewer.getWindows(windows);
 for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
 windows.end(); ++itr)
 {
(*itr)-useCursor(false);
 }

 Doesn't work, I always see the cursor...
 Any idea on which modification has break things ? The same code was working
 for me some weeks ago, but I can't tell which revision it was...

 Thanks !

 Best regards,

 --
 Serge Lages
 http://www.tharsis-software.com




-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cursor problem under Windows

2009-06-12 Thread Robert Osfield
Hi Serge,

Good to hear you got it working, useCursor(false) should still work
though... so that is a bug.  Can you say which versions of the OSG
that useCursor(false) was still working on?  Have you tried out other
platforms?

Robert.

On Fri, Jun 12, 2009 at 7:22 PM, Serge Lagesserge.la...@gmail.com wrote:
 I have an update, using :

 osgViewer::ViewerBase::Windows    windows;

 viewer.getWindows(windows);
 for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
 windows.end(); ++itr)
  {
     //(*itr)-useCursor(false);
     (*itr)-setCursor(osgViewer::GraphicsWindow::MouseCursor::NoCursor);
  }

 Instead of setting useCursor(false) works, the cursor is invisible.

 On Fri, Jun 12, 2009 at 12:23 PM, Serge Lages serge.la...@gmail.com wrote:

 Hi all,

 Currently (the SVN version of OSG), hidding the cursor under Windows has
 no effect. Setting cursor to false on the traits or making something like :

 osgViewer::ViewerBase::Windows    windows;

 viewer.getWindows(windows);
 for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr
 != windows.end(); ++itr)
 {
    (*itr)-useCursor(false);
 }

 Doesn't work, I always see the cursor...
 Any idea on which modification has break things ? The same code was
 working for me some weeks ago, but I can't tell which revision it was...

 Thanks !

 Best regards,

 --
 Serge Lages
 http://www.tharsis-software.com



 --
 Serge Lages
 http://www.tharsis-software.com

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cursor problem under Windows

2009-06-12 Thread Serge Lages
Hi Robert,

I've only tried it on Windows, and about the version where it was working,
maybe it was 2 or 3 weeks ago, but I am really not sure, I've made a fresh
OSG compile last night from the SVN but I can't remember when I dit it the
previous time... :/

I'm really sorry to not investigate further but I don't have time currently,
I'll try to give it a look next week.

Best regards,

On Fri, Jun 12, 2009 at 8:34 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Serge,

 Good to hear you got it working, useCursor(false) should still work
 though... so that is a bug.  Can you say which versions of the OSG
 that useCursor(false) was still working on?  Have you tried out other
 platforms?

 Robert.

 On Fri, Jun 12, 2009 at 7:22 PM, Serge Lagesserge.la...@gmail.com wrote:
  I have an update, using :
 
  osgViewer::ViewerBase::Windowswindows;
 
  viewer.getWindows(windows);
  for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr
 !=
  windows.end(); ++itr)
   {
  //(*itr)-useCursor(false);
  (*itr)-setCursor(osgViewer::GraphicsWindow::MouseCursor::NoCursor);
   }
 
  Instead of setting useCursor(false) works, the cursor is invisible.
 
  On Fri, Jun 12, 2009 at 12:23 PM, Serge Lages serge.la...@gmail.com
 wrote:
 
  Hi all,
 
  Currently (the SVN version of OSG), hidding the cursor under Windows has
  no effect. Setting cursor to false on the traits or making something
 like :
 
  osgViewer::ViewerBase::Windowswindows;
 
  viewer.getWindows(windows);
  for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr
  != windows.end(); ++itr)
  {
 (*itr)-useCursor(false);
  }
 
  Doesn't work, I always see the cursor...
  Any idea on which modification has break things ? The same code was
  working for me some weeks ago, but I can't tell which revision it was...
 
  Thanks !
 
  Best regards,
 
  --
  Serge Lages
  http://www.tharsis-software.com
 
 
 
  --
  Serge Lages
  http://www.tharsis-software.com
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Cursor problem under Windows

2009-06-12 Thread Mark Sciabica

Hi Robert  Serge,

Here is the offending line:

void GraphicsWindowWin32::setCursorImpl( MouseCursor mouseCursor )
{
   if (_mouseCursor != mouseCursor)
   {
   _mouseCursor = mouseCursor;
   HCURSOR newCursor = getOrCreateCursor( mouseCursor);
   if (newCursor == _currentCursor) return;
  
   _currentCursor = newCursor;
   _traits-useCursor = (_currentCursor != NULL);   // Problem: 
Changing useCursor when setCursorImpl is called
  
   if (_mouseCursor != InheritCursor)

   ::SetCursor(_currentCursor);
   }
}

It looks like this line isn't really necessary, but if it is desired to 
change the useCursor mode when a cursor is set, it should be done in 
setCursor, and not setCursorImpl.


void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
{
   _appMouseCursor = mouseCursor;
   setCursorImpl(mouseCursor);
   _traits-useCursor = (_currentCursor != NULL);   // Line belongs 
here instead (if this behavior is desired).

}

From a design perspective, I think useCursor and setCursor methods 
should be orthogonal. Changing a cursor should not affect the useCursor 
state of the window. Orthogonal designs tend to be more flexible. So if 
it were up to me, I would simply delete the line with the result of a 
slight change in semantics of the setCursor function.


Serge, try moving the indicated line to the indicated function. If that 
doesn't work, delete it entirely. Some other code may be calling 
setCursor behind your back and turning it back on.


Regards,

Mark


Robert Osfield wrote:

Hi Serge,

Good to hear you got it working, useCursor(false) should still work
though... so that is a bug.  Can you say which versions of the OSG
that useCursor(false) was still working on?  Have you tried out other
platforms?

Robert.

On Fri, Jun 12, 2009 at 7:22 PM, Serge Lagesserge.la...@gmail.com wrote:
  

I have an update, using :

osgViewer::ViewerBase::Windowswindows;

viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
windows.end(); ++itr)
 {
//(*itr)-useCursor(false);
(*itr)-setCursor(osgViewer::GraphicsWindow::MouseCursor::NoCursor);
 }

Instead of setting useCursor(false) works, the cursor is invisible.

On Fri, Jun 12, 2009 at 12:23 PM, Serge Lages serge.la...@gmail.com wrote:


Hi all,

Currently (the SVN version of OSG), hidding the cursor under Windows has
no effect. Setting cursor to false on the traits or making something like :

osgViewer::ViewerBase::Windowswindows;

viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr
!= windows.end(); ++itr)
{
   (*itr)-useCursor(false);
}

Doesn't work, I always see the cursor...
Any idea on which modification has break things ? The same code was
working for me some weeks ago, but I can't tell which revision it was...

Thanks !

Best regards,

--
Serge Lages
http://www.tharsis-software.com
  


--
Serge Lages
http://www.tharsis-software.com

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org