KWWidgets
|
00001 #ifndef __vtkKWMyWidget_h 00002 #define __vtkKWMyWidget_h 00003 00004 #include "vtkKWCompositeWidget.h" 00005 00006 class vtkKWLabel; 00007 class vtkKWCheckButton; 00008 00009 class vtkKWMyWidget : public vtkKWCompositeWidget 00010 { 00011 public: 00012 static vtkKWMyWidget* New(); 00013 vtkTypeRevisionMacro(vtkKWMyWidget,vtkKWCompositeWidget); 00014 void PrintSelf(ostream& os, vtkIndent indent); 00015 00016 // Description: 00017 // Get the internal widgets. 00018 vtkGetObjectMacro(Label, vtkKWLabel); 00019 vtkGetObjectMacro(CheckButton, vtkKWCheckButton); 00020 00021 // Description: 00022 // Set/Get the background color of the label when the checkbutton is selected 00023 vtkGetVector3Macro(SelectedBackgroundColor, double); 00024 virtual void SetSelectedBackgroundColor(double r, double g, double b); 00025 virtual void SetSelectedBackgroundColor(double rgb[3]) 00026 { this->SetSelectedBackgroundColor(rgb[0], rgb[1], rgb[2]); }; 00027 00028 // Description: 00029 // Update the "enable" state of the object and its internal parts. 00030 // Depending on different Ivars (this->Enabled, the application's 00031 // Limited Edition Mode, etc.), the "enable" state of the object is updated 00032 // and propagated to its internal parts/subwidgets. 00033 virtual void UpdateEnableState(); 00034 00035 protected: 00036 vtkKWMyWidget(); 00037 ~vtkKWMyWidget(); 00038 00039 vtkKWLabel *Label; 00040 vtkKWCheckButton *CheckButton; 00041 00042 double SelectedBackgroundColor[3]; 00043 00044 // Description: 00045 // Create the widget. 00046 virtual void CreateWidget(); 00047 00048 // Description: 00049 // Update the label's aspect according to the checkbutton's state. 00050 virtual void UpdateLabel(); 00051 00052 // Description: 00053 // Processes the events that are passed through CallbackCommand (or others). 00054 virtual void ProcessCallbackCommandEvents( 00055 vtkObject *caller, unsigned long event, void *calldata); 00056 00057 private: 00058 vtkKWMyWidget(const vtkKWMyWidget&); // Not implemented. 00059 void operator=(const vtkKWMyWidget&); // Not implemented. 00060 }; 00061 00062 #endif