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 /sp/src/public/vgui_controls/MenuButton.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 'sp/src/public/vgui_controls/MenuButton.h')
| -rw-r--r-- | sp/src/public/vgui_controls/MenuButton.h | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/sp/src/public/vgui_controls/MenuButton.h b/sp/src/public/vgui_controls/MenuButton.h index ed5d56e9..a90fb236 100644 --- a/sp/src/public/vgui_controls/MenuButton.h +++ b/sp/src/public/vgui_controls/MenuButton.h @@ -1,82 +1,82 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#ifndef MENUBUTTON_H
-#define MENUBUTTON_H
-
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include <vgui_controls/Button.h>
-#include "vgui_controls/Menu.h"
-
-namespace vgui
-{
-
-class Menu;
-class TextImage;
-
-//-----------------------------------------------------------------------------
-// Purpose: Button that displays a menu when pressed
-//-----------------------------------------------------------------------------
-class MenuButton : public Button
-{
- DECLARE_CLASS_SIMPLE( MenuButton, Button );
-
-public:
- MenuButton(Panel *parent, const char *panelName, const char *text);
- ~MenuButton();
-
- // functions designed to be overriden
- virtual void OnShowMenu(Menu *menu) {}
- virtual void OnHideMenu(Menu *menu) {}
- virtual int OnCheckMenuItemCount() { return 0; }
-
- virtual void SetMenu(Menu *menu);
- virtual void HideMenu(void);
- virtual void DrawFocusBorder(int tx0, int ty0, int tx1, int ty1);
- MESSAGE_FUNC( OnMenuClose, "MenuClose" );
- MESSAGE_FUNC_PARAMS( OnKillFocus, "KillFocus", kv ); // called after the panel loses the keyboard focus
- virtual void DoClick();
- virtual void SetOpenOffsetY(int yOffset);
-
- virtual bool CanBeDefaultButton(void);
-
- // sets the direction in which the menu opens from the button, defaults to down
- virtual void SetOpenDirection(Menu::MenuDirection_e direction);
-
- virtual void OnKeyCodeTyped(KeyCode code);
- virtual void OnCursorEntered();
-
- virtual void Paint();
- virtual void PerformLayout();
- virtual void ApplySchemeSettings( IScheme *pScheme );
- virtual void OnCursorMoved( int x, int y );
-
- // This style is like the IE "back" button where the left side acts like a regular button, the the right side has a little
- // combo box dropdown indicator and presents and submenu
- void SetDropMenuButtonStyle( bool state );
- bool IsDropMenuButtonStyle() const;
-
- Menu *GetMenu();
-
-private:
-
- Menu *m_pMenu;
- Menu::MenuDirection_e m_iDirection;
-
- int _openOffsetY; // vertical offset of menu from the menu button
-
- bool m_bDropMenuButtonStyle : 1;
- TextImage *m_pDropMenuImage;
- int m_nImageIndex;
-};
-
-}; // namespace vgui
-
-#endif // MENUBUTTON_H
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef MENUBUTTON_H +#define MENUBUTTON_H + +#ifdef _WIN32 +#pragma once +#endif + +#include <vgui_controls/Button.h> +#include "vgui_controls/Menu.h" + +namespace vgui +{ + +class Menu; +class TextImage; + +//----------------------------------------------------------------------------- +// Purpose: Button that displays a menu when pressed +//----------------------------------------------------------------------------- +class MenuButton : public Button +{ + DECLARE_CLASS_SIMPLE( MenuButton, Button ); + +public: + MenuButton(Panel *parent, const char *panelName, const char *text); + ~MenuButton(); + + // functions designed to be overriden + virtual void OnShowMenu(Menu *menu) {} + virtual void OnHideMenu(Menu *menu) {} + virtual int OnCheckMenuItemCount() { return 0; } + + virtual void SetMenu(Menu *menu); + virtual void HideMenu(void); + virtual void DrawFocusBorder(int tx0, int ty0, int tx1, int ty1); + MESSAGE_FUNC( OnMenuClose, "MenuClose" ); + MESSAGE_FUNC_PARAMS( OnKillFocus, "KillFocus", kv ); // called after the panel loses the keyboard focus + virtual void DoClick(); + virtual void SetOpenOffsetY(int yOffset); + + virtual bool CanBeDefaultButton(void); + + // sets the direction in which the menu opens from the button, defaults to down + virtual void SetOpenDirection(Menu::MenuDirection_e direction); + + virtual void OnKeyCodeTyped(KeyCode code); + virtual void OnCursorEntered(); + + virtual void Paint(); + virtual void PerformLayout(); + virtual void ApplySchemeSettings( IScheme *pScheme ); + virtual void OnCursorMoved( int x, int y ); + + // This style is like the IE "back" button where the left side acts like a regular button, the the right side has a little + // combo box dropdown indicator and presents and submenu + void SetDropMenuButtonStyle( bool state ); + bool IsDropMenuButtonStyle() const; + + Menu *GetMenu(); + +private: + + Menu *m_pMenu; + Menu::MenuDirection_e m_iDirection; + + int _openOffsetY; // vertical offset of menu from the menu button + + bool m_bDropMenuButtonStyle : 1; + TextImage *m_pDropMenuImage; + int m_nImageIndex; +}; + +}; // namespace vgui + +#endif // MENUBUTTON_H |