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 vtkKWApplication;
00027 class vtkKWMenu;
00028 class vtkKWIcon;
00029
00030 class KWWIDGETS_EXPORT vtkKWMenuButton : public vtkKWCoreWidget
00031 {
00032 public:
00033 static vtkKWMenuButton* New();
00034 vtkTypeRevisionMacro(vtkKWMenuButton,vtkKWCoreWidget);
00035 void PrintSelf(ostream& os, vtkIndent indent);
00036
00038 virtual void Create(vtkKWApplication *app);
00039
00041
00043 virtual const char *GetValue();
00044 virtual void SetValue(const char *name);
00046
00048
00050 virtual void NextValue();
00051 virtual void PreviousValue();
00053
00055
00056 vtkGetObjectMacro(Menu, vtkKWMenu);
00058
00060
00065 virtual void AddRadioButton(const char *label);
00066 virtual void AddRadioButton(
00067 const char *label, vtkObject *obj, const char *method,
00068 const char *help = 0);
00069 virtual void AddRadioButtonImage(
00070 const char *image_name, vtkObject *obj, const char *method,
00071 const char *help = 0);
00073
00075
00076 virtual void SetIndicatorVisibility(int ind);
00077 virtual int GetIndicatorVisibility();
00078 vtkBooleanMacro(IndicatorVisibility, int);
00080
00082
00084 virtual void SetWidth(int width);
00085 virtual int GetWidth();
00087
00089
00094 virtual void SetMaximumLabelWidth(int);
00095 vtkGetMacro(MaximumLabelWidth, int);
00097
00099
00102 virtual void SetAnchor(int);
00103 virtual int GetAnchor();
00104 virtual void SetAnchorToNorth()
00105 { this->SetAnchor(vtkKWTkOptions::AnchorNorth); };
00106 virtual void SetAnchorToNorthEast()
00107 { this->SetAnchor(vtkKWTkOptions::AnchorNorthEast); };
00108 virtual void SetAnchorToEast()
00109 { this->SetAnchor(vtkKWTkOptions::AnchorEast); };
00110 virtual void SetAnchorToSouthEast()
00111 { this->SetAnchor(vtkKWTkOptions::AnchorSouthEast); };
00112 virtual void SetAnchorToSouth()
00113 { this->SetAnchor(vtkKWTkOptions::AnchorSouth); };
00114 virtual void SetAnchorToSouthWest()
00115 { this->SetAnchor(vtkKWTkOptions::AnchorSouthWest); };
00116 virtual void SetAnchorToWest()
00117 { this->SetAnchor(vtkKWTkOptions::AnchorWest); };
00118 virtual void SetAnchorToNorthWest()
00119 { this->SetAnchor(vtkKWTkOptions::AnchorNorthWest); };
00120 virtual void SetAnchorToCenter()
00121 { this->SetAnchor(vtkKWTkOptions::AnchorCenter); };
00123
00125
00140 virtual void SetImageToIcon(vtkKWIcon *icon);
00141 virtual void SetImageToPredefinedIcon(int icon_index);
00142 virtual void SetImageToPixels(
00143 const unsigned char *pixels, int width, int height, int pixel_size,
00144 unsigned long buffer_length = 0);
00146
00153 virtual void UpdateEnableState();
00154
00156
00157 virtual void TracedVariableChangedCallback(
00158 const char *, const char *, const char *);
00160
00161 protected:
00162 vtkKWMenuButton();
00163 ~vtkKWMenuButton();
00164
00165 vtkGetStringMacro(CurrentValue);
00166 vtkSetStringMacro(CurrentValue);
00167
00168 char *CurrentValue;
00169 vtkKWMenu *Menu;
00170 int MaximumLabelWidth;
00171
00172 virtual void UpdateOptionMenuLabel();
00173
00174 private:
00175 vtkKWMenuButton(const vtkKWMenuButton&);
00176 void operator=(const vtkKWMenuButton&);
00177 };
00178
00179
00180 #endif
00181
00182
00183