00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkPVSelectionList_h
00026 #define __vtkPVSelectionList_h
00027
00028 #include "vtkPVObjectWidget.h"
00029
00030 class vtkStringList;
00031 class vtkKWMenuButton;
00032 class vtkKWLabel;
00033
00034 class VTK_EXPORT vtkPVSelectionList : public vtkPVObjectWidget
00035 {
00036 public:
00037 static vtkPVSelectionList* New();
00038 vtkTypeRevisionMacro(vtkPVSelectionList, vtkPVObjectWidget);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00042 virtual void Create(vtkKWApplication *app);
00043
00044
00045
00046
00047 void AddItem(const char *name, int value);
00048
00050 int GetValue(const char* name);
00051
00053 void RemoveAllItems();
00054
00056
00057 void SetLabel(const char *label);
00058 const char *GetLabel();
00060
00062
00063 void SetLabelVisibility(int visible);
00064 vtkGetMacro(LabelVisibility, int);
00065 void ShowLabel() { this->SetLabelVisibility(1); }
00066 void HideLabel() { this->SetLabelVisibility(0); }
00068
00070
00072 vtkGetMacro(CurrentValue, int);
00073 void SetCurrentValue(int val);
00074 vtkGetStringMacro(CurrentName);
00076
00078
00080 vtkSetMacro(OptionWidth, int);
00082
00085 void SelectCallback(const char *name, int value);
00086
00089 virtual void SetBalloonHelpString(const char *str);
00090
00092 void Disable();
00093
00094
00096
00099 vtkPVSelectionList* ClonePrototype(vtkPVSource* pvSource,
00100 vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
00102
00103
00105 virtual void Accept();
00106
00109 virtual void ResetInternal();
00110
00112 virtual void Initialize();
00113
00115 virtual void Trace(ofstream *file);
00116
00123 virtual void UpdateEnableState();
00124
00126 virtual void SaveInBatchScript(ofstream *file);
00127
00129 int GetNumberOfItems();
00130 protected:
00131 vtkPVSelectionList();
00132 ~vtkPVSelectionList();
00133
00134 vtkKWLabel *Label;
00135 vtkKWMenuButton *Menu;
00136 char *Command;
00137
00138 int LabelVisibility;
00139 int OptionWidth;
00140
00141 int CurrentValue;
00142 char *CurrentName;
00143
00144 vtkStringList *Names;
00145
00146 vtkSetStringMacro(CurrentName);
00147
00148
00149 virtual void CopyProperties(vtkPVWidget* clone, vtkPVSource* pvSource,
00150 vtkArrayMap<vtkPVWidget*, vtkPVWidget*>* map);
00151
00152
00153 int ReadXMLAttributes(vtkPVXMLElement* element,
00154 vtkPVXMLPackageParser* parser);
00155
00156 private:
00157 vtkPVSelectionList(const vtkPVSelectionList&);
00158 void operator=(const vtkPVSelectionList&);
00159 };
00160
00161 #endif