G4OpenGLXmTopLevelShell.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 //Top level shell class
00030 
00031 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
00032 
00033 #include "G4OpenGLXmViewer.hh"
00034 #include "G4OpenGLXmTopLevelShell.hh"
00035 #include "G4OpenGLXmVWidgetContainer.hh"
00036 
00037 #include <Xm/Frame.h>
00038 #include <Xm/RowColumn.h>
00039 
00040 G4OpenGLXmTopLevelShell::G4OpenGLXmTopLevelShell (G4OpenGLXmViewer* v,
00041                                                   char* n) 
00042 {
00043   pView = v;
00044   ProcesspView ();
00045   name = n;
00046   toplevel = XtVaCreatePopupShell 
00047     (name,
00048      topLevelShellWidgetClass,
00049      top,
00050      
00051      XtNiconName, name,
00052      XtNtitle, name,
00053      XmNdeleteResponse, XmDO_NOTHING,
00054      XmNisHomogeneous, False,
00055      
00056      XtNvisual, visual, 
00057      XtNdepth, depth, 
00058      XtNcolormap, cmap, 
00059      XtNborderColor, borcol,
00060      XtNbackground, bgnd,
00061      NULL);
00062 
00063   frame = XtVaCreateManagedWidget (name,
00064                                    xmFrameWidgetClass,
00065                                    toplevel,
00066                                    
00067                                    XtNvisual, visual,
00068                                    XtNdepth, depth,
00069                                    XtNcolormap, cmap,
00070                                    XtNborderColor, borcol,
00071                                    XtNbackground, bgnd,
00072                                    
00073                                    NULL);
00074   
00075   
00076   
00077   top_box =  XtVaCreateManagedWidget (name,
00078                                       xmRowColumnWidgetClass,
00079                                       frame,
00080                                       
00081                                       XmNadjustMargin, True,
00082                                       XmNisHomogeneous, False,
00083                                       
00084                                       XtNvisual, visual,
00085                                       XtNdepth, depth,
00086                                       XtNcolormap, cmap,
00087                                       XtNborderColor, borcol,
00088                                       XtNbackground, bgnd,
00089                                       
00090                                       NULL);  
00091 
00092 }
00093 
00094 G4OpenGLXmTopLevelShell::~G4OpenGLXmTopLevelShell ()
00095 {
00096   XtDestroyWidget (toplevel);
00097 }
00098 
00099 void G4OpenGLXmTopLevelShell::AddChild (G4OpenGLXmVWidgetContainer* container)
00100 {
00101   container->AddYourselfTo (this);
00102 }
00103 
00104 void G4OpenGLXmTopLevelShell::Realize () 
00105 {
00106   Cardinal num_children;
00107   XtVaGetValues (toplevel,
00108                  XmNnumChildren, &num_children,
00109                  NULL);
00110 //  G4cout << name << " now parents " << num_children << " children." << G4endl;
00111   XtManageChild (toplevel);
00112   XtRealizeWidget (toplevel);
00113   XtPopup (toplevel, XtGrabNonexclusive);
00114 }
00115 
00116 Widget* G4OpenGLXmTopLevelShell::GetPointerToWidget ()
00117 {
00118   return &top_box;
00119 }
00120 
00121 char* G4OpenGLXmTopLevelShell::GetName ()
00122 {
00123   return name;
00124 }
00125 
00126 #endif

Generated on Mon May 27 17:49:11 2013 for Geant4 by  doxygen 1.4.7