diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/vgui_controls/PropertyDialog.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/vgui_controls/PropertyDialog.h')
| -rw-r--r-- | mp/src/public/vgui_controls/PropertyDialog.h | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/mp/src/public/vgui_controls/PropertyDialog.h b/mp/src/public/vgui_controls/PropertyDialog.h new file mode 100644 index 00000000..5711a33b --- /dev/null +++ b/mp/src/public/vgui_controls/PropertyDialog.h @@ -0,0 +1,84 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef PROPERTYDIALOG_H
+#define PROPERTYDIALOG_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/VGUI.h>
+#include <vgui_controls/Frame.h>
+
+namespace vgui
+{
+
+//-----------------------------------------------------------------------------
+// Purpose: Simple frame that holds a property sheet
+//-----------------------------------------------------------------------------
+class PropertyDialog : public Frame
+{
+ DECLARE_CLASS_SIMPLE( PropertyDialog, Frame );
+
+public:
+ PropertyDialog(Panel *parent, const char *panelName);
+ ~PropertyDialog();
+
+ // returns a pointer to the PropertySheet this dialog encapsulates
+ virtual PropertySheet *GetPropertySheet();
+
+ // wrapper for PropertySheet interface
+ virtual void AddPage(Panel *page, const char *title);
+ virtual Panel *GetActivePage();
+ virtual void ResetAllData();
+ virtual void ApplyChanges();
+
+ // sets the text on the OK/Cancel buttons, overriding the default
+ void SetOKButtonText(const char *text);
+ void SetCancelButtonText(const char *text);
+ void SetApplyButtonText(const char *text);
+
+ // changes the visibility of the buttons
+ void SetOKButtonVisible(bool state);
+ void SetCancelButtonVisible(bool state);
+ void SetApplyButtonVisible(bool state);
+
+ /* MESSAGES SENT
+ "ResetData" - sent when page is loaded. Data should be reloaded from document into controls.
+ "ApplyChanges" - sent when the OK / Apply button is pressed. Changed data should be written into document.
+ */
+
+protected:
+ // Called when the OK button is pressed. Simply closes the dialog.
+ virtual bool OnOK(bool applyOnly);
+
+ // called when the Cancel button is pressed
+ virtual void OnCancel();
+
+ // vgui overrides
+ virtual void PerformLayout();
+ virtual void OnCommand(const char *command);
+ virtual void ActivateBuildMode();
+ virtual void OnKeyCodeTyped(KeyCode code);
+ virtual void RequestFocus(int direction = 0);
+
+ MESSAGE_FUNC( OnApplyButtonEnable, "ApplyButtonEnable" );
+ void EnableApplyButton(bool bEnable);
+
+private:
+ PropertySheet *_propertySheet;
+ Button *_okButton;
+ Button *_cancelButton;
+ Button *_applyButton;
+
+ CPanelAnimationVar( int, m_iSheetInsetBottom, "sheetinset_bottom", "32" );
+};
+
+}; // vgui
+
+#endif // PROPERTYDIALOG_H
|