00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00022 #ifndef __vtkKWScale_h
00023 #define __vtkKWScale_h
00024
00025 #include "vtkKWCoreWidget.h"
00026
00027 class vtkKWApplication;
00028 class vtkKWEntry;
00029 class vtkKWLabel;
00030 class vtkKWPushButton;
00031 class vtkKWTopLevel;
00032
00033 class KWWIDGETS_EXPORT vtkKWScale : public vtkKWCoreWidget
00034 {
00035 public:
00036 static vtkKWScale* New();
00037 vtkTypeRevisionMacro(vtkKWScale,vtkKWCoreWidget);
00038 void PrintSelf(ostream& os, vtkIndent indent);
00039
00041 virtual void Create(vtkKWApplication *app);
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
00077 virtual void SetOrientation(int);
00078 vtkGetMacro(Orientation, int);
00079 virtual void SetOrientationToHorizontal()
00080 { this->SetOrientation(vtkKWTkOptions::OrientationHorizontal); };
00081 virtual void SetOrientationToVertical()
00082 { this->SetOrientation(vtkKWTkOptions::OrientationVertical); };
00084
00086
00088 virtual void GetTroughColor(double *r, double *g, double *b);
00089 virtual double* GetTroughColor();
00090 virtual void SetTroughColor(double r, double g, double b);
00091 virtual void SetTroughColor(double rgb[3])
00092 { this->SetTroughColor(rgb[0], rgb[1], rgb[2]); };
00094
00096
00099 virtual void SetWidth(int width);
00100 virtual int GetWidth();
00102
00104
00107 virtual void SetLength(int length);
00108 virtual int GetLength();
00110
00112
00114 virtual void SetSliderLength(int length);
00115 virtual int GetSliderLength();
00117
00119
00120 virtual void SetValueVisibility(int);
00121 virtual int GetValueVisibility();
00122 vtkBooleanMacro(ValueVisibility, int);
00124
00126
00129 virtual void SetTickInterval(double val);
00130 virtual double GetTickInterval();
00132
00134
00140 virtual void SetLabelText(const char *);
00141 virtual const char* GetLabelText();
00143
00145
00150 virtual void SetCommand(vtkObject *object, const char *method);
00151 virtual void SetStartCommand(vtkObject *object, const char *method);
00152 virtual void SetEndCommand(vtkObject *object, const char *method);
00153 virtual void InvokeCommand();
00154 virtual void InvokeStartCommand();
00155 virtual void InvokeEndCommand();
00157
00159
00162 vtkSetMacro(DisableCommands, int);
00163 vtkGetMacro(DisableCommands, int);
00164 vtkBooleanMacro(DisableCommands, int);
00166
00173 virtual void UpdateEnableState();
00174
00176
00178 vtkSetMacro(ClampValue, int);
00179 vtkGetMacro(ClampValue, int);
00180 vtkBooleanMacro(ClampValue, int);
00182
00184
00185 vtkGetMacro(DisableScaleValueCallback, int);
00186 vtkSetMacro(DisableScaleValueCallback, int);
00187 vtkBooleanMacro(DisableScaleValueCallback, int);
00188 virtual void ScaleValueCallback(double num);
00190
00191 protected:
00192 vtkKWScale();
00193 ~vtkKWScale();
00194
00196
00198 void Bind();
00199 void UnBind();
00201
00202 int DisableCommands;
00203 int DisableScaleValueCallback;
00204 int ClampValue;
00205
00206 char *Command;
00207 char *StartCommand;
00208 char *EndCommand;
00209 char *EntryCommand;
00210
00211 double Value;
00212 double Resolution;
00213 double Range[2];
00214
00215 int Orientation;
00216
00218
00219 virtual void UpdateRange();
00220 virtual void UpdateResolution();
00221 virtual void UpdateValue();
00222 virtual void UpdateOrientation();
00224
00225
00226 friend class vtkKWScaleWithEntry;
00227
00228
00229 private:
00230 vtkKWScale(const vtkKWScale&);
00231 void operator=(const vtkKWScale&);
00232 };
00233
00234
00235 #endif