KWWidgets
|
00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWTreeWithScrollbars.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 vtkKWTreeWithScrollbars - a vtkKWTree associated to two vtkKWScrollbar's 00015 // .SECTION Description 00016 // This composite widget provides horizontal and vertical scrolling 00017 // capabilities to a core widget. They can be enabled or disabled separately. 00018 // As a subclass of vtkKWWidgetWithScrollbars, it inherits methods to 00019 // retrieve the scrollbars and set their visibility and layout. 00020 // .SECTION See Also 00021 // vtkKWWidgetWithScrollbars vtkKWTree 00022 00023 #ifndef __vtkKWTreeWithScrollbars_h 00024 #define __vtkKWTreeWithScrollbars_h 00025 00026 #include "vtkKWWidgetWithScrollbars.h" 00027 00028 class vtkKWScrollbar; 00029 class vtkKWTree; 00030 class vtkKWPushButtonSet; 00031 00032 class KWWidgets_EXPORT vtkKWTreeWithScrollbars : public vtkKWWidgetWithScrollbars 00033 { 00034 public: 00035 static vtkKWTreeWithScrollbars* New(); 00036 vtkTypeRevisionMacro(vtkKWTreeWithScrollbars,vtkKWWidgetWithScrollbars); 00037 void PrintSelf(ostream& os, vtkIndent indent); 00038 00039 // Description: 00040 // Get the vtkKWTree for which we addded the scrollbars 00041 virtual vtkKWTree* GetWidget(); 00042 00043 // Descrition: 00044 // Set/Get the visibility of the small resize buttons placed next to each 00045 // scrollbar. Note that they won't show if the corresponding scrollbar 00046 // is not visible. 00047 virtual void SetResizeButtonsVisibility(int arg); 00048 vtkBooleanMacro(ResizeButtonsVisibility, int); 00049 vtkGetMacro(ResizeButtonsVisibility, int); 00050 00051 // Description: 00052 // Update the "enable" state of the object and its internal parts. 00053 // Depending on different Ivars (this->Enabled, the application's 00054 // Limited Edition Mode, etc.), the "enable" state of the object is updated 00055 // and propagated to its internal parts/subwidgets. This will, for example, 00056 // enable/disable parts of the widget UI, enable/disable the visibility 00057 // of 3D widgets, etc. 00058 virtual void UpdateEnableState(); 00059 00060 // Description: 00061 // Callbacks. Internal, do not use. 00062 virtual void ExpandTreeVerticallyCallback(); 00063 virtual void ShrinkTreeVerticallyCallback(); 00064 virtual void ExpandTreeHorizontallyCallback(); 00065 virtual void ShrinkTreeHorizontallyCallback(); 00066 00067 protected: 00068 vtkKWTreeWithScrollbars(); 00069 ~vtkKWTreeWithScrollbars(); 00070 00071 // Description: 00072 // Create the widget. 00073 virtual void CreateWidget(); 00074 00075 // Description: 00076 // Set the visibility of the resize buttons 00077 int ResizeButtonsVisibility; 00078 00079 // Description: 00080 // Internal widgets 00081 vtkKWTree *Widget; 00082 vtkKWPushButtonSet *VerticalButtons; 00083 vtkKWPushButtonSet *HorizontalButtons; 00084 00085 // Description: 00086 // Create scrollbars and associate the scrollbars to a widget by 00087 // setting up the callbacks between both instances. 00088 // Re-implemented to set the associated now that we know the internal widget 00089 virtual void CreateHorizontalScrollbar(); 00090 virtual void CreateVerticalScrollbar(); 00091 00092 // Description: 00093 // Pack. 00094 virtual void Pack(); 00095 00096 // Description: 00097 // Update buttons 00098 virtual void UpdateButtonsVisibility(); 00099 00100 private: 00101 vtkKWTreeWithScrollbars(const vtkKWTreeWithScrollbars&); // Not implemented 00102 void operator=(const vtkKWTreeWithScrollbars&); // Not implemented 00103 }; 00104 00105 #endif