Added setWindowRectangle implementation for GraphicsWindowWin32, and

place holder for setWindowRectangle implementation for GraphicsWindowCarbon.
This commit is contained in:
Robert Osfield
2007-04-13 14:23:10 +00:00
parent 3deda9f2a7
commit 934ed30314
4 changed files with 19 additions and 0 deletions

View File

@@ -81,6 +81,9 @@ class GraphicsWindowCarbon : public osgViewer::GraphicsWindow
/** Check to see if any events have been generated.*/
virtual void checkEvents();
/** Set the window's position and size.*/
virtual void setWindowRectangle(int x, int y, int width, int height);
/** Set Window decoration.*/
virtual void setWindowDecoration(bool flag);

View File

@@ -60,6 +60,9 @@ class GraphicsWindowWin32 : public osgViewer::GraphicsWindow
/** Check to see if any events have been generated.*/
virtual void checkEvents();
/** Set the window's position and size.*/
virtual void setWindowRectangle(int x, int y, int width, int height);
/** Set Window decoration.*/
virtual void setWindowDecoration(bool flag);

View File

@@ -1060,6 +1060,11 @@ void GraphicsWindowCarbon::checkEvents()
}
void GraphicsWindowCarbon::setWindowRectangle(int x, int y, int width, int height)
{
// TODO: implement
osg::notify(osg::NOTICE)<<"GraphicsWindowCarbon::setWindowRectangle(..) not implemented."<<std::endl;
}
void GraphicsWindowCarbon::grabFocus()
{

View File

@@ -1708,6 +1708,14 @@ void GraphicsWindowWin32::requestWarpPointer( float x, float y )
getEventQueue()->mouseWarped(x,y);
}
void GraphicsWindowWin32::setWindowRectangle(int x, int y, int width, int height)
{
if (!::SetWindowPos(_hwnd, HWND_TOP, x, y, width, height, SWP_SHOWWINDOW | SWP_FRAMECHANGED))
{
reportErrorForScreen("GraphicsWindowWin32::setWindowRectangle() - Unable to set new window position and size", _traits->screenNum, ::GetLastError());
}
}
void GraphicsWindowWin32::useCursor( bool cursorOn )
{
_traits->useCursor = cursorOn;