KWWidgets
vtkKWKeyBindingsWidget.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Module:    $RCSfile: vtkKWKeyBindingsWidget.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 vtkKWKeyBindingsWidget - a key bindings widget.
00015 // .SECTION Description
00016 // This widget can be used to display key bindings stored in a key bindings
00017 // manager class (vtkKWKeyBindingsManager).
00018 // .SECTION See Also
00019 // vtkKWKeyBindingsManager
00020 
00021 #ifndef __vtkKWKeyBindingsWidget_h
00022 #define __vtkKWKeyBindingsWidget_h
00023 
00024 #include "vtkKWCompositeWidget.h"
00025 
00026 class vtkKWMultiColumnListWithScrollbars;
00027 class vtkKWKeyBindingsWidgetInternals;
00028 class vtkKWToolbar;
00029 class vtkKWPushButton;
00030 class vtkKWLoadSaveButton;
00031 class vtkKWTextWithScrollbars;
00032 class vtkKWFrameWithLabel;
00033 class vtkKWKeyBindingsManager;
00034 
00035 class KWWidgets_EXPORT vtkKWKeyBindingsWidget : public vtkKWCompositeWidget
00036 {
00037 public:
00038   static vtkKWKeyBindingsWidget* New();
00039   vtkTypeRevisionMacro(vtkKWKeyBindingsWidget,vtkKWCompositeWidget);
00040   void PrintSelf(ostream& os, vtkIndent indent);
00041   
00042   // Description:
00043   // Set/Get the key bindings manager.
00044   vtkGetObjectMacro(KeyBindingsManager,vtkKWKeyBindingsManager);
00045   virtual void SetKeyBindingsManager(vtkKWKeyBindingsManager *mgr);
00046 
00047   // Description:
00048   // Write all keybindings to a stream or text file (tab delimited).
00049   // Return 1 on success, 0 otherwise
00050   virtual int WriteKeyBindingsToStream(ostream& os);
00051   virtual int WriteKeyBindingsToFile(const char *filename);
00052 
00053   // Description:
00054   // Expose a few internals
00055   vtkGetObjectMacro(Toolbar, vtkKWToolbar);
00056   vtkGetObjectMacro(SaveButton, vtkKWLoadSaveButton);
00057   
00058   // Description:
00059   // Update the "enable" state of the object and its internal parts.
00060   // Depending on different Ivars (this->Enabled, the application's 
00061   // Limited Edition Mode, etc.), the "enable" state of the object 
00062   // is updated and propagated to its internal parts/subwidgets. 
00063   // This will, for example, enable/disable parts of the widget UI, 
00064   // enable/disable the visibility of 3D widgets, etc.
00065   virtual void UpdateEnableState();
00066   virtual void Update();
00067 
00068   // Description:
00069   // Callback, do NOT use. 
00070   virtual void SelectionChangedCallback();
00071   virtual void WriteKeyBindingsToFileCallback();
00072 
00073 protected:
00074   vtkKWKeyBindingsWidget();
00075   ~vtkKWKeyBindingsWidget();
00076 
00077   // Description:
00078   // Create the widget.
00079   virtual void CreateWidget();
00080   
00081   // Description:
00082   // Member variables
00083   vtkKWKeyBindingsWidgetInternals *Internals;
00084   vtkKWMultiColumnListWithScrollbars *KeyBindingsList;
00085   vtkKWToolbar *Toolbar;
00086   vtkKWLoadSaveButton *SaveButton;
00087   vtkKWFrameWithLabel *DetailFrame;
00088   vtkKWTextWithScrollbars *DetailText;
00089   vtkKWKeyBindingsManager *KeyBindingsManager;
00090 
00091 private:
00092 
00093   vtkKWKeyBindingsWidget(const vtkKWKeyBindingsWidget&); // Not implemented
00094   void operator=(const vtkKWKeyBindingsWidget&); // Not implemented
00095 };
00096 #endif