KWWidgets
debian/tmp/usr/include/KWWidgets/vtkKWHeaderAnnotationEditor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWHeaderAnnotationEditor.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 vtkKWHeaderAnnotationEditor - a header annotation widget
15 // .SECTION Description
16 // A class that provides a UI for header annotation (vtkTextActor).
17 
18 #ifndef __vtkKWHeaderAnnotationEditor_h
19 #define __vtkKWHeaderAnnotationEditor_h
20 
22 
25 class vtkKWRenderWidget;
27 class vtkTextActor;
28 class vtkKWFrame;
29 
31 {
32 public:
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
37  // Description:
38  // Makes the text property sub-widget popup (instead of displaying the
39  // whole text property UI, which can be long).
40  // This has to be called before Create(). Ignored if PopupMode is true.
41  vtkSetMacro(PopupTextProperty, int);
42  vtkGetMacro(PopupTextProperty, int);
43  vtkBooleanMacro(PopupTextProperty, int);
44 
45  // Description:
46  // Set/Get the vtkKWRenderWidget that owns the header annotation.
47  // It is not ref-counted.
48  virtual void SetRenderWidget(vtkKWRenderWidget*);
49  vtkGetObjectMacro(RenderWidget, vtkKWRenderWidget);
50 
51  // Description:
52  // Set/Get the annotation visibility
53  virtual void SetVisibility(int i);
54  virtual int GetVisibility();
55  vtkBooleanMacro(Visibility, int);
56 
57  // Description:
58  // Set/Get the event invoked when the anything in the annotation is changed.
59  // Defaults to vtkKWEvent::ViewAnnotationChangedEvent
60  vtkSetMacro(AnnotationChangedEvent, int);
61  vtkGetMacro(AnnotationChangedEvent, int);
62 
63  // Description:
64  // Access to sub-widgets
65  virtual vtkKWCheckButton* GetHeaderVisibilityButton()
66  { return this->GetCheckButton(); };
67 
68  // Description:
69  // Update the GUI according to the value of the ivars
70  void Update();
71 
72  // Description:
73  // Update the "enable" state of the object and its internal parts.
74  // Depending on different Ivars (this->Enabled, the application's
75  // Limited Edition Mode, etc.), the "enable" state of the object is updated
76  // and propagated to its internal parts/subwidgets. This will, for example,
77  // enable/disable parts of the widget UI, enable/disable the visibility
78  // of 3D widgets, etc.
79  virtual void UpdateEnableState();
80 
81  // Description:
82  // Callbacks. Internal, do not use.
83  virtual void CheckButtonCallback(int state);
84  virtual void HeaderTextCallback(const char *value);
85  virtual void TextPropertyCallback();
86 
87 protected:
90 
91  // Description:
92  // Create the widget.
93  virtual void CreateWidget();
94 
96 
98 
99  // GUI
100 
102 
107 
108  virtual void Render();
109  virtual void SetHeaderText(const char *txt);
110 
111  // Get the value that should be used to set the checkbutton state
112  // (i.e. depending on the value this checkbutton is supposed to reflect,
113  // for example, an annotation visibility).
114  // This does *not* return the state of the widget.
115  virtual int GetCheckButtonState() { return this->GetVisibility(); };
116 
117  // Send an event representing the state of the widget
118  virtual void SendChangedEvent();
119 
120 private:
121  vtkKWHeaderAnnotationEditor(const vtkKWHeaderAnnotationEditor&); // Not implemented
122  void operator=(const vtkKWHeaderAnnotationEditor&); // Not Implemented
123 };
124 
125 #endif
126