G4OpenGLXmBox.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 //Box container class
00030 
00031 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
00032 
00033 #include "G4OpenGLXmFramedBox.hh"
00034 #include "G4OpenGLXmBox.hh"
00035 #include "G4OpenGLXmVWidgetComponent.hh"
00036 #include "G4OpenGLXmVWidgetShell.hh"
00037 #include <Xm/RowColumn.h>
00038 #include <Xm/Xm.h>
00039 
00040 G4OpenGLXmBox::G4OpenGLXmBox (const char* n, 
00041                               G4bool r)
00042 {
00043   name = n;
00044   radio = r;
00045   parent = NULL;
00046   box_row_col = NULL;
00047 }
00048 
00049 G4OpenGLXmBox::~G4OpenGLXmBox () 
00050 {}
00051 
00052 void G4OpenGLXmBox::AddChild (G4OpenGLXmVWidgetComponent* component)
00053 {
00054   component->AddYourselfTo(this);
00055   Cardinal num_children;
00056   XtVaGetValues (box_row_col,
00057                  XmNnumChildren, &num_children,
00058                  NULL);
00059 //  G4cout << name << " now parents " << num_children << " children." << G4endl;
00060 }
00061 
00062 void G4OpenGLXmBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window)
00063 {
00064 
00065   pView = window->GetView ();
00066   ProcesspView ();
00067   parent = window->GetPointerToWidget ();
00068   
00069   box_row_col =  XtVaCreateManagedWidget (name,
00070                                           xmRowColumnWidgetClass,
00071                                           *parent,
00072                                           
00073                                           XmNadjustMargin, True,
00074                                           XmNisHomogeneous, False,
00075                                           XmNlabelString, (XmString)name,
00076                                           XmNradioAlwaysOne, radio,
00077                                           XmNradioBehavior, radio,
00078                                           
00079                                           XtNvisual, visual,
00080                                           XtNdepth, depth,
00081                                           XtNcolormap, cmap,
00082                                           XtNborderColor, borcol,
00083                                           XtNbackground, bgnd,
00084                                           
00085                                           NULL);
00086   
00087 }
00088 
00089 Widget* G4OpenGLXmBox::GetPointerToParent ()
00090 {
00091   return parent;
00092 }
00093 
00094 Widget* G4OpenGLXmBox::GetPointerToWidget ()
00095 {
00096   return &box_row_col;
00097 }
00098 
00099 const char* G4OpenGLXmBox::GetName ()
00100 {
00101   return name;
00102 }
00103 
00104 void G4OpenGLXmBox::SetName (const char* n)
00105 {
00106   name = n;
00107 }
00108 
00109 #endif

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