00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00040 #ifndef __vtkKWScaleWithEntry_h
00041 #define __vtkKWScaleWithEntry_h
00042
00043 #include "vtkKWScaleWithLabel.h"
00044
00045 class vtkKWApplication;
00046 class vtkKWEntry;
00047 class vtkKWLabel;
00048 class vtkKWPushButton;
00049 class vtkKWTopLevel;
00050
00051 class KWWIDGETS_EXPORT vtkKWScaleWithEntry : public vtkKWScaleWithLabel
00052 {
00053 public:
00054 static vtkKWScaleWithEntry* New();
00055 vtkTypeRevisionMacro(vtkKWScaleWithEntry,vtkKWScaleWithLabel);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00059 virtual void Create(vtkKWApplication *app);
00060
00062
00063 virtual void SetRange(double min, double max);
00064 virtual void SetRange(const double *range)
00065 { this->SetRange(range[0], range[1]); };
00066 virtual double *GetRange();
00067 virtual void GetRange(double &min, double &max);
00068 virtual void GetRange(double range[2])
00069 { this->GetRange(range[0], range[1]); };
00070 virtual double GetRangeMin() { return this->GetRange()[0]; };
00071 virtual double GetRangeMax() { return this->GetRange()[1]; };
00073
00075
00076 virtual void SetValue(double v);
00077 virtual double GetValue();
00079
00081
00082 virtual void SetResolution(double r);
00083 virtual double GetResolution();
00085
00087
00089 virtual void SetClampValue(int);
00090 virtual int GetClampValue();
00091 vtkBooleanMacro(ClampValue, int);
00093
00095
00097 virtual vtkKWScale* GetScale()
00098 { return this->GetWidget(); };
00100
00102
00107 void SetRangeVisibility(int flag);
00108 vtkGetMacro(RangeVisibility, int);
00109 vtkBooleanMacro(RangeVisibility, int);
00111
00113
00120 virtual void SetEntryVisibility(int);
00121 vtkBooleanMacro(EntryVisibility, int);
00122 vtkGetMacro(EntryVisibility, int);
00124
00130 virtual void SetLabelText(const char *);
00131
00133
00138 virtual vtkKWEntry* GetEntry();
00139 virtual int HasEntry();
00141
00143
00146 virtual void SetEntryWidth(int width);
00147 virtual int GetEntryWidth();
00149
00151
00159 enum
00160 {
00161 EntryPositionDefault = 0,
00162 EntryPositionTop,
00163 EntryPositionBottom,
00164 EntryPositionLeft,
00165 EntryPositionRight
00166 };
00167
00168 virtual void SetEntryPosition(int);
00169 vtkGetMacro(EntryPosition, int);
00170 virtual void SetEntryPositionToDefault()
00171 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionDefault); };
00172 virtual void SetEntryPositionToTop()
00173 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionTop); };
00174 virtual void SetEntryPositionToBottom()
00175 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionBottom); };
00176 virtual void SetEntryPositionToLeft()
00177 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionLeft); };
00178 virtual void SetEntryPositionToRight()
00179 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionRight); };
00181
00185 virtual void SetLabelAndEntryPositionToTop();
00186
00188
00190 vtkSetMacro(PopupMode, int);
00191 vtkGetMacro(PopupMode, int);
00192 vtkBooleanMacro(PopupMode, int);
00193 vtkGetObjectMacro(PopupPushButton, vtkKWPushButton);
00195
00197
00201 virtual void SetExpandEntry(int flag);
00202 vtkGetMacro(ExpandEntry, int);
00203 vtkBooleanMacro(ExpandEntry, int);
00205
00207
00211 virtual void SetOrientation(int);
00212 virtual int GetOrientation();
00213 virtual void SetOrientationToHorizontal()
00214 { this->SetOrientation(vtkKWTkOptions::OrientationHorizontal); };
00215 virtual void SetOrientationToVertical()
00216 { this->SetOrientation(vtkKWTkOptions::OrientationVertical); };
00218
00220
00223 virtual void SetLength(int length);
00224 virtual int GetLength();
00226
00228
00233 virtual void SetCommand(vtkObject *object, const char *method);
00234 virtual void SetStartCommand(vtkObject *object, const char *method);
00235 virtual void SetEndCommand(vtkObject *object, const char *method);
00236 virtual void SetEntryCommand(vtkObject *object, const char *method);
00237 virtual void InvokeEntryCommand();
00239
00241
00244 virtual void SetDisableCommands(int);
00245 virtual int GetDisableCommands();
00246 vtkBooleanMacro(DisableCommands, int);
00248
00251 virtual void SetBalloonHelpString(const char *str);
00252
00259 virtual void UpdateEnableState();
00260
00262
00263 virtual void DisplayPopupModeCallback();
00264 virtual void WithdrawPopupModeCallback();
00265 virtual void EntryValueCallback();
00266 virtual void ScaleValueCallback(double num);
00268
00269 protected:
00270 vtkKWScaleWithEntry();
00271 ~vtkKWScaleWithEntry();
00272
00274
00276 void Bind();
00277 void UnBind();
00279
00280 int PopupMode;
00281 int RangeVisibility;
00282
00283 char *EntryCommand;
00284 int EntryVisibility;
00285 int EntryPosition;
00286 int ExpandEntry;
00287
00288 vtkKWTopLevel *TopLevel;
00289 vtkKWPushButton *PopupPushButton;
00290
00291 vtkKWLabel *RangeMinLabel;
00292 vtkKWLabel *RangeMaxLabel;
00293
00295 virtual void Pack();
00296
00298 virtual void CreateEntry(vtkKWApplication *app);
00299
00301
00302 virtual void UpdateValue();
00303 virtual void SetEntryValue(double num);
00304 virtual void UpdateRange();
00306
00307 private:
00308
00312 vtkKWEntry *Entry;
00313
00314 vtkKWScaleWithEntry(const vtkKWScaleWithEntry&);
00315 void operator=(const vtkKWScaleWithEntry&);
00316 };
00317
00318
00319 #endif
00320
00321
00322