00001 /*========================================================================= 00002 00003 Module: vtkKWSmallCounterLabel.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 vtkKWSmallCounterLabel - a (very) small counter label (icon) 00015 // .SECTION Description 00016 // A widget that represents a very small counter (as an icon), counting 00017 // from 1 to 9 (any value over 9 is represented as 9+). 00018 00019 #ifndef __vtkKWSmallCounterLabel_h 00020 #define __vtkKWSmallCounterLabel_h 00021 00022 #include "vtkKWLabel.h" 00023 00024 class KWWidgets_EXPORT vtkKWSmallCounterLabel : public vtkKWLabel 00025 { 00026 public: 00027 static vtkKWSmallCounterLabel* New(); 00028 vtkTypeRevisionMacro(vtkKWSmallCounterLabel,vtkKWLabel); 00029 void PrintSelf(ostream& os, vtkIndent indent); 00030 00031 // Description: 00032 // Set/Get the value of the counter. 00033 // Set it to 0 to hide the counter. Any value over 9 will be stored as 00034 // 10 and represented as a 9+ icon. 00035 virtual void SetValue(unsigned int v); 00036 vtkGetMacro(Value, unsigned int); 00037 00038 // Description: 00039 // Place the icon on top of its parent 00040 virtual void Place(); 00041 00042 00043 protected: 00044 vtkKWSmallCounterLabel(); 00045 ~vtkKWSmallCounterLabel(); 00046 00047 // Description: 00048 // Create the widget. 00049 virtual void CreateWidget(); 00050 00051 // Description: 00052 // Update the icon. 00053 virtual void UpdateIcon(); 00054 00055 unsigned int Value; 00056 vtkKWWidget *OriginalParent; 00057 00058 private: 00059 vtkKWSmallCounterLabel(const vtkKWSmallCounterLabel&); // Not implemented 00060 void operator=(const vtkKWSmallCounterLabel&); // Not implemented 00061 }; 00062 00063 00064 #endif