Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: G4OpenGLXmRadioButton.cc,v 1.5 2001/07/11 10:08:57 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 27 // 26 // 28 //Radio button class. Inherits from G4OpenGLXm 27 //Radio button class. Inherits from G4OpenGLXmVWidgetComponent 29 28 >> 29 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER >> 30 30 #include "G4OpenGLXmVWidgetComponent.hh" 31 #include "G4OpenGLXmVWidgetComponent.hh" 31 #include "G4OpenGLXmVWidgetContainer.hh" 32 #include "G4OpenGLXmVWidgetContainer.hh" 32 #include "G4OpenGLXmRadioButton.hh" 33 #include "G4OpenGLXmRadioButton.hh" 33 #include <X11/Intrinsic.h> 34 #include <X11/Intrinsic.h> 34 #include <Xm/ToggleB.h> << 35 << 36 #include "globals.hh" 35 #include "globals.hh" 37 36 38 G4OpenGLXmRadioButton::G4OpenGLXmRadioButton ( 37 G4OpenGLXmRadioButton::G4OpenGLXmRadioButton (const char* n, 39 XtCallbackRec* c, 38 XtCallbackRec* c, 40 G4bool d, 39 G4bool d, 41 G4int num) 40 G4int num) 42 : button(0) << 43 , parent(0) << 44 { 41 { 45 name = n; 42 name = n; 46 callback = c; 43 callback = c; 47 default_button = d; 44 default_button = d; 48 number = num; 45 number = num; 49 } 46 } 50 47 51 G4OpenGLXmRadioButton::~G4OpenGLXmRadioButton 48 G4OpenGLXmRadioButton::~G4OpenGLXmRadioButton () 52 {} 49 {} 53 50 54 void G4OpenGLXmRadioButton::SetName (const cha 51 void G4OpenGLXmRadioButton::SetName (const char* n) 55 { 52 { 56 name = n; 53 name = n; 57 XmString button_string = XmStringCreateLocal 54 XmString button_string = XmStringCreateLocalized ((char*)name); 58 XtVaSetValues (button, 55 XtVaSetValues (button, 59 XmNlabelString, button_string, 56 XmNlabelString, button_string, 60 NULL); 57 NULL); 61 XmStringFree (button_string); 58 XmStringFree (button_string); 62 } 59 } 63 60 64 const char* G4OpenGLXmRadioButton::GetName () 61 const char* G4OpenGLXmRadioButton::GetName () 65 { 62 { 66 return name; 63 return name; 67 } 64 } 68 65 69 void G4OpenGLXmRadioButton::AddYourselfTo (G4O 66 void G4OpenGLXmRadioButton::AddYourselfTo (G4OpenGLXmVWidgetContainer* container) 70 { 67 { 71 68 72 pView = container->GetView (); 69 pView = container->GetView (); 73 ProcesspView (); 70 ProcesspView (); 74 parent = container->GetPointerToWidget (); 71 parent = container->GetPointerToWidget (); 75 XmString button_string = XmStringCreateLocal 72 XmString button_string = XmStringCreateLocalized ((char*)name); 76 button = XtVaCreateManagedWidget (name, 73 button = XtVaCreateManagedWidget (name, 77 xmToggleButtonWidgetClass, 74 xmToggleButtonWidgetClass, 78 *parent, 75 *parent, 79 76 80 XmNlabelString, button_string, 77 XmNlabelString, button_string, 81 XmNset, default_button, 78 XmNset, default_button, 82 XmNuserData, number, 79 XmNuserData, number, 83 80 84 XtNvisual, visual, 81 XtNvisual, visual, 85 XtNdepth, depth, 82 XtNdepth, depth, 86 XtNcolormap, cmap, 83 XtNcolormap, cmap, 87 XtNborderColor, borcol, 84 XtNborderColor, borcol, 88 XtNbackground, bgnd, 85 XtNbackground, bgnd, 89 86 90 NULL); 87 NULL); 91 88 92 XtAddCallbacks (button, 89 XtAddCallbacks (button, 93 XmNarmCallback, 90 XmNarmCallback, 94 callback); 91 callback); 95 92 96 XmStringFree (button_string); 93 XmStringFree (button_string); 97 } 94 } 98 95 99 Widget* G4OpenGLXmRadioButton::GetPointerToPar 96 Widget* G4OpenGLXmRadioButton::GetPointerToParent () 100 { 97 { 101 return parent; 98 return parent; 102 } 99 } 103 100 104 Widget* G4OpenGLXmRadioButton::GetPointerToWid 101 Widget* G4OpenGLXmRadioButton::GetPointerToWidget () 105 { 102 { 106 return &button; 103 return &button; 107 } 104 } >> 105 >> 106 #endif 108 107