Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4OpenGLXmFramedBox.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: G4OpenGLXmFramedBox.cc 66373 2012-12-18 09:41:34Z gcosmo $
28 //
29 //Framed box container class
30 
31 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
32 
33 #include "G4OpenGLXmBox.hh"
34 #include "G4OpenGLXmFramedBox.hh"
37 #include <Xm/RowColumn.h>
38 #include <Xm/Frame.h>
39 
40 G4OpenGLXmFramedBox::G4OpenGLXmFramedBox (const char* n,
41  G4bool r) :
42 G4OpenGLXmBox (n, r)
43 {
44  frame = NULL;
45 }
46 
47 G4OpenGLXmFramedBox::~G4OpenGLXmFramedBox ()
48 {}
49 
50 void G4OpenGLXmFramedBox::AddChild (G4OpenGLXmVWidgetComponent* component)
51 {
52  component->AddYourselfTo(this);
53  Cardinal num_children;
54  XtVaGetValues (box_row_col,
55  XmNnumChildren, &num_children,
56  NULL);
57 // G4cout << name << " now parents " << num_children << " children." << G4endl;
58 }
59 
60 void G4OpenGLXmFramedBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window)
61 {
62 
63  pView = window->GetView ();
64  ProcesspView ();
65  char framename[50];
66  strcpy (framename, name);
67  strcat (framename, "_frame");
68 
69  parent = window->GetPointerToWidget ();
70  frame = XtVaCreateManagedWidget (framename,
71  xmFrameWidgetClass,
72  *parent,
73 
74  XtNvisual, visual,
75  XtNdepth, depth,
76  XtNcolormap, cmap,
77  XtNborderColor, borcol,
78  XtNbackground, bgnd,
79 
80  NULL);
81 
82 
83 
84  box_row_col = XtVaCreateManagedWidget (name,
85  xmRowColumnWidgetClass,
86  frame,
87 
88  XmNadjustMargin, True,
89  XmNisHomogeneous, False,
90  XmNlabelString, (XmString)name,
91  XmNradioAlwaysOne, radio,
92  XmNradioBehavior, radio,
93 
94  XtNvisual, visual,
95  XtNdepth, depth,
96  XtNcolormap, cmap,
97  XtNborderColor, borcol,
98  XtNbackground, bgnd,
99 
100  NULL);
101 
102 }
103 
104 #endif
const XML_Char * name
bool G4bool
Definition: G4Types.hh:79
const G4int n