00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00025 #ifndef __vtkKWScale_h
00026 #define __vtkKWScale_h
00027
00028 #include "vtkKWCoreWidget.h"
00029
00030 class vtkKWEntry;
00031 class vtkKWLabel;
00032 class vtkKWPushButton;
00033 class vtkKWTopLevel;
00034
00035 class KWWidgets_EXPORT vtkKWScale : public vtkKWCoreWidget
00036 {
00037
00038 public:
00039 static vtkKWScale* New();
00040 vtkTypeRevisionMacro(vtkKWScale,vtkKWCoreWidget);
00041 void PrintSelf(ostream& os, vtkIndent indent);
00042
00044
00045 virtual void SetRange(double min, double max);
00046 virtual void SetRange(const double *range)
00047 { this->SetRange(range[0], range[1]); };
00048 vtkGetVector2Macro(Range, double);
00049 virtual double GetRangeMin() { return this->GetRange()[0]; };
00050 virtual double GetRangeMax() { return this->GetRange()[1]; };
00052
00054
00055 virtual void SetValue(double v);
00056 vtkGetMacro(Value, double);
00058
00060
00068 virtual void SetResolution(double r);
00069 vtkGetMacro(Resolution, double);
00071
00073
00074 virtual void GetBackgroundColor(double *r, double *g, double *b);
00075 virtual double* GetBackgroundColor();
00076 virtual void SetBackgroundColor(double r, double g, double b);
00077 virtual void SetBackgroundColor(double rgb[3])
00078 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00080
00082
00083 virtual void GetForegroundColor(double *r, double *g, double *b);
00084 virtual double* GetForegroundColor();
00085 virtual void SetForegroundColor(double r, double g, double b);
00086 virtual void SetForegroundColor(double rgb[3])
00087 { this->SetForegroundColor(rgb[0], rgb[1], rgb[2]); };
00089
00091
00094 virtual void SetHighlightThickness(int);
00095 virtual int GetHighlightThickness();
00097
00099
00103 virtual void GetActiveBackgroundColor(double *r, double *g, double *b);
00104 virtual double* GetActiveBackgroundColor();
00105 virtual void SetActiveBackgroundColor(double r, double g, double b);
00106 virtual void SetActiveBackgroundColor(double rgb[3])
00107 { this->SetActiveBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00109
00111
00114 virtual void SetBorderWidth(int);
00115 virtual int GetBorderWidth();
00117
00119
00122 virtual void SetRelief(int);
00123 virtual int GetRelief();
00124 virtual void SetReliefToRaised();
00125 virtual void SetReliefToSunken();
00126 virtual void SetReliefToFlat();
00127 virtual void SetReliefToRidge();
00128 virtual void SetReliefToSolid();
00129 virtual void SetReliefToGroove();
00131
00133
00144 virtual void SetFont(const char *font);
00145 virtual const char* GetFont();
00147
00149
00153 virtual void SetOrientation(int);
00154 vtkGetMacro(Orientation, int);
00155 virtual void SetOrientationToHorizontal();
00156 virtual void SetOrientationToVertical();
00158
00160
00162 virtual void GetTroughColor(double *r, double *g, double *b);
00163 virtual double* GetTroughColor();
00164 virtual void SetTroughColor(double r, double g, double b);
00165 virtual void SetTroughColor(double rgb[3])
00166 { this->SetTroughColor(rgb[0], rgb[1], rgb[2]); };
00168
00170
00173 virtual void SetWidth(int width);
00174 virtual int GetWidth();
00176
00178
00181 virtual void SetLength(int length);
00182 virtual int GetLength();
00184
00186
00188 virtual void SetSliderLength(int length);
00189 virtual int GetSliderLength();
00191
00193
00194 virtual void SetValueVisibility(int);
00195 virtual int GetValueVisibility();
00196 vtkBooleanMacro(ValueVisibility, int);
00198
00200
00203 virtual void SetTickInterval(double val);
00204 virtual double GetTickInterval();
00206
00208
00214 virtual void SetLabelText(const char *);
00215 virtual const char* GetLabelText();
00217
00219
00249 virtual void SetCommand(vtkObject *object, const char *method);
00250 virtual void SetStartCommand(vtkObject *object, const char *method);
00251 virtual void SetEndCommand(vtkObject *object, const char *method);
00253
00255
00264 enum
00265 {
00266 ScaleValueChangingEvent = 10000,
00267 ScaleValueChangedEvent,
00268 ScaleValueStartChangingEvent
00269 };
00270
00272
00274
00277 vtkSetMacro(DisableCommands, int);
00278 vtkGetMacro(DisableCommands, int);
00279 vtkBooleanMacro(DisableCommands, int);
00281
00288 virtual void UpdateEnableState();
00289
00291
00293 vtkSetMacro(ClampValue, int);
00294 vtkGetMacro(ClampValue, int);
00295 vtkBooleanMacro(ClampValue, int);
00297
00299
00300 vtkGetMacro(DisableScaleValueCallback, int);
00301 vtkSetMacro(DisableScaleValueCallback, int);
00302 vtkBooleanMacro(DisableScaleValueCallback, int);
00303 virtual void ScaleValueCallback(double num);
00304 virtual void ButtonPressCallback();
00305 virtual void ButtonReleaseCallback();
00307
00308
00309
00310 protected:
00311 vtkKWScale();
00312 ~vtkKWScale();
00313
00315 virtual void CreateWidget();
00316
00318
00320 void Bind();
00321 void UnBind();
00323
00324 int DisableScaleValueCallback;
00325 int ClampValue;
00326
00327 double Value;
00328 double Resolution;
00329 double Range[2];
00330
00331 int Orientation;
00332
00334
00335 virtual void UpdateRange();
00336 virtual void UpdateResolution();
00337 virtual void UpdateValue();
00338 virtual void UpdateOrientation();
00340
00341
00342 friend class vtkKWScaleWithEntry;
00343
00344
00345 int DisableCommands;
00346 char *Command;
00347 char *StartCommand;
00348 char *EndCommand;
00349
00350 virtual void InvokeScaleCommand(const char *command, double value);
00351 virtual void InvokeCommand(double value);
00352 virtual void InvokeStartCommand(double value);
00353 virtual void InvokeEndCommand(double value);
00354
00355
00356
00357 private:
00358 vtkKWScale(const vtkKWScale&);
00359 void operator=(const vtkKWScale&);
00360 };
00361
00362
00363 #endif
00364