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