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: G4OpenGLXmFourArrowButtons.cc,v 1.4 2001/07/11 10:08:57 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-01 $ 27 // 26 // 28 //Four arrow buttons class. Inherits from G4Op 27 //Four arrow buttons 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 "G4OpenGLXmFourArrowButtons.hh" 33 #include "G4OpenGLXmFourArrowButtons.hh" 33 #include <X11/Intrinsic.h> 34 #include <X11/Intrinsic.h> 34 #include <Xm/Form.h> << 35 #include <Xm/ArrowBG.h> << 36 << 37 #include "globals.hh" 35 #include "globals.hh" 38 36 39 G4OpenGLXmFourArrowButtons::G4OpenGLXmFourArro 37 G4OpenGLXmFourArrowButtons::G4OpenGLXmFourArrowButtons (XtCallbackRec** c) 40 : arrow_form(0) << 41 , arrow(0) << 42 , parent(0) << 43 { 38 { 44 callback = c; 39 callback = c; 45 } 40 } 46 41 47 G4OpenGLXmFourArrowButtons::~G4OpenGLXmFourArr 42 G4OpenGLXmFourArrowButtons::~G4OpenGLXmFourArrowButtons () 48 {} 43 {} 49 44 50 void G4OpenGLXmFourArrowButtons::AddYourselfTo 45 void G4OpenGLXmFourArrowButtons::AddYourselfTo (G4OpenGLXmVWidgetContainer* container) 51 { 46 { 52 47 53 pView = container->GetView (); 48 pView = container->GetView (); 54 ProcesspView (); 49 ProcesspView (); 55 50 56 parent = container->GetPointerToWidget (); 51 parent = container->GetPointerToWidget (); 57 52 58 arrow_form = XtVaCreateManagedWidget 53 arrow_form = XtVaCreateManagedWidget 59 ("arrow_form", 54 ("arrow_form", 60 xmFormWidgetClass, 55 xmFormWidgetClass, 61 *parent, 56 *parent, 62 XmNfractionBase, 3, 57 XmNfractionBase, 3, 63 58 64 XtNvisual, visual, 59 XtNvisual, visual, 65 XtNdepth, depth, 60 XtNdepth, depth, 66 XtNcolormap, cmap, 61 XtNcolormap, cmap, 67 XtNborderColor, borcol, 62 XtNborderColor, borcol, 68 XtNbackground, bgnd, 63 XtNbackground, bgnd, 69 64 70 NULL); 65 NULL); 71 66 72 67 73 ///////////////`up' arrow/////////////// 68 ///////////////`up' arrow/////////////// 74 arrow = XtVaCreateManagedWidget 69 arrow = XtVaCreateManagedWidget 75 ("up_arrow", 70 ("up_arrow", 76 xmArrowButtonGadgetClass, 71 xmArrowButtonGadgetClass, 77 arrow_form, 72 arrow_form, 78 73 79 XmNtopAttachment, XmATTACH_POSITION, 74 XmNtopAttachment, XmATTACH_POSITION, 80 XmNtopPosition, 0, 75 XmNtopPosition, 0, 81 76 82 XmNbottomAttachment, XmATTACH_POSITION, 77 XmNbottomAttachment, XmATTACH_POSITION, 83 XmNbottomPosition, 1, 78 XmNbottomPosition, 1, 84 79 85 XmNleftAttachment, XmATTACH_POSITION, 80 XmNleftAttachment, XmATTACH_POSITION, 86 XmNleftPosition, 1, 81 XmNleftPosition, 1, 87 82 88 XmNrightAttachment, XmATTACH_POSITION, 83 XmNrightAttachment, XmATTACH_POSITION, 89 XmNrightPosition, 2, 84 XmNrightPosition, 2, 90 85 91 XmNarrowDirection, XmARROW_UP, 86 XmNarrowDirection, XmARROW_UP, 92 XmNuserData, True, 87 XmNuserData, True, 93 NULL); 88 NULL); 94 89 95 XtAddCallbacks (arrow, 90 XtAddCallbacks (arrow, 96 XmNactivateCallback, 91 XmNactivateCallback, 97 callback[0]); 92 callback[0]); 98 93 99 XtAddCallbacks (arrow, 94 XtAddCallbacks (arrow, 100 XmNarmCallback, 95 XmNarmCallback, 101 callback[0]); 96 callback[0]); 102 97 103 XtAddCallbacks (arrow, 98 XtAddCallbacks (arrow, 104 XmNdisarmCallback, 99 XmNdisarmCallback, 105 callback[0]); 100 callback[0]); 106 101 107 ///////////////`down' arrow/////////////// 102 ///////////////`down' arrow/////////////// 108 arrow = XtVaCreateManagedWidget 103 arrow = XtVaCreateManagedWidget 109 ("down_arrow", 104 ("down_arrow", 110 xmArrowButtonGadgetClass, 105 xmArrowButtonGadgetClass, 111 arrow_form, 106 arrow_form, 112 107 113 XmNtopAttachment, XmATTACH_POSITION, 108 XmNtopAttachment, XmATTACH_POSITION, 114 XmNtopPosition, 2, 109 XmNtopPosition, 2, 115 110 116 XmNbottomAttachment, XmATTACH_POSITION, 111 XmNbottomAttachment, XmATTACH_POSITION, 117 XmNbottomPosition, 3, 112 XmNbottomPosition, 3, 118 113 119 XmNleftAttachment, XmATTACH_POSITION, 114 XmNleftAttachment, XmATTACH_POSITION, 120 XmNleftPosition, 1, 115 XmNleftPosition, 1, 121 116 122 XmNrightAttachment, XmATTACH_POSITION, 117 XmNrightAttachment, XmATTACH_POSITION, 123 XmNrightPosition, 2, 118 XmNrightPosition, 2, 124 119 125 XmNarrowDirection, XmARROW_DOWN, 120 XmNarrowDirection, XmARROW_DOWN, 126 XmNuserData, False, 121 XmNuserData, False, 127 NULL); 122 NULL); 128 123 129 XtAddCallbacks (arrow, 124 XtAddCallbacks (arrow, 130 XmNactivateCallback, 125 XmNactivateCallback, 131 callback[1]); 126 callback[1]); 132 127 133 XtAddCallbacks (arrow, 128 XtAddCallbacks (arrow, 134 XmNarmCallback, 129 XmNarmCallback, 135 callback[1]); 130 callback[1]); 136 131 137 XtAddCallbacks (arrow, 132 XtAddCallbacks (arrow, 138 XmNdisarmCallback, 133 XmNdisarmCallback, 139 callback[1]); 134 callback[1]); 140 135 141 ///////////////`left' arrow/////////////// 136 ///////////////`left' arrow/////////////// 142 arrow = XtVaCreateManagedWidget 137 arrow = XtVaCreateManagedWidget 143 ("left_arrow", 138 ("left_arrow", 144 xmArrowButtonGadgetClass, 139 xmArrowButtonGadgetClass, 145 arrow_form, 140 arrow_form, 146 141 147 XmNtopAttachment, XmATTACH_POSITION, 142 XmNtopAttachment, XmATTACH_POSITION, 148 XmNtopPosition, 1, 143 XmNtopPosition, 1, 149 144 150 XmNbottomAttachment, XmATTACH_POSITION, 145 XmNbottomAttachment, XmATTACH_POSITION, 151 XmNbottomPosition, 2, 146 XmNbottomPosition, 2, 152 147 153 XmNleftAttachment, XmATTACH_POSITION, 148 XmNleftAttachment, XmATTACH_POSITION, 154 XmNleftPosition, 0, 149 XmNleftPosition, 0, 155 150 156 XmNrightAttachment, XmATTACH_POSITION, 151 XmNrightAttachment, XmATTACH_POSITION, 157 XmNrightPosition, 1, 152 XmNrightPosition, 1, 158 153 159 XmNarrowDirection, XmARROW_LEFT, 154 XmNarrowDirection, XmARROW_LEFT, 160 XmNuserData, False, 155 XmNuserData, False, 161 NULL); 156 NULL); 162 157 163 XtAddCallbacks (arrow, 158 XtAddCallbacks (arrow, 164 XmNactivateCallback, 159 XmNactivateCallback, 165 callback[2]); 160 callback[2]); 166 161 167 XtAddCallbacks (arrow, 162 XtAddCallbacks (arrow, 168 XmNarmCallback, 163 XmNarmCallback, 169 callback[2]); 164 callback[2]); 170 165 171 XtAddCallbacks (arrow, 166 XtAddCallbacks (arrow, 172 XmNdisarmCallback, 167 XmNdisarmCallback, 173 callback[2]); 168 callback[2]); 174 169 175 ///////////////`right' arrow/////////////// 170 ///////////////`right' arrow/////////////// 176 arrow = XtVaCreateManagedWidget 171 arrow = XtVaCreateManagedWidget 177 ("right_arrow", 172 ("right_arrow", 178 xmArrowButtonGadgetClass, 173 xmArrowButtonGadgetClass, 179 arrow_form, 174 arrow_form, 180 175 181 XmNtopAttachment, XmATTACH_POSITION, 176 XmNtopAttachment, XmATTACH_POSITION, 182 XmNtopPosition, 1, 177 XmNtopPosition, 1, 183 178 184 XmNbottomAttachment, XmATTACH_POSITION, 179 XmNbottomAttachment, XmATTACH_POSITION, 185 XmNbottomPosition, 2, 180 XmNbottomPosition, 2, 186 181 187 XmNleftAttachment, XmATTACH_POSITION, 182 XmNleftAttachment, XmATTACH_POSITION, 188 XmNleftPosition, 2, 183 XmNleftPosition, 2, 189 184 190 XmNrightAttachment, XmATTACH_POSITION, 185 XmNrightAttachment, XmATTACH_POSITION, 191 XmNrightPosition, 3, 186 XmNrightPosition, 3, 192 187 193 XmNarrowDirection, XmARROW_RIGHT, 188 XmNarrowDirection, XmARROW_RIGHT, 194 XmNuserData, True, 189 XmNuserData, True, 195 NULL); 190 NULL); 196 191 197 XtAddCallbacks (arrow, 192 XtAddCallbacks (arrow, 198 XmNactivateCallback, 193 XmNactivateCallback, 199 callback[3]); 194 callback[3]); 200 195 201 XtAddCallbacks (arrow, 196 XtAddCallbacks (arrow, 202 XmNarmCallback, 197 XmNarmCallback, 203 callback[3]); 198 callback[3]); 204 199 205 XtAddCallbacks (arrow, 200 XtAddCallbacks (arrow, 206 XmNdisarmCallback, 201 XmNdisarmCallback, 207 callback[3]); 202 callback[3]); 208 203 209 } 204 } 210 205 211 Widget* G4OpenGLXmFourArrowButtons::GetPointer 206 Widget* G4OpenGLXmFourArrowButtons::GetPointerToParent () 212 { 207 { 213 return parent; 208 return parent; 214 } 209 } 215 210 216 Widget* G4OpenGLXmFourArrowButtons::GetPointer 211 Widget* G4OpenGLXmFourArrowButtons::GetPointerToWidget () 217 { 212 { 218 return &arrow_form; 213 return &arrow_form; 219 } 214 } >> 215 >> 216 #endif 220 217