summaryrefslogtreecommitdiff
path: root/public/panorama/controls/slideshow.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/panorama/controls/slideshow.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'public/panorama/controls/slideshow.h')
-rw-r--r--public/panorama/controls/slideshow.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/public/panorama/controls/slideshow.h b/public/panorama/controls/slideshow.h
new file mode 100644
index 0000000..cfa14ec
--- /dev/null
+++ b/public/panorama/controls/slideshow.h
@@ -0,0 +1,114 @@
+//=========== Copyright Valve Corporation, All rights reserved. ===============//
+//
+// Purpose:
+//=============================================================================//
+
+#ifndef PANORAMA_SLIDESHOW_H
+#define PANORAMA_SLIDESHOW_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "panorama/controls/panel2d.h"
+#include "panorama/controls/mousescroll.h"
+
+namespace panorama
+{
+
+DECLARE_PANEL_EVENT1( SlideShowPanelChanged, int );
+DECLARE_PANEL_EVENT0( SlideShowOnLayoutInitialized );
+
+//-----------------------------------------------------------------------------
+// Purpose: Panel that shows a slideshow of panels
+//-----------------------------------------------------------------------------
+class CSlideShow : public CPanel2D
+{
+ DECLARE_PANEL2D( CSlideShow, CPanel2D );
+
+public:
+ CSlideShow( CPanel2D *pParent, const char *pchID );
+ virtual ~CSlideShow();
+
+ void AddPanel( CPanel2D *pPanel, bool bDontSetFocusBySideEffect );
+ void RemoveAndDeletePanel( CPanel2D *pPanel );
+ void SetManageFocus( bool bManageFocus ) { m_bManageFocus = bManageFocus; }
+
+ void SetFocusIndex( int iFocus, bool bSkipChildCountCheck = false );
+ int GetFocusIndex() { return m_iFocusChild; }
+ CPanel2D *GetFocusChild() { return GetChild(m_iFocusChild); }
+ bool BFocusChildRightMost() { return (m_iFocusChild == (GetChildCount() - 1)); }
+
+ virtual bool OnMoveRight( int nRepeats );
+ virtual bool OnMoveLeft( int nRepeats );
+ virtual bool OnTabForward( int nRepeats );
+ virtual bool OnTabBackward( int nRepeats );
+
+ virtual void Paint();
+ virtual void OnLayoutTraverse( float flFinalWidth, float flFinalHeight );
+
+ virtual bool OnSetFocusToNextPanel( int nRepeats, EFocusMoveDirection moveType, bool bAllowWrap, float flTabIndexCurrent, float flXPosCurrent, float flYPosCurrent, float flXStart, float fYStart ) OVERRIDE
+ {
+ switch( moveType )
+ {
+ case k_ENextInTabOrder:
+ if ( m_bManageFocus && OnTabForward( nRepeats ) )
+ return true;
+ break;
+ case k_ENextByXPosition:
+ if ( m_bManageFocus && OnMoveRight( nRepeats ) )
+ return true;
+ break;
+ case k_EPrevInTabOrder:
+ if ( m_bManageFocus && OnTabBackward( nRepeats ) )
+ return true;
+ break;
+ case k_EPrevByXPosition:
+ if ( m_bManageFocus && OnMoveLeft( nRepeats ) )
+ return true;
+ break;
+ case k_ENextByYPosition:
+ if ( m_bManageFocus && OnMoveDown( nRepeats ) )
+ return true;
+ break;
+ case k_EPrevByYPosition:
+ if ( m_bManageFocus && OnMoveUp( nRepeats ) )
+ return true;
+ break;
+ default:
+ break;
+ }
+
+ return false;
+ }
+
+ virtual panorama::IUIPanel *OnGetDefaultInputFocus() OVERRIDE;
+
+
+#ifdef DBGFLAG_VALIDATE
+ virtual void ValidateClientPanel( CValidator &validator, const tchar *pchName ) OVERRIDE;
+#endif
+
+protected:
+ bool EventInputFocusSet( const panorama::CPanelPtr< panorama::IUIPanel > &ptrPanel );
+ bool EventCarouselMouseScroll( const CPanelPtr< IUIPanel > &ptrPanel, int cRepeat );
+ bool EventSlideShowOnLayoutInitialized( const CPanelPtr< IUIPanel > &ptrPanel );
+ virtual void OnInitializedFromLayout();
+ void SetPanelStyles( int iOldFocus, int iNewFocus );
+ void LayoutMouseScrollRegions( float flFinalWidth, float flFinalHeight );
+
+private:
+ virtual void AddDisabledFlagToChildren() OVERRIDE;
+ virtual void RemoveDisabledFlagFromChildren() OVERRIDE;
+ void SetIndividualPanelStyle( int iChild, int iOldFocus, int iNewFocus );
+ void SetMouseScrollVisibility( int iFocus );
+
+ int m_iFocusChild;
+ bool m_bManageFocus;
+ CMouseScrollRegion *m_pLeftMouseScrollRegion;
+ CMouseScrollRegion *m_pRightMouseScrollRegion;
+};
+
+} // namespace panorama
+
+#endif // PANORAMA_SLIDESHOW_H