Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef __vtkKWMatrixWidget_h
00026 #define __vtkKWMatrixWidget_h
00027
00028 #include "vtkKWCompositeWidget.h"
00029
00030 class vtkKWEntrySet;
00031
00032 class KWWidgets_EXPORT vtkKWMatrixWidget : public vtkKWCompositeWidget
00033 {
00034 public:
00035 static vtkKWMatrixWidget* New();
00036 vtkTypeRevisionMacro(vtkKWMatrixWidget,vtkKWCompositeWidget);
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038
00039
00040
00041 virtual void SetNumberOfColumns(int col);
00042 vtkGetMacro(NumberOfColumns, int);
00043 virtual void SetNumberOfRows(int col);
00044 vtkGetMacro(NumberOfRows, int);
00045
00046
00047
00048 virtual void SetElementValue(int row, int col, const char *val);
00049 virtual const char* GetElementValue(int row, int col);
00050 virtual void SetElementValueAsInt(int row, int col, int val);
00051 virtual int GetElementValueAsInt(int row, int col);
00052 virtual void SetElementValueAsDouble(int row, int col, double val);
00053 virtual double GetElementValueAsDouble(int row, int col);
00054
00055
00056
00057 virtual void SetElementWidth(int width);
00058 vtkGetMacro(ElementWidth, int);
00059
00060
00061
00062 virtual void SetReadOnly(int);
00063 vtkBooleanMacro(ReadOnly, int);
00064 vtkGetMacro(ReadOnly, int);
00065
00066
00067
00068
00069
00070 enum
00071 {
00072 RestrictNone = 0,
00073 RestrictInteger,
00074 RestrictDouble
00075 };
00076
00077 vtkGetMacro(RestrictElementValue, int);
00078 virtual void SetRestrictElementValue(int);
00079 virtual void SetRestrictElementValueToInteger();
00080 virtual void SetRestrictElementValueToDouble();
00081 virtual void SetRestrictElementValueToNone();
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 virtual void SetElementChangedCommand(vtkObject *object, const char *method);
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 enum
00106 {
00107 ElementChangedEvent = 10000
00108 };
00109
00110
00111
00112
00113
00114
00115 enum
00116 {
00117 TriggerOnFocusOut = 1,
00118 TriggerOnReturnKey = 2,
00119 TriggerOnAnyChange = 4
00120 };
00121
00122 vtkGetMacro(ElementChangedCommandTrigger, int);
00123 virtual void SetElementChangedCommandTrigger(int);
00124 virtual void SetElementChangedCommandTriggerToReturnKeyAndFocusOut();
00125 virtual void SetElementChangedCommandTriggerToAnyChange();
00126
00127
00128
00129
00130
00131
00132
00133
00134 virtual void UpdateEnableState();
00135
00136
00137
00138 virtual void ElementChangedCallback(int id, const char *value);
00139
00140 protected:
00141 vtkKWMatrixWidget();
00142 virtual ~vtkKWMatrixWidget();
00143
00144 int NumberOfColumns;
00145 int NumberOfRows;
00146
00147 int ElementWidth;
00148 int ReadOnly;
00149 int RestrictElementValue;
00150 int ElementChangedCommandTrigger;
00151
00152
00153
00154 virtual void CreateWidget();
00155 virtual void UpdateWidget();
00156
00157 vtkKWEntrySet *EntrySet;
00158
00159 char *ElementChangedCommand;
00160 void InvokeElementChangedCommand(int row, int col, const char *value);
00161
00162 private:
00163 vtkKWMatrixWidget(const vtkKWMatrixWidget&);
00164 void operator=(const vtkKWMatrixWidget&);
00165 };
00166
00167 #endif
00168