source: trunk/geant4/visualization/OpenGL/src/G4OpenGLXmBox.cc @ 631

Last change on this file since 631 was 631, checked in by garnier, 17 years ago

maj a jour par rapport au repository de geant4

  • Property svn:mime-type set to text/cpp
File size: 3.2 KB
Line 
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: G4OpenGLXmBox.cc,v 1.6 2006/06/29 21:19:40 gunter Exp $
28// GEANT4 tag $Name:  $
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"
38
39G4OpenGLXmBox::G4OpenGLXmBox (const char* n,
40                              G4bool r)
41{
42  name = n;
43  radio = r;
44  parent = NULL;
45  box_row_col = NULL;
46}
47
48G4OpenGLXmBox::~G4OpenGLXmBox ()
49{}
50
51void G4OpenGLXmBox::AddChild (G4OpenGLXmVWidgetComponent* component)
52{
53  component->AddYourselfTo(this);
54  Cardinal num_children;
55  XtVaGetValues (box_row_col,
56                 XmNnumChildren, &num_children,
57                 NULL);
58//  G4cout << name << " now parents " << num_children << " children." << G4endl;
59}
60
61void G4OpenGLXmBox::AddYourselfTo (G4OpenGLXmVWidgetShell* window)
62{
63
64  pView = window->GetView ();
65  ProcesspView ();
66  parent = window->GetPointerToWidget ();
67 
68  box_row_col =  XtVaCreateManagedWidget (name,
69                                          xmRowColumnWidgetClass,
70                                          *parent,
71                                         
72                                          XmNadjustMargin, True,
73                                          XmNisHomogeneous, False,
74                                          XmNlabelString, (XmString)name,
75                                          XmNradioAlwaysOne, radio,
76                                          XmNradioBehavior, radio,
77                                         
78                                          XtNvisual, visual,
79                                          XtNdepth, depth,
80                                          XtNcolormap, cmap,
81                                          XtNborderColor, borcol,
82                                          XtNbackground, bgnd,
83                                         
84                                          NULL);
85 
86}
87
88Widget* G4OpenGLXmBox::GetPointerToParent ()
89{
90  return parent;
91}
92
93Widget* G4OpenGLXmBox::GetPointerToWidget ()
94{
95  return &box_row_col;
96}
97
98const char* G4OpenGLXmBox::GetName ()
99{
100  return name;
101}
102
103void G4OpenGLXmBox::SetName (const char* n)
104{
105  name = n;
106}
107
108#endif
Note: See TracBrowser for help on using the repository browser.