00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00043 #ifndef __vtkKWScaleWithEntry_h
00044 #define __vtkKWScaleWithEntry_h
00045
00046 #include "vtkKWScaleWithLabel.h"
00047
00048 class vtkKWEntry;
00049 class vtkKWLabel;
00050 class vtkKWPushButton;
00051 class vtkKWTopLevel;
00052
00053 class KWWidgets_EXPORT vtkKWScaleWithEntry : public vtkKWScaleWithLabel
00054 {
00055
00056 public:
00057 static vtkKWScaleWithEntry* New();
00058 vtkTypeRevisionMacro(vtkKWScaleWithEntry,vtkKWScaleWithLabel);
00059 void PrintSelf(ostream& os, vtkIndent indent);
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
00129 virtual void SetLabelText(const char *);
00130
00132
00137 virtual vtkKWEntry* GetEntry();
00138 virtual int HasEntry();
00140
00142
00145 virtual void SetEntryWidth(int width);
00146 virtual int GetEntryWidth();
00148
00150
00158 enum
00159 {
00160 EntryPositionDefault = 0,
00161 EntryPositionTop,
00162 EntryPositionBottom,
00163 EntryPositionLeft,
00164 EntryPositionRight
00165 };
00166
00167 virtual void SetEntryPosition(int);
00168 vtkGetMacro(EntryPosition, int);
00169 virtual void SetEntryPositionToDefault()
00170 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionDefault); };
00171 virtual void SetEntryPositionToTop()
00172 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionTop); };
00173 virtual void SetEntryPositionToBottom()
00174 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionBottom); };
00175 virtual void SetEntryPositionToLeft()
00176 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionLeft); };
00177 virtual void SetEntryPositionToRight()
00178 { this->SetEntryPosition(vtkKWScaleWithEntry::EntryPositionRight); };
00180
00183 virtual void SetLabelAndEntryPositionToTop();
00184
00186
00188 vtkSetMacro(PopupMode, int);
00189 vtkGetMacro(PopupMode, int);
00190 vtkBooleanMacro(PopupMode, int);
00191 vtkGetObjectMacro(PopupPushButton, vtkKWPushButton);
00193
00195
00199 virtual void SetExpandEntry(int flag);
00200 vtkGetMacro(ExpandEntry, int);
00201 vtkBooleanMacro(ExpandEntry, int);
00203
00205
00209 virtual void SetOrientation(int);
00210 virtual int GetOrientation();
00211 virtual void SetOrientationToHorizontal();
00212 virtual void SetOrientationToVertical();
00214
00216
00219 virtual void SetLength(int length);
00220 virtual int GetLength();
00222
00224
00253 virtual void SetCommand(vtkObject *object, const char *method);
00254 virtual void SetStartCommand(vtkObject *object, const char *method);
00255 virtual void SetEndCommand(vtkObject *object, const char *method);
00256 virtual void SetEntryCommand(vtkObject *object, const char *method);
00258
00277 virtual void SetDisableCommands(int);
00278 virtual int GetDisableCommands();
00279 vtkBooleanMacro(DisableCommands, int);
00281
00284 virtual void SetBalloonHelpString(const char *str);
00285
00292 virtual void UpdateEnableState();
00293
00295
00296 virtual void DisplayPopupModeCallback();
00297 virtual void WithdrawPopupModeCallback();
00298 virtual void EntryValueCallback(const char *value);
00299 virtual void ScaleValueCallback(double num);
00301
00303
00307 virtual void AddCallbackCommandObservers();
00308 virtual void RemoveCallbackCommandObservers();
00310
00311
00312
00313 protected:
00314 vtkKWScaleWithEntry();
00315 ~vtkKWScaleWithEntry();
00316
00318 virtual void CreateWidget();
00319
00321
00323 void Bind();
00324 void UnBind();
00326
00327 int PopupMode;
00328 int RangeVisibility;
00329
00330 virtual void InvokeEntryCommand(double value);
00331 char *EntryCommand;
00332
00333 int EntryVisibility;
00334 int EntryPosition;
00335 int ExpandEntry;
00336
00337 vtkKWTopLevel *TopLevel;
00338 vtkKWPushButton *PopupPushButton;
00339
00340 vtkKWLabel *RangeMinLabel;
00341 vtkKWLabel *RangeMaxLabel;
00342
00344 virtual void Pack();
00345
00347 virtual void CreateEntry();
00348
00350
00351 virtual void UpdateValue();
00352 virtual void SetEntryValue(double num);
00353 virtual void UpdateRange();
00355
00357
00360 virtual void ProcessCallbackCommandEvents(
00361 vtkObject *caller, unsigned long event, void *calldata);
00363
00364
00365
00366 private:
00367
00371 vtkKWEntry *Entry;
00372
00373 vtkKWScaleWithEntry(const vtkKWScaleWithEntry&);
00374 void operator=(const vtkKWScaleWithEntry&);
00375 };
00376
00377
00378 #endif
00379
00380
00381
00382