Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: G4OpenGLXmFourArrowButtons.cc 68043 2013-03-13 14:27:49Z gcosmo $ 27 // 28 // 28 //Four arrow buttons class. Inherits from G4Op 29 //Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent 29 30 >> 31 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER >> 32 30 #include "G4OpenGLXmVWidgetComponent.hh" 33 #include "G4OpenGLXmVWidgetComponent.hh" 31 #include "G4OpenGLXmVWidgetContainer.hh" 34 #include "G4OpenGLXmVWidgetContainer.hh" 32 #include "G4OpenGLXmFourArrowButtons.hh" 35 #include "G4OpenGLXmFourArrowButtons.hh" 33 #include <X11/Intrinsic.h> 36 #include <X11/Intrinsic.h> 34 #include <Xm/Form.h> 37 #include <Xm/Form.h> 35 #include <Xm/ArrowBG.h> 38 #include <Xm/ArrowBG.h> 36 39 37 #include "globals.hh" 40 #include "globals.hh" 38 41 39 G4OpenGLXmFourArrowButtons::G4OpenGLXmFourArro 42 G4OpenGLXmFourArrowButtons::G4OpenGLXmFourArrowButtons (XtCallbackRec** c) 40 : arrow_form(0) 43 : arrow_form(0) 41 , arrow(0) 44 , arrow(0) 42 , parent(0) 45 , parent(0) 43 { 46 { 44 callback = c; 47 callback = c; 45 } 48 } 46 49 47 G4OpenGLXmFourArrowButtons::~G4OpenGLXmFourArr 50 G4OpenGLXmFourArrowButtons::~G4OpenGLXmFourArrowButtons () 48 {} 51 {} 49 52 50 void G4OpenGLXmFourArrowButtons::AddYourselfTo 53 void G4OpenGLXmFourArrowButtons::AddYourselfTo (G4OpenGLXmVWidgetContainer* container) 51 { 54 { 52 55 53 pView = container->GetView (); 56 pView = container->GetView (); 54 ProcesspView (); 57 ProcesspView (); 55 58 56 parent = container->GetPointerToWidget (); 59 parent = container->GetPointerToWidget (); 57 60 58 arrow_form = XtVaCreateManagedWidget 61 arrow_form = XtVaCreateManagedWidget 59 ("arrow_form", 62 ("arrow_form", 60 xmFormWidgetClass, 63 xmFormWidgetClass, 61 *parent, 64 *parent, 62 XmNfractionBase, 3, 65 XmNfractionBase, 3, 63 66 64 XtNvisual, visual, 67 XtNvisual, visual, 65 XtNdepth, depth, 68 XtNdepth, depth, 66 XtNcolormap, cmap, 69 XtNcolormap, cmap, 67 XtNborderColor, borcol, 70 XtNborderColor, borcol, 68 XtNbackground, bgnd, 71 XtNbackground, bgnd, 69 72 70 NULL); 73 NULL); 71 74 72 75 73 ///////////////`up' arrow/////////////// 76 ///////////////`up' arrow/////////////// 74 arrow = XtVaCreateManagedWidget 77 arrow = XtVaCreateManagedWidget 75 ("up_arrow", 78 ("up_arrow", 76 xmArrowButtonGadgetClass, 79 xmArrowButtonGadgetClass, 77 arrow_form, 80 arrow_form, 78 81 79 XmNtopAttachment, XmATTACH_POSITION, 82 XmNtopAttachment, XmATTACH_POSITION, 80 XmNtopPosition, 0, 83 XmNtopPosition, 0, 81 84 82 XmNbottomAttachment, XmATTACH_POSITION, 85 XmNbottomAttachment, XmATTACH_POSITION, 83 XmNbottomPosition, 1, 86 XmNbottomPosition, 1, 84 87 85 XmNleftAttachment, XmATTACH_POSITION, 88 XmNleftAttachment, XmATTACH_POSITION, 86 XmNleftPosition, 1, 89 XmNleftPosition, 1, 87 90 88 XmNrightAttachment, XmATTACH_POSITION, 91 XmNrightAttachment, XmATTACH_POSITION, 89 XmNrightPosition, 2, 92 XmNrightPosition, 2, 90 93 91 XmNarrowDirection, XmARROW_UP, 94 XmNarrowDirection, XmARROW_UP, 92 XmNuserData, True, 95 XmNuserData, True, 93 NULL); 96 NULL); 94 97 95 XtAddCallbacks (arrow, 98 XtAddCallbacks (arrow, 96 XmNactivateCallback, 99 XmNactivateCallback, 97 callback[0]); 100 callback[0]); 98 101 99 XtAddCallbacks (arrow, 102 XtAddCallbacks (arrow, 100 XmNarmCallback, 103 XmNarmCallback, 101 callback[0]); 104 callback[0]); 102 105 103 XtAddCallbacks (arrow, 106 XtAddCallbacks (arrow, 104 XmNdisarmCallback, 107 XmNdisarmCallback, 105 callback[0]); 108 callback[0]); 106 109 107 ///////////////`down' arrow/////////////// 110 ///////////////`down' arrow/////////////// 108 arrow = XtVaCreateManagedWidget 111 arrow = XtVaCreateManagedWidget 109 ("down_arrow", 112 ("down_arrow", 110 xmArrowButtonGadgetClass, 113 xmArrowButtonGadgetClass, 111 arrow_form, 114 arrow_form, 112 115 113 XmNtopAttachment, XmATTACH_POSITION, 116 XmNtopAttachment, XmATTACH_POSITION, 114 XmNtopPosition, 2, 117 XmNtopPosition, 2, 115 118 116 XmNbottomAttachment, XmATTACH_POSITION, 119 XmNbottomAttachment, XmATTACH_POSITION, 117 XmNbottomPosition, 3, 120 XmNbottomPosition, 3, 118 121 119 XmNleftAttachment, XmATTACH_POSITION, 122 XmNleftAttachment, XmATTACH_POSITION, 120 XmNleftPosition, 1, 123 XmNleftPosition, 1, 121 124 122 XmNrightAttachment, XmATTACH_POSITION, 125 XmNrightAttachment, XmATTACH_POSITION, 123 XmNrightPosition, 2, 126 XmNrightPosition, 2, 124 127 125 XmNarrowDirection, XmARROW_DOWN, 128 XmNarrowDirection, XmARROW_DOWN, 126 XmNuserData, False, 129 XmNuserData, False, 127 NULL); 130 NULL); 128 131 129 XtAddCallbacks (arrow, 132 XtAddCallbacks (arrow, 130 XmNactivateCallback, 133 XmNactivateCallback, 131 callback[1]); 134 callback[1]); 132 135 133 XtAddCallbacks (arrow, 136 XtAddCallbacks (arrow, 134 XmNarmCallback, 137 XmNarmCallback, 135 callback[1]); 138 callback[1]); 136 139 137 XtAddCallbacks (arrow, 140 XtAddCallbacks (arrow, 138 XmNdisarmCallback, 141 XmNdisarmCallback, 139 callback[1]); 142 callback[1]); 140 143 141 ///////////////`left' arrow/////////////// 144 ///////////////`left' arrow/////////////// 142 arrow = XtVaCreateManagedWidget 145 arrow = XtVaCreateManagedWidget 143 ("left_arrow", 146 ("left_arrow", 144 xmArrowButtonGadgetClass, 147 xmArrowButtonGadgetClass, 145 arrow_form, 148 arrow_form, 146 149 147 XmNtopAttachment, XmATTACH_POSITION, 150 XmNtopAttachment, XmATTACH_POSITION, 148 XmNtopPosition, 1, 151 XmNtopPosition, 1, 149 152 150 XmNbottomAttachment, XmATTACH_POSITION, 153 XmNbottomAttachment, XmATTACH_POSITION, 151 XmNbottomPosition, 2, 154 XmNbottomPosition, 2, 152 155 153 XmNleftAttachment, XmATTACH_POSITION, 156 XmNleftAttachment, XmATTACH_POSITION, 154 XmNleftPosition, 0, 157 XmNleftPosition, 0, 155 158 156 XmNrightAttachment, XmATTACH_POSITION, 159 XmNrightAttachment, XmATTACH_POSITION, 157 XmNrightPosition, 1, 160 XmNrightPosition, 1, 158 161 159 XmNarrowDirection, XmARROW_LEFT, 162 XmNarrowDirection, XmARROW_LEFT, 160 XmNuserData, False, 163 XmNuserData, False, 161 NULL); 164 NULL); 162 165 163 XtAddCallbacks (arrow, 166 XtAddCallbacks (arrow, 164 XmNactivateCallback, 167 XmNactivateCallback, 165 callback[2]); 168 callback[2]); 166 169 167 XtAddCallbacks (arrow, 170 XtAddCallbacks (arrow, 168 XmNarmCallback, 171 XmNarmCallback, 169 callback[2]); 172 callback[2]); 170 173 171 XtAddCallbacks (arrow, 174 XtAddCallbacks (arrow, 172 XmNdisarmCallback, 175 XmNdisarmCallback, 173 callback[2]); 176 callback[2]); 174 177 175 ///////////////`right' arrow/////////////// 178 ///////////////`right' arrow/////////////// 176 arrow = XtVaCreateManagedWidget 179 arrow = XtVaCreateManagedWidget 177 ("right_arrow", 180 ("right_arrow", 178 xmArrowButtonGadgetClass, 181 xmArrowButtonGadgetClass, 179 arrow_form, 182 arrow_form, 180 183 181 XmNtopAttachment, XmATTACH_POSITION, 184 XmNtopAttachment, XmATTACH_POSITION, 182 XmNtopPosition, 1, 185 XmNtopPosition, 1, 183 186 184 XmNbottomAttachment, XmATTACH_POSITION, 187 XmNbottomAttachment, XmATTACH_POSITION, 185 XmNbottomPosition, 2, 188 XmNbottomPosition, 2, 186 189 187 XmNleftAttachment, XmATTACH_POSITION, 190 XmNleftAttachment, XmATTACH_POSITION, 188 XmNleftPosition, 2, 191 XmNleftPosition, 2, 189 192 190 XmNrightAttachment, XmATTACH_POSITION, 193 XmNrightAttachment, XmATTACH_POSITION, 191 XmNrightPosition, 3, 194 XmNrightPosition, 3, 192 195 193 XmNarrowDirection, XmARROW_RIGHT, 196 XmNarrowDirection, XmARROW_RIGHT, 194 XmNuserData, True, 197 XmNuserData, True, 195 NULL); 198 NULL); 196 199 197 XtAddCallbacks (arrow, 200 XtAddCallbacks (arrow, 198 XmNactivateCallback, 201 XmNactivateCallback, 199 callback[3]); 202 callback[3]); 200 203 201 XtAddCallbacks (arrow, 204 XtAddCallbacks (arrow, 202 XmNarmCallback, 205 XmNarmCallback, 203 callback[3]); 206 callback[3]); 204 207 205 XtAddCallbacks (arrow, 208 XtAddCallbacks (arrow, 206 XmNdisarmCallback, 209 XmNdisarmCallback, 207 callback[3]); 210 callback[3]); 208 211 209 } 212 } 210 213 211 Widget* G4OpenGLXmFourArrowButtons::GetPointer 214 Widget* G4OpenGLXmFourArrowButtons::GetPointerToParent () 212 { 215 { 213 return parent; 216 return parent; 214 } 217 } 215 218 216 Widget* G4OpenGLXmFourArrowButtons::GetPointer 219 Widget* G4OpenGLXmFourArrowButtons::GetPointerToWidget () 217 { 220 { 218 return &arrow_form; 221 return &arrow_form; 219 } 222 } >> 223 >> 224 #endif 220 225