- Timestamp:
- Dec 5, 2008, 2:48:29 PM (16 years ago)
- Location:
- trunk/source/visualization/OpenGL
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenGL/History
r897 r898 30 30 31 31 - G4OpenGLQtViewer.hh : Suppress WinSize private variable 32 - Now Could pass XString like 400x600-0+0 to viewers and set position and location. It 33 will work for Qt, X, Win32 for the moment. 32 34 33 35 24 October, Laurent Garnier -
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r897 r898 55 55 #include <qprocess.h> 56 56 #include <qapplication.h> 57 #include <qdesktopwidget.h> 57 58 58 59 #if QT_VERSION >= 0x040000 … … 186 187 GLWindow->setWindowTitle( name); 187 188 #endif 188 GLWindow->resize(fVP.GetWindowSizeHintX(), fVP.GetWindowSizeHintY()); 189 GLWindow->move(900,300); 189 fWinSize_x = fVP.GetWindowSizeHintX(); 190 fWinSize_y = fVP.GetWindowSizeHintY(); 191 192 //useful for MACOSX, we have to compt the menuBar height 193 unsigned int offset = QApplication::desktop()->height() 194 - QApplication::desktop()->availableGeometry().height(); 195 196 G4int YPos= fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height()); 197 if (fVP.GetWindowAbsoluteLocationHintY(QApplication::desktop()->height())< offset) { 198 YPos = offset; 199 } 200 GLWindow->resize(fWinSize_x, fWinSize_y); 201 GLWindow->move(fVP.GetWindowAbsoluteLocationHintX(QApplication::desktop()->width()),YPos); 190 202 GLWindow->show(); 191 203 192 // delete the pointer if close this193 // GLWindow->setAttribute(Qt::WA_DeleteOnClose);194 195 #if QT_VERSION >= 0x040000196 // QObject ::connect(GLWindow,197 // SIGNAL(rejected()),198 // this,199 // SLOT(dialogClosed()));200 #endif201 202 204 if(!fWindow) return; 203 205 #ifdef G4DEBUG -
trunk/source/visualization/OpenGL/src/G4OpenGLWin32Viewer.cc
r897 r898 117 117 } 118 118 119 fWinSize_x = fVP.GetWindowSizeHintX(); 120 fWinSize_y = fVP.GetWindowSizeHintY(); 121 int x_res=GetSystemMetrics(SM_CXSCREEN); 122 int y_res=GetSystemMetrics(SM_CYSCREEN); 123 124 //FIXME : NOT tested ! 119 125 fWindow = ::CreateWindow(className,fName.c_str(), 120 126 WS_OVERLAPPEDWINDOW, 121 127 //WS_CHILD | WS_VISIBLE, 122 0,0, 128 // 0,0, 129 fVP.GetWindowAbsoluteLocationHintX(x_res), 130 fVP.GetWindowAbsoluteLocationHintY(y_res), 123 131 fWinSize_x,fWinSize_y, 124 132 NULL, NULL, -
trunk/source/visualization/OpenGL/src/G4OpenGLXViewer.cc
r897 r898 214 214 215 215 // Window size and position... 216 G4int x_origin = 0;217 G4int y_origin = 0;218 216 size_hints = XAllocSizeHints(); 219 220 Window root_return; 221 int x_return, y_return; 222 unsigned int width_return, height_return; 223 unsigned int border_width_return; 224 unsigned int depth_return; 225 226 // get the parent window's geometry 227 XGetGeometry(dpy, XRootWindow (dpy, vi -> screen), &root_return, &x_return, &y_return, 228 &width_return, &height_return, &border_width_return, 229 &depth_return); 230 217 231 218 fWinSize_x = fVP.GetWindowSizeHintX(); 232 219 fWinSize_y = fVP.GetWindowSizeHintY(); 233 x_origin = fVP.GetWindowAbsoluteLocationHintX(width_return); 234 y_origin = fVP.GetWindowAbsoluteLocationHintY(height_return); 220 G4int x_origin = fVP.GetWindowAbsoluteLocationHintX(DisplayWidth(dpy, vi -> screen)); 221 G4int y_origin = fVP.GetWindowAbsoluteLocationHintY(DisplayHeight(dpy, vi -> screen)); 222 235 223 size_hints->base_width = fWinSize_x; 236 224 size_hints->base_height = fWinSize_y; -
trunk/source/visualization/OpenGL/src/G4OpenGLXmViewer.cc
r897 r898 126 126 borcol = XBlackPixelOfScreen (XtScreen(shell)); 127 127 128 fWinSize_x = fVP.GetWindowSizeHintX(); 129 fWinSize_y = fVP.GetWindowSizeHintY(); 130 G4int x_origin = fVP.GetWindowAbsoluteLocationHintX(DisplayWidth(dpy, vi -> screen)); 131 G4int y_origin = fVP.GetWindowAbsoluteLocationHintY(DisplayHeight(dpy, vi -> screen)); 132 128 133 XtVaSetValues (shell, 129 134 XtNvisual, vi -> visual, 130 XtNdepth, vi -> depth, 135 XtNdepth, vi -> depth, 131 136 XtNcolormap, cmap, 137 XtNwidth, fWinSize_x, 138 XtNheight, fWinSize_y, 139 XtNx, x_origin, 140 XtNy, y_origin, 132 141 XtNborderColor, &borcol, 133 142 XtNbackground, &bgnd, … … 593 602 // Once widget is realized (ie, associated with a created X window), we 594 603 // can bind the OpenGL rendering context to the window. 595 596 Dimension width, height;597 XtVaGetValues (glxarea,XmNwidth,&width,XmNheight,&height,NULL);598 fWinSize_x = (unsigned int) width;599 fWinSize_y = (unsigned int) height;600 604 601 605 win = XtWindow (glxarea);
Note: See TracChangeset
for help on using the changeset viewer.