00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00021 #ifndef __vtkKWMenuButton_h
00022 #define __vtkKWMenuButton_h
00023
00024 #include "vtkKWCoreWidget.h"
00025
00026 class vtkKWMenu;
00027 class vtkKWIcon;
00028 class vtkKWMenuButtonInternals;
00029
00030 class KWWidgets_EXPORT vtkKWMenuButton : public vtkKWCoreWidget
00031 {
00032
00033 public:
00034 static vtkKWMenuButton* New();
00035 vtkTypeRevisionMacro(vtkKWMenuButton,vtkKWCoreWidget);
00036 void PrintSelf(ostream& os, vtkIndent indent);
00037
00039
00041 virtual const char *GetValue();
00042 virtual void SetValue(const char *name);
00044
00046
00049 virtual void NextValue();
00050 virtual void PreviousValue();
00052
00054
00055 vtkGetObjectMacro(Menu, vtkKWMenu);
00057
00059
00060 virtual void SetIndicatorVisibility(int ind);
00061 virtual int GetIndicatorVisibility();
00062 vtkBooleanMacro(IndicatorVisibility, int);
00064
00066
00067 virtual void SetWidth(int width);
00068 virtual int GetWidth();
00070
00072
00078 virtual void SetMaximumLabelWidth(int);
00079 vtkGetMacro(MaximumLabelWidth, int);
00081
00083
00088 virtual void SetAdjustLabelWidthToWidgetSize(int);
00089 vtkGetMacro(AdjustLabelWidthToWidgetSize, int);
00090 vtkBooleanMacro(AdjustLabelWidthToWidgetSize, int);
00092
00094
00095 virtual void GetBackgroundColor(double *r, double *g, double *b);
00096 virtual double* GetBackgroundColor();
00097 virtual void SetBackgroundColor(double r, double g, double b);
00098 virtual void SetBackgroundColor(double rgb[3])
00099 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00101
00103
00104 virtual void GetForegroundColor(double *r, double *g, double *b);
00105 virtual double* GetForegroundColor();
00106 virtual void SetForegroundColor(double r, double g, double b);
00107 virtual void SetForegroundColor(double rgb[3])
00108 { this->SetForegroundColor(rgb[0], rgb[1], rgb[2]); };
00110
00112
00115 virtual void SetHighlightThickness(int);
00116 virtual int GetHighlightThickness();
00118
00120
00124 virtual void GetActiveBackgroundColor(double *r, double *g, double *b);
00125 virtual double* GetActiveBackgroundColor();
00126 virtual void SetActiveBackgroundColor(double r, double g, double b);
00127 virtual void SetActiveBackgroundColor(double rgb[3])
00128 { this->SetActiveBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00130
00132
00136 virtual void GetActiveForegroundColor(double *r, double *g, double *b);
00137 virtual double* GetActiveForegroundColor();
00138 virtual void SetActiveForegroundColor(double r, double g, double b);
00139 virtual void SetActiveForegroundColor(double rgb[3])
00140 { this->SetActiveForegroundColor(rgb[0], rgb[1], rgb[2]); };
00142
00144
00145 virtual void GetDisabledForegroundColor(double *r, double *g, double *b);
00146 virtual double* GetDisabledForegroundColor();
00147 virtual void SetDisabledForegroundColor(double r, double g, double b);
00148 virtual void SetDisabledForegroundColor(double rgb[3])
00149 { this->SetDisabledForegroundColor(rgb[0], rgb[1], rgb[2]); };
00151
00153
00156 virtual void SetBorderWidth(int);
00157 virtual int GetBorderWidth();
00159
00161
00164 virtual void SetRelief(int);
00165 virtual int GetRelief();
00166 virtual void SetReliefToRaised();
00167 virtual void SetReliefToSunken();
00168 virtual void SetReliefToFlat();
00169 virtual void SetReliefToRidge();
00170 virtual void SetReliefToSolid();
00171 virtual void SetReliefToGroove();
00173
00175
00186 virtual void SetFont(const char *font);
00187 virtual const char* GetFont();
00189
00191
00199 virtual void SetPadX(int);
00200 virtual int GetPadX();
00201 virtual void SetPadY(int);
00202 virtual int GetPadY();
00204
00206
00209 virtual void SetAnchor(int);
00210 virtual int GetAnchor();
00211 virtual void SetAnchorToNorth();
00212 virtual void SetAnchorToNorthEast();
00213 virtual void SetAnchorToEast();
00214 virtual void SetAnchorToSouthEast();
00215 virtual void SetAnchorToSouth();
00216 virtual void SetAnchorToSouthWest();
00217 virtual void SetAnchorToWest();
00218 virtual void SetAnchorToNorthWest();
00219 virtual void SetAnchorToCenter();
00221
00223
00239 virtual void SetImageToIcon(vtkKWIcon *icon);
00240 virtual void SetImageToPredefinedIcon(int icon_index);
00241 virtual void SetImageToPixels(
00242 const unsigned char *pixels, int width, int height, int pixel_size,
00243 unsigned long buffer_length = 0);
00245
00247
00253 virtual void SetCompoundMode(int);
00254 virtual int GetCompoundMode();
00255 virtual void SetCompoundModeToNone();
00256 virtual void SetCompoundModeToLeft();
00257 virtual void SetCompoundModeToCenter();
00258 virtual void SetCompoundModeToRight();
00259 virtual void SetCompoundModeToTop();
00260 virtual void SetCompoundModeToBottom();
00262
00269 virtual void UpdateEnableState();
00270
00272
00273 virtual void TracedVariableChangedCallback(
00274 const char *, const char *, const char *);
00275 virtual void ConfigureCallback();
00276 virtual void UpdateMenuButtonLabelCallback();
00278
00280
00284 virtual void AddCallbackCommandObservers();
00285 virtual void RemoveCallbackCommandObservers();
00287
00288
00289
00290 protected:
00291 vtkKWMenuButton();
00292 ~vtkKWMenuButton();
00293
00295 virtual void CreateWidget();
00296
00297 vtkGetStringMacro(CurrentValue);
00298 vtkSetStringMacro(CurrentValue);
00299
00300 char *CurrentValue;
00301 vtkKWMenu *Menu;
00302 int MaximumLabelWidth;
00303 int AdjustLabelWidthToWidgetSize;
00304
00305 virtual void UpdateMenuButtonLabel();
00306 virtual const char* UpdateMenuButtonLabelFromMenu(
00307 const char *varname, const char *value, vtkKWMenu *menu);
00308 virtual void ScheduleUpdateMenuButtonLabel();
00309
00311
00314 virtual void ProcessCallbackCommandEvents(
00315 vtkObject *caller, unsigned long event, void *calldata);
00317
00319 virtual void UpdateBindings();
00320
00321
00322
00323 vtkKWMenuButtonInternals *Internals;
00324
00325
00326
00327
00328 private:
00329 vtkKWMenuButton(const vtkKWMenuButton&);
00330 void operator=(const vtkKWMenuButton&);
00331 };
00332
00333 #endif
00334
00335
00336