KWWidgets
vtkKWKeyBindingsWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWKeyBindingsWidget.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 vtkKWKeyBindingsWidget - a key bindings widget.
15 // .SECTION Description
16 // This widget can be used to display key bindings stored in a key bindings
17 // manager class (vtkKWKeyBindingsManager).
18 // .SECTION See Also
19 // vtkKWKeyBindingsManager
20 
21 #ifndef __vtkKWKeyBindingsWidget_h
22 #define __vtkKWKeyBindingsWidget_h
23 
24 #include "vtkKWCompositeWidget.h"
25 
27 class vtkKWKeyBindingsWidgetInternals;
28 class vtkKWToolbar;
29 class vtkKWPushButton;
34 
36 {
37 public:
38  static vtkKWKeyBindingsWidget* New();
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
42  // Description:
43  // Set/Get the key bindings manager.
44  vtkGetObjectMacro(KeyBindingsManager,vtkKWKeyBindingsManager);
45  virtual void SetKeyBindingsManager(vtkKWKeyBindingsManager *mgr);
46 
47  // Description:
48  // Write all keybindings to a stream or text file (tab delimited).
49  // Return 1 on success, 0 otherwise
50  virtual int WriteKeyBindingsToStream(ostream& os);
51  virtual int WriteKeyBindingsToFile(const char *filename);
52 
53  // Description:
54  // Expose a few internals
55  vtkGetObjectMacro(Toolbar, vtkKWToolbar);
56  vtkGetObjectMacro(SaveButton, vtkKWLoadSaveButton);
57 
58  // Description:
59  // Update the "enable" state of the object and its internal parts.
60  // Depending on different Ivars (this->Enabled, the application's
61  // Limited Edition Mode, etc.), the "enable" state of the object
62  // is updated and propagated to its internal parts/subwidgets.
63  // This will, for example, enable/disable parts of the widget UI,
64  // enable/disable the visibility of 3D widgets, etc.
65  virtual void UpdateEnableState();
66  virtual void Update();
67 
68  // Description:
69  // Callback, do NOT use.
70  virtual void SelectionChangedCallback();
71  virtual void WriteKeyBindingsToFileCallback();
72 
73 protected:
76 
77  // Description:
78  // Create the widget.
79  virtual void CreateWidget();
80 
81  // Description:
82  // Member variables
83  vtkKWKeyBindingsWidgetInternals *Internals;
84  vtkKWMultiColumnListWithScrollbars *KeyBindingsList;
85  vtkKWToolbar *Toolbar;
86  vtkKWLoadSaveButton *SaveButton;
87  vtkKWFrameWithLabel *DetailFrame;
88  vtkKWTextWithScrollbars *DetailText;
89  vtkKWKeyBindingsManager *KeyBindingsManager;
90 
91 private:
92 
93  vtkKWKeyBindingsWidget(const vtkKWKeyBindingsWidget&); // Not implemented
94  void operator=(const vtkKWKeyBindingsWidget&); // Not implemented
95 };
96 #endif