00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00024 #ifndef __vtkKWEntry_h
00025 #define __vtkKWEntry_h
00026
00027 #include "vtkKWCoreWidget.h"
00028
00029 class KWWidgets_EXPORT vtkKWEntry : public vtkKWCoreWidget
00030 {
00031
00032 public:
00033 static vtkKWEntry* New();
00034 vtkTypeRevisionMacro(vtkKWEntry,vtkKWCoreWidget);
00035 void PrintSelf(ostream& os, vtkIndent indent);
00036
00038
00053 virtual void SetValue(const char *);
00054 virtual const char* GetValue();
00055 virtual void SetValueAsInt(int a);
00056 virtual int GetValueAsInt();
00057 virtual void SetValueAsFormattedDouble(double f, int size);
00058 virtual void SetValueAsDouble(double f);
00059 virtual double GetValueAsDouble();
00060 virtual void SetHexadecimalValueAsRGB(int r, int g, int b);
00061 virtual void GetHexadecimalValueAsRGB(int &r, int &g, int &b);
00063
00065
00070 virtual void SetWidth(int width);
00071 vtkGetMacro(Width, int);
00073
00075
00076 virtual void SetReadOnly(int);
00077 vtkBooleanMacro(ReadOnly, int);
00078 vtkGetMacro(ReadOnly, int);
00080
00082
00089 vtkBooleanMacro(PasswordMode, int);
00090 virtual void SetPasswordMode(int);
00091 virtual int GetPasswordMode();
00093
00095 virtual void SelectAll();
00096
00098
00101 vtkBooleanMacro(SelectAllOnFocusIn, int);
00102 virtual void SetSelectAllOnFocusIn(int);
00103 vtkGetMacro(SelectAllOnFocusIn, int);
00105
00107
00110 enum
00111 {
00112 RestrictNone = 0,
00113 RestrictInteger,
00114 RestrictDouble,
00115 RestrictHexadecimal
00116 };
00117
00118 vtkGetMacro(RestrictValue, int);
00119 virtual void SetRestrictValue(int);
00120 virtual void SetRestrictValueToInteger();
00121 virtual void SetRestrictValueToDouble();
00122 virtual void SetRestrictValueToHexadecimal();
00123 virtual void SetRestrictValueToNone();
00125
00127
00136 virtual void SetValidationCommand(vtkObject *object, const char *method);
00137 virtual int InvokeValidationCommand(const char *value);
00139
00141
00142 virtual void GetBackgroundColor(double *r, double *g, double *b);
00143 virtual double* GetBackgroundColor();
00144 virtual void SetBackgroundColor(double r, double g, double b);
00145 virtual void SetBackgroundColor(double rgb[3])
00146 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00148
00150
00151 virtual void GetForegroundColor(double *r, double *g, double *b);
00152 virtual double* GetForegroundColor();
00153 virtual void SetForegroundColor(double r, double g, double b);
00154 virtual void SetForegroundColor(double rgb[3])
00155 { this->SetForegroundColor(rgb[0], rgb[1], rgb[2]); };
00157
00159
00160 virtual void GetDisabledBackgroundColor(double *r, double *g, double *b);
00161 virtual double* GetDisabledBackgroundColor();
00162 virtual void SetDisabledBackgroundColor(double r, double g, double b);
00163 virtual void SetDisabledBackgroundColor(double rgb[3])
00164 { this->SetDisabledBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00166
00168
00169 virtual void GetDisabledForegroundColor(double *r, double *g, double *b);
00170 virtual double* GetDisabledForegroundColor();
00171 virtual void SetDisabledForegroundColor(double r, double g, double b);
00172 virtual void SetDisabledForegroundColor(double rgb[3])
00173 { this->SetDisabledForegroundColor(rgb[0], rgb[1], rgb[2]); };
00175
00177
00178 virtual void GetReadOnlyBackgroundColor(double *r, double *g, double *b);
00179 virtual double* GetReadOnlyBackgroundColor();
00180 virtual void SetReadOnlyBackgroundColor(double r, double g, double b);
00181 virtual void SetReadOnlyBackgroundColor(double rgb[3])
00182 { this->SetReadOnlyBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00184
00186
00189 virtual void SetHighlightThickness(int);
00190 virtual int GetHighlightThickness();
00192
00194
00197 virtual void SetBorderWidth(int);
00198 virtual int GetBorderWidth();
00200
00202
00205 virtual void SetRelief(int);
00206 virtual int GetRelief();
00207 virtual void SetReliefToRaised();
00208 virtual void SetReliefToSunken();
00209 virtual void SetReliefToFlat();
00210 virtual void SetReliefToRidge();
00211 virtual void SetReliefToSolid();
00212 virtual void SetReliefToGroove();
00214
00216
00227 virtual void SetFont(const char *font);
00228 virtual const char* GetFont();
00230
00232
00240 virtual void SetCommand(vtkObject *object, const char *method);
00241 virtual void InvokeCommand(const char *value);
00243
00245
00247 enum
00248 {
00249 TriggerOnFocusOut = 1,
00250 TriggerOnReturnKey = 2,
00251 TriggerOnAnyChange = 4
00252 };
00253
00254 vtkGetMacro(CommandTrigger, int);
00255 virtual void SetCommandTrigger(int);
00256 virtual void SetCommandTriggerToReturnKeyAndFocusOut();
00257 virtual void SetCommandTriggerToAnyChange();
00259
00261
00270 enum
00271 {
00272 EntryValueChangedEvent = 10000
00273 };
00274
00276
00283 virtual void UpdateEnableState();
00284
00286
00287 virtual void ValueCallback();
00288 virtual int ValidationCallback(const char *value);
00289 virtual void TracedVariableChangedCallback(
00290 const char *, const char *, const char *);
00292
00293
00294
00295 protected:
00296 vtkKWEntry();
00297 ~vtkKWEntry();
00298
00300 virtual void CreateWidget();
00301
00302 int Width;
00303 int ReadOnly;
00304 int RestrictValue;
00305 int CommandTrigger;
00306 int SelectAllOnFocusIn;
00307
00308 char *Command;
00309 char *ValidationCommand;
00310
00312
00313 virtual void Configure();
00314 virtual void ConfigureValidation();
00315 virtual void ConfigureTraceCallback(int state);
00317
00318
00319
00320 private:
00321
00322 char *InternalValueString;
00323 vtkGetStringMacro(InternalValueString);
00324 vtkSetStringMacro(InternalValueString);
00325
00326 vtkKWEntry(const vtkKWEntry&);
00327 void operator=(const vtkKWEntry&);
00328 };
00329
00330 #endif
00331