Ignore:
Timestamp:
Nov 27, 2008, 4:56:05 PM (15 years ago)
Author:
garnier
Message:

make 3.80 added because 3.81 is bad

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/management/src/G4VisCommandsViewer.cc

    r891 r893  
    685685    windowSizeHintString = ossw.str();
    686686  }
    687   fpVisManager->SetWindowSizeHint (windowSizeHint, windowSizeHint);
    688   fpVisManager->SetXGeometryString(windowSizeHintString);
    689687  // WindowSizeHint and XGeometryString are picked up from the vis
    690688  // manager in the G4VViewer constructor.  They have to be held by
     
    694692
    695693  int x,y = 0;
    696   unsigned int w,h = 9999999;
     694  unsigned int w,h = 0;
    697695
    698696  int m = ParseGeometry( windowSizeHintString, &x, &y, &w, &h );
    699697  //  QSize minSize = main_widget->minimumSize();
    700698  //  QSize maxSize = main_widget->maximumSize();
    701   if ( (m & XValue) == 0 )
    702     x = -1;
    703   if ( (m & YValue) == 0 )
    704     y = -2;
    705   if ( (m & WidthValue) == 0 )
    706     w = -3;
    707   if ( (m & HeightValue) == 0 )
    708     h = -4;
    709 //   w = QMIN(w,maxSize.width());
    710 //   h = QMIN(h,maxSize.height());
    711 //   w = QMAX(w,minSize.width());
    712 //   h = QMAX(h,minSize.height());
    713 //   if ( (m & XNegative) ) {
    714 //     x = desktop()->width()  + x - w;
    715 //     qt_widget_tlw_gravity = 3;
    716 //   }
    717 //   if ( (m & YNegative) ) {
    718 //              y = desktop()->height() + y - h;
    719 //              qt_widget_tlw_gravity = (m & XNegative) ? 9 : 7;
    720 //   }
    721 //   main_widget->setGeometry( x, y, w, h );
     699  if ( ((m & YValue) == 0) ||
     700       ((m & XValue) == 0) ||
     701       ((m & HeightValue) == 0 ) ||
     702       ((m & WidthValue)  == 0 )) {
     703    if (verbosity >= G4VisManager::errors) {
     704      G4cout << "ERROR: Unrecognised geometry string \""
     705             << windowSizeHintString
     706             << "\".  Using 100 for X and Y location."
     707             << "\".  Using 600 for Width and Height."
     708             << G4endl;
     709    }
     710    x = 100;
     711    y = 100;
     712    w = 600;
     713    h = 600;
     714  }
    722715
    723716#ifdef G4DEBUG
    724717  printf  ("Lecture X:%d Y:%d W:%d H:%d\n",x,y,w,h);
    725   ////////
    726718#endif
     719
    727720
    728721  // Create viewer.
    729722  fpVisManager -> CreateViewer (newName);
     723
     724  // set parameters AFTER
     725  fpVisManager->SetWindowSizeHint (w,h);
     726  fpVisManager->SetWindowLocationHint (x,y);
     727  fpVisManager->SetXGeometryString(windowSizeHintString);
    730728  G4VViewer* newViewer = fpVisManager -> GetCurrentViewer ();
    731729  if (newViewer && newViewer -> GetName () == newName) {
Note: See TracChangeset for help on using the changeset viewer.