Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4OpenGLXmTopLevelShell.cc
이 파일의 문서화 페이지로 가기
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: G4OpenGLXmTopLevelShell.cc 66373 2012-12-18 09:41:34Z gcosmo $
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 
40 G4OpenGLXmTopLevelShell::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 
94 G4OpenGLXmTopLevelShell::~G4OpenGLXmTopLevelShell ()
95 {
96  XtDestroyWidget (toplevel);
97 }
98 
99 void G4OpenGLXmTopLevelShell::AddChild (G4OpenGLXmVWidgetContainer* container)
100 {
101  container->AddYourselfTo (this);
102 }
103 
104 void 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 
116 Widget* G4OpenGLXmTopLevelShell::GetPointerToWidget ()
117 {
118  return &top_box;
119 }
120 
121 char* G4OpenGLXmTopLevelShell::GetName ()
122 {
123  return name;
124 }
125 
126 #endif
const XML_Char * name
Definition: expat.h:151
Char_t n[5]