00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWWidgetWithSpinButtons.h,v $ 00004 00005 Copyright (c) Kitware, Inc. 00006 All rights reserved. 00007 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 // .NAME vtkKWWidgetWithSpinButtons - an abstract class widget with spin buttons 00015 // .SECTION Description 00016 // This class implements an abstract superclass for composite widgets 00017 // associating a widget to a set of spin buttons. 00018 // The only requirement is for the widget to implement the NextValue() 00019 // and PreviousValue() callbacks. 00020 // 00021 // Be aware that most subclasses of vtkKWWidgetWithSpinButtons are 00022 // generated automatically out of the vtkKWWidgetWithSpinButtonsSubclass 00023 // template located in the Templates directory. Therefore, even though the 00024 // source code for those vtkKWWidgetWithSpinButtons subclasses does not exist 00025 // in the KWWidgets repository, they are still generated automatically and 00026 // documented in the API online; check the vtkKWWidgetWithSpinButtons API 00027 // online for its subclasses, as well as the \subpage 00028 // kwwidgets_autogenerated_page page. Classes related 00029 // to the same template can be found in the 00030 // \ref kwwidgets_autogenerated_widget_with_spinbuttons_group section. 00031 // .SECTION See Also 00032 // vtkKWMenuButtonWithSpinButtons 00033 00034 #ifndef __vtkKWWidgetWithSpinButtons_h 00035 #define __vtkKWWidgetWithSpinButtons_h 00036 00037 #include "vtkKWCompositeWidget.h" 00038 00039 class vtkKWSpinButtons; 00040 00041 class KWWidgets_EXPORT vtkKWWidgetWithSpinButtons : public vtkKWCompositeWidget 00042 { 00043 public: 00044 static vtkKWWidgetWithSpinButtons* New(); 00045 vtkTypeRevisionMacro(vtkKWWidgetWithSpinButtons, vtkKWCompositeWidget); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00048 // Description: 00049 // Retrieve the spin buttons 00050 vtkGetObjectMacro(SpinButtons, vtkKWSpinButtons); 00051 00052 // Description: 00053 // Set the string that enables balloon help for this widget. 00054 // Override to pass down to children. 00055 virtual void SetBalloonHelpString(const char *str); 00056 00057 // Description: 00058 // Update the "enable" state of the object and its internal parts. 00059 // Depending on different Ivars (this->Enabled, the application's 00060 // Limited Edition Mode, etc.), the "enable" state of the object is updated 00061 // and propagated to its internal parts/subwidgets. This will, for example, 00062 // enable/disable parts of the widget UI, enable/disable the visibility 00063 // of 3D widgets, etc. 00064 virtual void UpdateEnableState(); 00065 00066 // Description: 00067 // Callbacks. Internal, do not use. 00068 virtual void NextValueCallback() {}; 00069 virtual void PreviousValueCallback() {}; 00070 00071 protected: 00072 vtkKWWidgetWithSpinButtons(); 00073 ~vtkKWWidgetWithSpinButtons(); 00074 00075 // Description: 00076 // Create the widget. 00077 virtual void CreateWidget(); 00078 00079 // Description: 00080 // Pack or repack the widget. To be implemented by subclasses. 00081 virtual void Pack() {}; 00082 00083 // Description: 00084 // Internal spin buttons 00085 vtkKWSpinButtons *SpinButtons; 00086 00087 private: 00088 00089 vtkKWWidgetWithSpinButtons(const vtkKWWidgetWithSpinButtons&); // Not implemented 00090 void operator=(const vtkKWWidgetWithSpinButtons&); // Not implemented 00091 }; 00092 00093 #endif