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