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,v 1.6 2006/06/29 21:19:46 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: $ |
---|
29 | // |
---|
30 | //Framed box container class |
---|
31 | |
---|
32 | #ifdef G4VIS_BUILD_OPENGLXM_DRIVER |
---|
33 | |
---|
34 | #include "G4OpenGLXmBox.hh" |
---|
35 | #include "G4OpenGLXmFramedBox.hh" |
---|
36 | #include "G4OpenGLXmVWidgetComponent.hh" |
---|
37 | #include "G4OpenGLXmVWidgetShell.hh" |
---|
38 | |
---|
39 | G4OpenGLXmFramedBox::G4OpenGLXmFramedBox (const char* n, |
---|
40 | G4bool r) : |
---|
41 | G4OpenGLXmBox (n, r) |
---|
42 | { |
---|
43 | frame = NULL; |
---|
44 | } |
---|
45 | |
---|
46 | G4OpenGLXmFramedBox::~G4OpenGLXmFramedBox () |
---|
47 | {} |
---|
48 | |
---|
49 | void G4OpenGLXmFramedBox::AddChild (G4OpenGLXmVWidgetComponent* component) |
---|
50 | { |
---|
51 | component->AddYourselfTo(this); |
---|
52 | Cardinal num_children; |
---|
53 | XtVaGetValues (box_row_col, |
---|
54 | XmNnumChildren, &num_children, |
---|
55 | NULL); |
---|
56 | // G4cout << name << " now parents " << num_children << " children." << G4endl; |
---|
57 | } |
---|
58 | |
---|
59 | void G4OpenGLXmFramedBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window) |
---|
60 | { |
---|
61 | |
---|
62 | pView = window->GetView (); |
---|
63 | ProcesspView (); |
---|
64 | char framename[50]; |
---|
65 | strcpy (framename, name); |
---|
66 | strcat (framename, "_frame"); |
---|
67 | |
---|
68 | parent = window->GetPointerToWidget (); |
---|
69 | frame = XtVaCreateManagedWidget (framename, |
---|
70 | xmFrameWidgetClass, |
---|
71 | *parent, |
---|
72 | |
---|
73 | XtNvisual, visual, |
---|
74 | XtNdepth, depth, |
---|
75 | XtNcolormap, cmap, |
---|
76 | XtNborderColor, borcol, |
---|
77 | XtNbackground, bgnd, |
---|
78 | |
---|
79 | NULL); |
---|
80 | |
---|
81 | |
---|
82 | |
---|
83 | box_row_col = XtVaCreateManagedWidget (name, |
---|
84 | xmRowColumnWidgetClass, |
---|
85 | frame, |
---|
86 | |
---|
87 | XmNadjustMargin, True, |
---|
88 | XmNisHomogeneous, False, |
---|
89 | XmNlabelString, (XmString)name, |
---|
90 | XmNradioAlwaysOne, radio, |
---|
91 | XmNradioBehavior, radio, |
---|
92 | |
---|
93 | XtNvisual, visual, |
---|
94 | XtNdepth, depth, |
---|
95 | XtNcolormap, cmap, |
---|
96 | XtNborderColor, borcol, |
---|
97 | XtNbackground, bgnd, |
---|
98 | |
---|
99 | NULL); |
---|
100 | |
---|
101 | } |
---|
102 | |
---|
103 | #endif |
---|