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 14 15 16 #ifndef _InteractorStyle_h_ 17 #define _InteractorStyle_h_ 18 19 #include "Base.h" 20 #include "SymbolManager.h" 21 22 enum InteractorStyleEnum { 23 UnknownStyle = 0, 24 DefaultStyle = 1, 25 StepperStyle = 2, 26 SliderStyle = 3, 27 DialStyle = 4, 28 VectorStyle = 5, 29 TextStyle = 6, // These three should have the same value 30 ValueStyle = 6, // These three should have the same value 31 StringStyle = 6, // These three should have the same value 32 SelectorOptionMenuStyle = 7, 33 34 IntegerListEditorStyle= 8, 35 ScalarListEditorStyle = 9, 36 VectorListEditorStyle = 10, 37 TextListEditorStyle = 11, // These three should have the same value 38 ValueListEditorStyle = 11, // These three should have the same value 39 StringListEditorStyle = 11, // These three should have the same value 40 41 FileSelectorStyle = 12, 42 43 SelectorToggleStyle = 13, // Toggle button for Selector 44 SelectorRadioStyle = 15, // Radio buttons 45 46 ToggleToggleStyle = 16, // Toggle button 47 SelectorListToggleStyle = 17, // Toggle button 48 49 SelectorPulldownStyle = 18, // scrollable menu 50 SelectorListStyle = 19, // scrolled list 51 52 UserStyle = 1000 53 }; 54 55 #define ClassInteractorStyle "InteractorStyle" 56 57 class InteractorInstance; 58 class Dictionary; 59 class Interactor; 60 61 typedef Interactor* (*InteractorAllocator)(const char *name, 62 InteractorInstance *ii); 63 extern void BuildtheInteractorStyleDictionary(void); 64 65 class InteractorStyle : public Base { 66 private: 67 68 InteractorStyleEnum style; 69 Symbol name; 70 char *interactorName; // Name applied to widget 71 InteractorAllocator allocateInteractor; 72 boolean isDefault; 73 char* javaStyle; 74 75 protected: 76 77 public: 78 79 // 80 // Added supported style/name/interactorbuild group to the list 81 // of supported styles for the given named interactor (node name). 82 // 83 static boolean AddSupportedStyle(const char *interactor, 84 InteractorStyleEnum style, 85 const char *stylename, 86 InteractorAllocator ia); 87 static boolean AddSupportedStyle(const char *interactor, 88 InteractorStyleEnum style, 89 const char *stylename, 90 const char *javaStyle, 91 InteractorAllocator ia); 92 93 // 94 // Get the InteractorStyle entry associated with the give interactor 95 // (node name) and the give style or style name. 96 // 97 static InteractorStyle *GetInteractorStyle(const char* interactor, 98 InteractorStyleEnum style); 99 static InteractorStyle *GetInteractorStyle(const char* interactor, 100 const char *stylname); 101 static void SetDefaultStyle(const char* interactor, 102 InteractorStyleEnum style); 103 104 // 105 // Return the list of InteractorStyles for the give interactor (node name). 106 // 107 static Dictionary *GetInteractorStyleDictionary(const char* interactor); 108 109 110 InteractorStyle(InteractorStyleEnum s, const char *n, const char* javaStyle, 111 InteractorAllocator ia); 112 113 ~InteractorStyle(); 114 115 Interactor *createInteractor(InteractorInstance *ii); 116 getJavaStyle()117 const char* getJavaStyle() { return this->javaStyle; } hasJavaStyle()118 boolean hasJavaStyle() { return (this->javaStyle != NUL(char*)); } 119 getNameString()120 const char *getNameString() 121 { return theSymbolManager->getSymbolString(this->name); } getStyleEnum()122 InteractorStyleEnum getStyleEnum() { return this->style; } 123 getClassName()124 const char *getClassName() 125 { return ClassInteractorStyle; } 126 127 }; 128 129 130 #endif // _InteractorStyle_h_ 131