KWWidgets
vtkKWFrameWithScrollbar.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWFrameWithScrollbar.h,v $
4 
5  Copyright (c) Kitware, Inc.
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 // .NAME vtkKWFrameWithScrollbar - a frame with a scroll bar
15 // .SECTION Description
16 // It creates a frame with an attached scrollbar
17 
18 
19 #ifndef __vtkKWFrameWithScrollbar_h
20 #define __vtkKWFrameWithScrollbar_h
21 
22 #include "vtkKWCoreWidget.h"
23 
24 class vtkKWFrame;
25 class vtkKWFrameWithScrollbarInternals;
26 
28 {
29 public:
30  static vtkKWFrameWithScrollbar* New();
32  void PrintSelf(ostream& os, vtkIndent indent);
33 
34  // Description:
35  // Get the internal widget.
36  vtkGetObjectMacro(Frame, vtkKWFrame);
37 
38  // Description:
39  // Set/Get the vertical scrollbar visibility (default to On).
40  // No effect if called after Create().
41  virtual void SetVerticalScrollbarVisibility(int val);
42  vtkGetMacro(VerticalScrollbarVisibility, int);
43  vtkBooleanMacro(VerticalScrollbarVisibility, int);
44 
45  // Description:
46  // Set/Get the horizontal scrollbar visibility (warning, default to Off).
47  // No effect if called after Create().
48  virtual void SetHorizontalScrollbarVisibility(int val);
49  vtkGetMacro(HorizontalScrollbarVisibility, int);
50  vtkBooleanMacro(HorizontalScrollbarVisibility, int);
51 
52  // Description:
53  // Set/Get the background color of the widget.
54  virtual void GetBackgroundColor(double *r, double *g, double *b);
55  virtual double* GetBackgroundColor();
56  virtual void SetBackgroundColor(double r, double g, double b);
57  virtual void SetBackgroundColor(double rgb[3])
58  { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
59 
60  // Description:
61  // Set/Get the border width, a non-negative value indicating the width of
62  // the 3-D border to draw around the outside of the widget (if such a border
63  // is being drawn; the Relief option typically determines this).
64  virtual void SetBorderWidth(int);
65  virtual int GetBorderWidth();
66 
67  // Description:
68  // Set/Get the 3-D effect desired for the widget.
69  // The value indicates how the interior of the widget should appear
70  // relative to its exterior.
71  // Valid constants can be found in vtkKWOptions::ReliefType.
72  virtual void SetRelief(int);
73  virtual int GetRelief();
74  virtual void SetReliefToRaised();
75  virtual void SetReliefToSunken();
76  virtual void SetReliefToFlat();
77  virtual void SetReliefToRidge();
78  virtual void SetReliefToSolid();
79  virtual void SetReliefToGroove();
80 
81  // Description:
82  // Set/Get the width/height of a frame.
83  virtual void SetWidth(int);
84  virtual int GetWidth();
85  virtual void SetHeight(int);
86  virtual int GetHeight();
87 
88  // Description:
89  // Convenience method to set the view area to the top/bottom
90  virtual void ScrollToTop();
91  virtual void ScrollToBottom();
92 
93  // Description:
94  // Update the "enable" state of the object and its internal parts.
95  // Depending on different Ivars (this->Enabled, the application's
96  // Limited Edition Mode, etc.), the "enable" state of the object is updated
97  // and propagated to its internal parts/subwidgets. This will, for example,
98  // enable/disable parts of the widget UI, enable/disable the visibility
99  // of 3D widgets, etc.
100  virtual void UpdateEnableState();
101 
102 protected:
105 
106  // Description:
107  // Create the widget.
108  virtual void CreateWidget();
109 
110  // Description:
111  // Configure the widget.
112  virtual void ConfigureWidget();
113 
114  // Description:
115  // Scrollbar visibility flags
116  int VerticalScrollbarVisibility;
117  int HorizontalScrollbarVisibility;
118 
119  vtkKWFrame *Frame;
120  vtkKWCoreWidget *ScrollableFrame;
121 
122  // PIMPL Encapsulation for STL containers
123  //BTX
124  vtkKWFrameWithScrollbarInternals *Internals;
125  //ETX
126 
127 private:
128  vtkKWFrameWithScrollbar(const vtkKWFrameWithScrollbar&); // Not implemented
129  void operator=(const vtkKWFrameWithScrollbar&); // Not implemented
130 };
131 
132 #endif
133 
134 
135