1 /***********************************************************************/ 2 /* Open Visualization Data Explorer */ 3 /* (C) Copyright IBM Corp. 1989,1999 */ 4 /* ALL RIGHTS RESERVED */ 5 /* This code licensed under the */ 6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ 7 /***********************************************************************/ 8 9 #include <dxconfig.h> 10 #include "../base/defines.h" 11 12 13 #ifndef _SelectorListInteractor_h 14 #define _SelectorListInteractor_h 15 16 17 #include <X11/Intrinsic.h> 18 19 #include "Interactor.h" 20 #include "List.h" 21 22 // 23 // Class name definition: 24 // 25 #define ClassSelectorListInteractor "SelectorListInteractor" 26 27 // 28 // XtCallbackProc (*CB), XtEventHandler (*EH) and XtActionProc (*AP) 29 // DialogCallback (*DCB), XtInputCallbackProc (*ICP), XtWorkProc (*WP) 30 // functions for this and derived classes 31 // 32 extern "C" void SelectorListInteractor_SelectCB(Widget, XtPointer, XtPointer); 33 34 35 // 36 // SelectorListInteractor class definition: 37 // 38 class SelectorListInteractor : public Interactor 39 { 40 private: 41 // 42 // Private member data: 43 // 44 Widget list_widget; 45 boolean single_select; 46 47 void enableCallbacks (boolean enab = TRUE); disableCallbacks()48 void disableCallbacks () { this->enableCallbacks(FALSE); } 49 50 protected: 51 // 52 // Protected member data: 53 // 54 55 // 56 // One widget for each component (scalar or n-vector). 57 // 58 59 static boolean ClassInitialized; 60 61 static String DefaultResources[]; 62 63 friend void SelectorListInteractor_SelectCB(Widget , XtPointer , XtPointer ); 64 65 // 66 // [Re]load the options into this->pulldown. 67 // 68 void reloadListOptions(); 69 completeInteractivePart()70 virtual void completeInteractivePart(){} 71 72 public: 73 // 74 // Constructor: 75 // 76 SelectorListInteractor(const char *name, InteractorInstance *ii); 77 78 // 79 // Allocate this class 80 // AllocateInteractor(const char * name,InteractorInstance * ii)81 static Interactor *AllocateInteractor(const char *name, InteractorInstance *ii) { 82 return new SelectorListInteractor(name, ii); 83 } 84 85 // 86 // Accepts value changes and reflects them into other interactors, cdbs 87 // and off course the interactor node output. 88 // 89 void applyCallback(); 90 91 // 92 // Destructor: 93 // ~SelectorListInteractor()94 ~SelectorListInteractor(){} 95 96 // 97 // Update the displayed values for this interactor. 98 // 99 void updateDisplayedInteractorValue(void); 100 101 // 102 // 103 // 104 Widget createInteractivePart(Widget p); 105 106 // 107 // Make sure the attributes match the resources for the widgets. 108 // 109 void handleInteractivePartStateChange(InteractorInstance *, boolean ); 110 111 // 112 // Added to be able to override the developer style selectColor 113 // 114 void setAppearance(boolean ); 115 116 // 117 // Returns a pointer to the class name. 118 // getClassName()119 const char* getClassName() 120 { 121 return ClassSelectorListInteractor; 122 } 123 }; 124 125 126 #endif // _SelectorListInteractor_h 127