Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLXmTopLevelShell.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$
28//
29//Top level shell class
30
31#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
32
33#include "G4OpenGLXmViewer.hh"
36
37#include <Xm/Frame.h>
38#include <Xm/RowColumn.h>
39
40G4OpenGLXmTopLevelShell::G4OpenGLXmTopLevelShell (G4OpenGLXmViewer* v,
41 char* n)
42{
43 pView = v;
44 ProcesspView ();
45 name = n;
46 toplevel = XtVaCreatePopupShell
47 (name,
48 topLevelShellWidgetClass,
49 top,
50
51 XtNiconName, name,
52 XtNtitle, name,
53 XmNdeleteResponse, XmDO_NOTHING,
54 XmNisHomogeneous, False,
55
56 XtNvisual, visual,
57 XtNdepth, depth,
58 XtNcolormap, cmap,
59 XtNborderColor, borcol,
60 XtNbackground, bgnd,
61 NULL);
62
63 frame = XtVaCreateManagedWidget (name,
64 xmFrameWidgetClass,
65 toplevel,
66
67 XtNvisual, visual,
68 XtNdepth, depth,
69 XtNcolormap, cmap,
70 XtNborderColor, borcol,
71 XtNbackground, bgnd,
72
73 NULL);
74
75
76
77 top_box = XtVaCreateManagedWidget (name,
78 xmRowColumnWidgetClass,
79 frame,
80
81 XmNadjustMargin, True,
82 XmNisHomogeneous, False,
83
84 XtNvisual, visual,
85 XtNdepth, depth,
86 XtNcolormap, cmap,
87 XtNborderColor, borcol,
88 XtNbackground, bgnd,
89
90 NULL);
91
92}
93
94G4OpenGLXmTopLevelShell::~G4OpenGLXmTopLevelShell ()
95{
96 XtDestroyWidget (toplevel);
97}
98
99void G4OpenGLXmTopLevelShell::AddChild (G4OpenGLXmVWidgetContainer* container)
100{
101 container->AddYourselfTo (this);
102}
103
104void G4OpenGLXmTopLevelShell::Realize ()
105{
106 Cardinal num_children;
107 XtVaGetValues (toplevel,
108 XmNnumChildren, &num_children,
109 NULL);
110// G4cout << name << " now parents " << num_children << " children." << G4endl;
111 XtManageChild (toplevel);
112 XtRealizeWidget (toplevel);
113 XtPopup (toplevel, XtGrabNonexclusive);
114}
115
116Widget* G4OpenGLXmTopLevelShell::GetPointerToWidget ()
117{
118 return &top_box;
119}
120
121char* G4OpenGLXmTopLevelShell::GetName ()
122{
123 return name;
124}
125
126#endif