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

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