This repository has been archived on 2023-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
MyGameFramework/lib/gwen/controls/gwen_tabcontrol.h
Gered c5cdddbeaa initial commit
current versions of all of my basic framework sources, build configurations/scripts, and supporting assets
2013-01-31 12:53:05 -05:00

71 lines
1.5 KiB
C++

/*
GWEN
Copyright (c) 2010 Facepunch Studios
See license in Gwen.h
*/
#pragma once
#ifndef GWEN_CONTROLS_TABCONTROL_H
#define GWEN_CONTROLS_TABCONTROL_H
#include "gwen_base.h"
#include "gwen_button.h"
#include "gwen_tabbutton.h"
#include "gwen_tabstrip.h"
#include "gwen_tabtitlebar.h"
namespace Gwen
{
namespace ControlsInternal
{
class ScrollBarButton;
}
namespace Controls
{
class GWEN_EXPORT TabControl : public Base
{
GWEN_CONTROL( TabControl, Base );
virtual TabButton* AddPage( const TextObject strText, Controls::Base* pPage = NULL );
virtual void AddPage( TabButton* pButton );
virtual void RemovePage( TabButton* pButton );
virtual void OnTabPressed( Controls::Base* control );
virtual void OnLoseTab( TabButton* pButton );
virtual int TabCount( void );
virtual TabButton* GetTab( int iNum );
virtual TabButton* GetCurrentButton(){ return m_pCurrentButton; }
virtual TabStrip* GetTabStrip(){ return m_TabStrip; }
virtual void SetTabStripPosition( int iDock );
virtual bool DoesAllowDrag();
virtual void SetAllowReorder( bool b ){ GetTabStrip()->SetAllowReorder( b ); }
Gwen::Event::Caller onLoseTab;
Gwen::Event::Caller onAddTab;
private:
virtual void PostLayout( Skin::Base* skin );
void HandleOverflow();
void ScrollPressLeft( Base* pFrom );
void ScrollPressRight( Base* pFrom );
TabStrip* m_TabStrip;
TabButton* m_pCurrentButton;
ControlsInternal::ScrollBarButton* m_pScroll[2];
int m_iScrollOffset;
};
}
}
#endif