aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/vgui_controls
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/public/vgui_controls')
-rw-r--r--mp/src/public/vgui_controls/AnimationController.h7
-rw-r--r--mp/src/public/vgui_controls/ComboBox.h2
-rw-r--r--mp/src/public/vgui_controls/HTML.h19
-rw-r--r--mp/src/public/vgui_controls/Menu.h25
-rw-r--r--mp/src/public/vgui_controls/Panel.h11
-rw-r--r--mp/src/public/vgui_controls/SectionedListPanel.h2
-rw-r--r--mp/src/public/vgui_controls/TextImage.h3
7 files changed, 50 insertions, 19 deletions
diff --git a/mp/src/public/vgui_controls/AnimationController.h b/mp/src/public/vgui_controls/AnimationController.h
index e418f329..93ae7096 100644
--- a/mp/src/public/vgui_controls/AnimationController.h
+++ b/mp/src/public/vgui_controls/AnimationController.h
@@ -52,6 +52,9 @@ public:
bool StartAnimationSequence(const char *sequenceName);
bool StartAnimationSequence(Panel *pWithinParent, const char *sequenceName);
+ bool StopAnimationSequence( Panel *pWithinParent, const char *sequenceName );
+ void CancelAnimationsForPanel( Panel *pWithinParent );
+
// gets the length of an animation sequence, in seconds
float GetAnimationSequenceLength(const char *sequenceName);
@@ -96,6 +99,9 @@ private:
CMD_SETFONT,
CMD_SETTEXTURE,
CMD_SETSTRING,
+ CMD_RUNEVENTCHILD,
+ CMD_FIRECOMMAND,
+ CMD_SETVISIBLE,
};
enum RelativeAlignment
@@ -223,6 +229,7 @@ private:
// variable names
UtlSymId_t m_sPosition, m_sSize, m_sFgColor, m_sBgColor;
UtlSymId_t m_sXPos, m_sYPos, m_sWide, m_sTall;
+ UtlSymId_t m_sModelPos;
// file name
CUtlVector<UtlSymId_t> m_ScriptFileNames;
diff --git a/mp/src/public/vgui_controls/ComboBox.h b/mp/src/public/vgui_controls/ComboBox.h
index c5c3eba0..266f4dc2 100644
--- a/mp/src/public/vgui_controls/ComboBox.h
+++ b/mp/src/public/vgui_controls/ComboBox.h
@@ -63,7 +63,7 @@ public:
virtual int AddItem(const char *itemText, const KeyValues *userData);
virtual int AddItem(const wchar_t *itemText, const KeyValues *userData);
- virtual int GetItemCount();
+ virtual int GetItemCount() const;
int GetItemIDFromRow( int row );
// update the item
diff --git a/mp/src/public/vgui_controls/HTML.h b/mp/src/public/vgui_controls/HTML.h
index 59e76770..ad786d20 100644
--- a/mp/src/public/vgui_controls/HTML.h
+++ b/mp/src/public/vgui_controls/HTML.h
@@ -24,7 +24,6 @@
#endif
#include "steam/steam_api.h"
-class HTMLComboBoxHost;
namespace vgui
{
@@ -80,7 +79,7 @@ public:
// overridden to paint our special web browser texture
virtual void Paint();
-
+
// pass messages to the texture component to tell it about resizes
virtual void OnSizeChanged(int wide,int tall);
@@ -124,7 +123,7 @@ public:
void AddHeader( const char *pchHeader, const char *pchValue );
void OnKillFocus();
void OnSetFocus();
-
+
void Find( const char *pchSubStr );
void StopFind();
void FindNext();
@@ -147,7 +146,6 @@ public:
}
#endif // DBGFLAG_VALIDATE
- void PaintComboBox();
ISteamHTMLSurface *SteamHTMLSurface() { return m_SteamAPIContext.SteamHTMLSurface(); }
void OnHTMLMouseMoved( int x, int y )
@@ -159,20 +157,13 @@ public:
protected:
virtual void ApplySchemeSettings( IScheme *pScheme );
- friend class HTMLComboBoxHost;
vgui::Menu *m_pContextMenu;
-
private:
STEAM_CALLBACK( HTML, BrowserNeedsPaint, HTML_NeedsPaint_t, m_NeedsPaint );
- STEAM_CALLBACK( HTML, BrowserComboNeedsPaint, HTML_ComboNeedsPaint_t, m_ComboNeedsPaint );
STEAM_CALLBACK( HTML, BrowserStartRequest, HTML_StartRequest_t, m_StartRequest );
STEAM_CALLBACK( HTML, BrowserURLChanged, HTML_URLChanged_t, m_URLChanged );
STEAM_CALLBACK( HTML, BrowserFinishedRequest, HTML_FinishedRequest_t, m_FinishedRequest );
- STEAM_CALLBACK( HTML, BrowserShowPopup, HTML_ShowPopup_t, m_ShowPopup );
- STEAM_CALLBACK( HTML, BrowserHidePopup, HTML_HidePopup_t, m_HidePopup );
- STEAM_CALLBACK( HTML, BrowserSizePopup, HTML_SizePopup_t, m_SizePopup );
-
STEAM_CALLBACK( HTML, BrowserOpenNewTab, HTML_OpenLinkInNewTab_t, m_LinkInNewTab );
STEAM_CALLBACK( HTML, BrowserSetHTMLTitle, HTML_ChangedTitle_t, m_ChangeTitle );
STEAM_CALLBACK( HTML, BrowserPopupHTMLWindow, HTML_NewWindow_t, m_NewWindow );
@@ -227,7 +218,6 @@ private:
};
CHTMLFindBar *m_pFindBar;
- HTMLComboBoxHost *m_pComboBoxHost;
int m_iMouseX,m_iMouseY; // where the mouse is on the control
@@ -255,10 +245,7 @@ private:
// when the size has changed and reallocate the texture.
int m_allocedTextureWidth;
int m_allocedTextureHeight;
- int m_iComboBoxTextureID; // vgui texture id of the combo box
- bool m_bNeedsFullTextureUpload;
- int m_allocedComboBoxWidth;
- int m_allocedComboBoxHeight;
+ bool m_bNeedsFullTextureUpload;
CUtlString m_sCurrentURL; // the url of our current page
// find in page state
bool m_bInFind;
diff --git a/mp/src/public/vgui_controls/Menu.h b/mp/src/public/vgui_controls/Menu.h
index 2b374373..77937335 100644
--- a/mp/src/public/vgui_controls/Menu.h
+++ b/mp/src/public/vgui_controls/Menu.h
@@ -216,7 +216,7 @@ public:
virtual int GetActiveItem(); // returns the itemID (not the row) of the active item
// Return the number of items currently in the menu list
- virtual int GetItemCount();
+ virtual int GetItemCount() const;
// return the menuID of the n'th item in the menu list, valid from [0, GetItemCount)
virtual int GetMenuID(int index);
@@ -351,6 +351,29 @@ private:
double m_fLastTypeAheadTime;
};
+
+//-----------------------------------------------------------------------------
+// Helper class to create menu
+//-----------------------------------------------------------------------------
+class MenuBuilder
+{
+public:
+
+ MenuBuilder( Menu *pMenu, Panel *pActionTarget );
+
+ MenuItem* AddMenuItem( const char *pszButtonText, const char *pszCommand, const char *pszCategoryName );
+
+ MenuItem* AddCascadingMenuItem( const char *pszButtonText, Menu *pSubMenu, const char *pszCategoryName );
+
+private:
+
+ void AddSepratorIfNeeded( const char *pszCategoryName );
+
+ Menu *m_pMenu;
+ Panel *m_pActionTarget;
+ const char *m_pszLastCategory;
+};
+
} // namespace vgui
#endif // MENU_H
diff --git a/mp/src/public/vgui_controls/Panel.h b/mp/src/public/vgui_controls/Panel.h
index 07b63d8d..174dea42 100644
--- a/mp/src/public/vgui_controls/Panel.h
+++ b/mp/src/public/vgui_controls/Panel.h
@@ -180,6 +180,8 @@ public:
// all units are in pixels
void SetPos(int x,int y); // sets position of panel, in local space (ie. relative to parent's position)
void GetPos(int &x,int &y); // gets local position of panel
+ int GetXPos();
+ int GetYPos();
void SetSize(int wide,int tall); // sets size of panel
void GetSize(int &wide, int &tall); // gets size of panel
void SetBounds(int x, int y, int wide, int tall); // combination of SetPos/SetSize
@@ -232,7 +234,7 @@ public:
Panel *FindSiblingByName(const char *siblingName);
void CallParentFunction(KeyValues *message);
- template <class T>
+ template < class T >
T *FindControl( const char *pszName, bool recurseDown = false ) { return dynamic_cast<T *>( FindChildByName( pszName, recurseDown ) ); }
virtual void SetAutoDelete(bool state); // if set to true, panel automatically frees itself when parent is deleted
@@ -274,6 +276,8 @@ public:
PIN_CENTER_RIGHT,
PIN_CENTER_BOTTOM,
PIN_CENTER_LEFT,
+
+ PIN_LAST
};
// specifies the auto-resize directions for the panel
@@ -398,6 +402,7 @@ public:
virtual void OnMousePressed(MouseCode code);
virtual void OnMouseDoublePressed(MouseCode code);
virtual void OnMouseReleased(MouseCode code);
+ virtual void OnMouseMismatchedRelease( MouseCode code, Panel* pPressedPanel );
virtual void OnMouseWheeled(int delta);
// Trip pressing (e.g., select all text in a TextEntry) requires this to be enabled
@@ -667,6 +672,8 @@ protected:
virtual void PaintTraverse(bool Repaint, bool allowForce = true);
protected:
+ virtual void OnChildSettingsApplied( KeyValues *pInResourceData, Panel *pChild );
+
MESSAGE_FUNC_ENUM_ENUM( OnRequestFocus, "OnRequestFocus", VPANEL, subFocus, VPANEL, defaultPanel);
MESSAGE_FUNC_INT_INT( OnScreenSizeChanged, "OnScreenSizeChanged", oldwide, oldtall );
virtual void *QueryInterface(EInterfaceID id);
@@ -913,6 +920,8 @@ private:
bool m_bForceStereoRenderToFrameBuffer;
+ static Panel* m_sMousePressedPanels[ ( MOUSE_MIDDLE - MOUSE_LEFT ) + 1 ];
+
CPanelAnimationVar( float, m_flAlpha, "alpha", "255" );
// 1 == Textured (TextureId1 only)
diff --git a/mp/src/public/vgui_controls/SectionedListPanel.h b/mp/src/public/vgui_controls/SectionedListPanel.h
index c38f6c74..6fafedd3 100644
--- a/mp/src/public/vgui_controls/SectionedListPanel.h
+++ b/mp/src/public/vgui_controls/SectionedListPanel.h
@@ -210,6 +210,8 @@ public:
void MoveSelectionDown( void );
void MoveSelectionUp( void );
+ ScrollBar *GetScrollBar( void ) { return m_pScrollBar; }
+
protected:
virtual void PerformLayout();
virtual void ApplySchemeSettings(IScheme *pScheme);
diff --git a/mp/src/public/vgui_controls/TextImage.h b/mp/src/public/vgui_controls/TextImage.h
index 499785ff..20446e7b 100644
--- a/mp/src/public/vgui_controls/TextImage.h
+++ b/mp/src/public/vgui_controls/TextImage.h
@@ -105,6 +105,9 @@ public:
void SetColorChangeStream( CUtlSortVector<label_colorchange_t,CColorChangeListLess> *pUtlVecStream );
void ClearColorChangeStream( void ) { m_ColorChangeStream.Purge(); }
+ const wchar_t *GetEllipsesPosition( void ) const { return m_pwszEllipsesPosition; }
+ bool IsWrapping() const { return m_LineBreaks.Count() != 0; }
+
protected:
// truncate the _text string to fit into the draw width
void SizeText(wchar_t *tempText, int stringLength);