diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/public/vgui_controls/KeyBoardEditorDialog.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/public/vgui_controls/KeyBoardEditorDialog.h')
| -rw-r--r-- | mp/src/public/vgui_controls/KeyBoardEditorDialog.h | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/mp/src/public/vgui_controls/KeyBoardEditorDialog.h b/mp/src/public/vgui_controls/KeyBoardEditorDialog.h index c1761b87..209c86f7 100644 --- a/mp/src/public/vgui_controls/KeyBoardEditorDialog.h +++ b/mp/src/public/vgui_controls/KeyBoardEditorDialog.h @@ -1,138 +1,138 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================
-
-#ifndef KEYBOARDEDITORDIALOG_H
-#define KEYBOARDEDITORDIALOG_H
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "vgui_controls/Frame.h"
-#include "vgui_controls/PropertySheet.h"
-#include "vgui_controls/PropertyPage.h"
-
-class VControlsListPanel;
-
-namespace vgui
-{
-
-//-----------------------------------------------------------------------------
-// Purpose: Dialog for use in editing keybindings
-//-----------------------------------------------------------------------------
-class CKeyBoardEditorPage : public EditablePanel
-{
- DECLARE_CLASS_SIMPLE( CKeyBoardEditorPage, EditablePanel );
-
-public:
- CKeyBoardEditorPage( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle );
- ~CKeyBoardEditorPage();
-
- void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 );
-
- virtual void OnKeyCodeTyped(vgui::KeyCode code);
-
- virtual void ApplySchemeSettings( IScheme *scheme );
-
- void OnSaveChanges();
- void OnRevert();
- void OnUseDefaults();
-
-protected:
-
- virtual void OnPageHide();
-
- virtual void OnCommand( char const *cmd );
-
- void PopulateList();
-
- void GetMappingList( Panel *panel, CUtlVector< PanelKeyBindingMap * >& maps );
- int GetMappingCount( Panel *panel );
-
- void BindKey( vgui::KeyCode code );
-
- // Trap row selection message
- MESSAGE_FUNC( ItemSelected, "ItemSelected" );
- MESSAGE_FUNC_INT( OnClearBinding, "ClearBinding", item );
-
- void SaveMappings();
- void UpdateCurrentMappings();
- void RestoreMappings();
- void ApplyMappings();
-
-protected:
- void AnsiText( char const *token, char *out, size_t buflen );
-
- Panel *m_pPanel;
- KeyBindingContextHandle_t m_Handle;
-
- VControlsListPanel *m_pList;
-
- struct SaveMapping_t
- {
- SaveMapping_t();
- SaveMapping_t( const SaveMapping_t& src );
-
- PanelKeyBindingMap *map;
- CUtlVector< BoundKey_t > current;
- CUtlVector< BoundKey_t > original;
- };
-
- CUtlVector< SaveMapping_t * > m_Save;
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose: Dialog for use in editing keybindings
-//-----------------------------------------------------------------------------
-class CKeyBoardEditorSheet : public PropertySheet
-{
- DECLARE_CLASS_SIMPLE( CKeyBoardEditorSheet, PropertySheet );
-
-public:
- CKeyBoardEditorSheet( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle );
-
- void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 );
-
- void OnSaveChanges();
- void OnRevert();
- void OnUseDefaults();
-
-protected:
-
- vgui::PHandle m_hPanel;
- KeyBindingContextHandle_t m_Handle;
- bool m_bSaveToExternalFile;
- CUtlSymbol m_SaveFileName;
- CUtlSymbol m_SaveFilePathID;
- Color m_clrAlteredItem;
-};
-
-//-----------------------------------------------------------------------------
-// Purpose: Dialog for use in editing keybindings
-//-----------------------------------------------------------------------------
-class CKeyBoardEditorDialog : public Frame
-{
- DECLARE_CLASS_SIMPLE( CKeyBoardEditorDialog, Frame );
-
-public:
- CKeyBoardEditorDialog( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle );
-
- void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 );
-
- virtual void OnCommand( char const *cmd );
-
-private:
- CKeyBoardEditorSheet *m_pKBEditor;
-
- Button *m_pSave;
- Button *m_pCancel;
- Button *m_pRevert;
- Button *m_pUseDefaults;
-};
-
-}
-
-#endif // KEYBOARDEDITORDIALOG_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//============================================================================= + +#ifndef KEYBOARDEDITORDIALOG_H +#define KEYBOARDEDITORDIALOG_H +#ifdef _WIN32 +#pragma once +#endif + +#include "vgui_controls/Frame.h" +#include "vgui_controls/PropertySheet.h" +#include "vgui_controls/PropertyPage.h" + +class VControlsListPanel; + +namespace vgui +{ + +//----------------------------------------------------------------------------- +// Purpose: Dialog for use in editing keybindings +//----------------------------------------------------------------------------- +class CKeyBoardEditorPage : public EditablePanel +{ + DECLARE_CLASS_SIMPLE( CKeyBoardEditorPage, EditablePanel ); + +public: + CKeyBoardEditorPage( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle ); + ~CKeyBoardEditorPage(); + + void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 ); + + virtual void OnKeyCodeTyped(vgui::KeyCode code); + + virtual void ApplySchemeSettings( IScheme *scheme ); + + void OnSaveChanges(); + void OnRevert(); + void OnUseDefaults(); + +protected: + + virtual void OnPageHide(); + + virtual void OnCommand( char const *cmd ); + + void PopulateList(); + + void GetMappingList( Panel *panel, CUtlVector< PanelKeyBindingMap * >& maps ); + int GetMappingCount( Panel *panel ); + + void BindKey( vgui::KeyCode code ); + + // Trap row selection message + MESSAGE_FUNC( ItemSelected, "ItemSelected" ); + MESSAGE_FUNC_INT( OnClearBinding, "ClearBinding", item ); + + void SaveMappings(); + void UpdateCurrentMappings(); + void RestoreMappings(); + void ApplyMappings(); + +protected: + void AnsiText( char const *token, char *out, size_t buflen ); + + Panel *m_pPanel; + KeyBindingContextHandle_t m_Handle; + + VControlsListPanel *m_pList; + + struct SaveMapping_t + { + SaveMapping_t(); + SaveMapping_t( const SaveMapping_t& src ); + + PanelKeyBindingMap *map; + CUtlVector< BoundKey_t > current; + CUtlVector< BoundKey_t > original; + }; + + CUtlVector< SaveMapping_t * > m_Save; +}; + + +//----------------------------------------------------------------------------- +// Purpose: Dialog for use in editing keybindings +//----------------------------------------------------------------------------- +class CKeyBoardEditorSheet : public PropertySheet +{ + DECLARE_CLASS_SIMPLE( CKeyBoardEditorSheet, PropertySheet ); + +public: + CKeyBoardEditorSheet( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle ); + + void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 ); + + void OnSaveChanges(); + void OnRevert(); + void OnUseDefaults(); + +protected: + + vgui::PHandle m_hPanel; + KeyBindingContextHandle_t m_Handle; + bool m_bSaveToExternalFile; + CUtlSymbol m_SaveFileName; + CUtlSymbol m_SaveFilePathID; + Color m_clrAlteredItem; +}; + +//----------------------------------------------------------------------------- +// Purpose: Dialog for use in editing keybindings +//----------------------------------------------------------------------------- +class CKeyBoardEditorDialog : public Frame +{ + DECLARE_CLASS_SIMPLE( CKeyBoardEditorDialog, Frame ); + +public: + CKeyBoardEditorDialog( Panel *parent, Panel *panelToEdit, KeyBindingContextHandle_t handle ); + + void SetKeybindingsSaveFile( char const *filename, char const *pathID = 0 ); + + virtual void OnCommand( char const *cmd ); + +private: + CKeyBoardEditorSheet *m_pKBEditor; + + Button *m_pSave; + Button *m_pCancel; + Button *m_pRevert; + Button *m_pUseDefaults; +}; + +} + +#endif // KEYBOARDEDITORDIALOG_H |