KWWidgets
|
00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWFrameWithScrollbar.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 vtkKWFrameWithScrollbar - a frame with a scroll bar 00015 // .SECTION Description 00016 // It creates a frame with an attached scrollbar 00017 00018 00019 #ifndef __vtkKWFrameWithScrollbar_h 00020 #define __vtkKWFrameWithScrollbar_h 00021 00022 #include "vtkKWCoreWidget.h" 00023 00024 class vtkKWFrame; 00025 class vtkKWFrameWithScrollbarInternals; 00026 00027 class KWWidgets_EXPORT vtkKWFrameWithScrollbar : public vtkKWCoreWidget 00028 { 00029 public: 00030 static vtkKWFrameWithScrollbar* New(); 00031 vtkTypeRevisionMacro(vtkKWFrameWithScrollbar,vtkKWCoreWidget); 00032 void PrintSelf(ostream& os, vtkIndent indent); 00033 00034 // Description: 00035 // Get the internal widget. 00036 vtkGetObjectMacro(Frame, vtkKWFrame); 00037 00038 // Description: 00039 // Set/Get the vertical scrollbar visibility (default to On). 00040 // No effect if called after Create(). 00041 virtual void SetVerticalScrollbarVisibility(int val); 00042 vtkGetMacro(VerticalScrollbarVisibility, int); 00043 vtkBooleanMacro(VerticalScrollbarVisibility, int); 00044 00045 // Description: 00046 // Set/Get the horizontal scrollbar visibility (warning, default to Off). 00047 // No effect if called after Create(). 00048 virtual void SetHorizontalScrollbarVisibility(int val); 00049 vtkGetMacro(HorizontalScrollbarVisibility, int); 00050 vtkBooleanMacro(HorizontalScrollbarVisibility, int); 00051 00052 // Description: 00053 // Set/Get the background color of the widget. 00054 virtual void GetBackgroundColor(double *r, double *g, double *b); 00055 virtual double* GetBackgroundColor(); 00056 virtual void SetBackgroundColor(double r, double g, double b); 00057 virtual void SetBackgroundColor(double rgb[3]) 00058 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); }; 00059 00060 // Description: 00061 // Set/Get the border width, a non-negative value indicating the width of 00062 // the 3-D border to draw around the outside of the widget (if such a border 00063 // is being drawn; the Relief option typically determines this). 00064 virtual void SetBorderWidth(int); 00065 virtual int GetBorderWidth(); 00066 00067 // Description: 00068 // Set/Get the 3-D effect desired for the widget. 00069 // The value indicates how the interior of the widget should appear 00070 // relative to its exterior. 00071 // Valid constants can be found in vtkKWOptions::ReliefType. 00072 virtual void SetRelief(int); 00073 virtual int GetRelief(); 00074 virtual void SetReliefToRaised(); 00075 virtual void SetReliefToSunken(); 00076 virtual void SetReliefToFlat(); 00077 virtual void SetReliefToRidge(); 00078 virtual void SetReliefToSolid(); 00079 virtual void SetReliefToGroove(); 00080 00081 // Description: 00082 // Set/Get the width/height of a frame. 00083 virtual void SetWidth(int); 00084 virtual int GetWidth(); 00085 virtual void SetHeight(int); 00086 virtual int GetHeight(); 00087 00088 // Description: 00089 // Convenience method to set the view area to the top/bottom 00090 virtual void ScrollToTop(); 00091 virtual void ScrollToBottom(); 00092 00093 // Description: 00094 // Update the "enable" state of the object and its internal parts. 00095 // Depending on different Ivars (this->Enabled, the application's 00096 // Limited Edition Mode, etc.), the "enable" state of the object is updated 00097 // and propagated to its internal parts/subwidgets. This will, for example, 00098 // enable/disable parts of the widget UI, enable/disable the visibility 00099 // of 3D widgets, etc. 00100 virtual void UpdateEnableState(); 00101 00102 protected: 00103 vtkKWFrameWithScrollbar(); 00104 ~vtkKWFrameWithScrollbar(); 00105 00106 // Description: 00107 // Create the widget. 00108 virtual void CreateWidget(); 00109 00110 // Description: 00111 // Configure the widget. 00112 virtual void ConfigureWidget(); 00113 00114 // Description: 00115 // Scrollbar visibility flags 00116 int VerticalScrollbarVisibility; 00117 int HorizontalScrollbarVisibility; 00118 00119 vtkKWFrame *Frame; 00120 vtkKWCoreWidget *ScrollableFrame; 00121 00122 // PIMPL Encapsulation for STL containers 00123 //BTX 00124 vtkKWFrameWithScrollbarInternals *Internals; 00125 //ETX 00126 00127 private: 00128 vtkKWFrameWithScrollbar(const vtkKWFrameWithScrollbar&); // Not implemented 00129 void operator=(const vtkKWFrameWithScrollbar&); // Not implemented 00130 }; 00131 00132 #endif 00133 00134 00135