Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4OpenGLXmBox.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4OpenGLXmBox.cc 66373 2012-12-18 09:41:34Z gcosmo $
28 //
29 //Box container class
30 
31 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
32 
33 #include "G4OpenGLXmFramedBox.hh"
34 #include "G4OpenGLXmBox.hh"
37 #include <Xm/RowColumn.h>
38 #include <Xm/Xm.h>
39 
40 G4OpenGLXmBox::G4OpenGLXmBox (const char* n,
41  G4bool r)
42 {
43  name = n;
44  radio = r;
45  parent = NULL;
46  box_row_col = NULL;
47 }
48 
49 G4OpenGLXmBox::~G4OpenGLXmBox ()
50 {}
51 
52 void G4OpenGLXmBox::AddChild (G4OpenGLXmVWidgetComponent* component)
53 {
54  component->AddYourselfTo(this);
55  Cardinal num_children;
56  XtVaGetValues (box_row_col,
57  XmNnumChildren, &num_children,
58  NULL);
59 // G4cout << name << " now parents " << num_children << " children." << G4endl;
60 }
61 
62 void G4OpenGLXmBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window)
63 {
64 
65  pView = window->GetView ();
66  ProcesspView ();
67  parent = window->GetPointerToWidget ();
68 
69  box_row_col = XtVaCreateManagedWidget (name,
70  xmRowColumnWidgetClass,
71  *parent,
72 
73  XmNadjustMargin, True,
74  XmNisHomogeneous, False,
75  XmNlabelString, (XmString)name,
76  XmNradioAlwaysOne, radio,
77  XmNradioBehavior, radio,
78 
79  XtNvisual, visual,
80  XtNdepth, depth,
81  XtNcolormap, cmap,
82  XtNborderColor, borcol,
83  XtNbackground, bgnd,
84 
85  NULL);
86 
87 }
88 
89 Widget* G4OpenGLXmBox::GetPointerToParent ()
90 {
91  return parent;
92 }
93 
94 Widget* G4OpenGLXmBox::GetPointerToWidget ()
95 {
96  return &box_row_col;
97 }
98 
99 const char* G4OpenGLXmBox::GetName ()
100 {
101  return name;
102 }
103 
104 void G4OpenGLXmBox::SetName (const char* n)
105 {
106  name = n;
107 }
108 
109 #endif
const XML_Char * name
bool G4bool
Definition: G4Types.hh:79
const G4int n