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