PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLGui::TabBarEntry Class Reference

Tab bar entry. More...

#include <TabBarEntry.h>

Inheritance diagram for PLGui::TabBarEntry:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLGUI_API TabBarEntry (Widget *pParent=nullptr)
 Constructor.
virtual PLGUI_API ~TabBarEntry ()
 Destructor.
PLGUI_API TabBarGetTabBar () const
 Get TabBar.
PLGUI_API PLCore::String GetText () const
 Get text.
PLGUI_API void SetText (const PLCore::String &sText)
 Set text.
PLGUI_API const ImageGetIcon () const
 Get icon.
PLGUI_API void SetIcon (const Image &cIcon)
 Set icon.
PLGUI_API WidgetGetWidget () const
 Get associated widget.
PLGUI_API void SetWidget (Widget *pWidget)
 Set associated widget.
PLGUI_API void * GetUserData () const
 Get associated data.
PLGUI_API void SetUserData (void *pData)
 Set associated data.
PLGUI_API int GetIndex () const
 Get tab index.
PLGUI_API bool IsClosable () const
 Check if tab can be closed by the user.

Protected Member Functions

PLGUI_API void SetTabBar (TabBar *pTabBar)
 Set TabBar.
PLGUI_API void SetIndex (int nIndex)
 Set tab index.
PLGUI_API void SetClosable (bool bClosable)
 Set if tab can be closed by the user.
virtual PLGUI_API PLMath::Vector2i OnPreferredSize (const PLMath::Vector2i &vRefSize) const
 Called when the widget is to calculate it's preferred size.
virtual PLGUI_API void OnAdjustContent ()
 Called when the widget content has to be adjusted.
virtual PLGUI_API void OnMouseEnter ()
 Called when the mouse has entered the widget.
virtual PLGUI_API void OnMouseLeave ()
 Called when the mouse has left the widget.
virtual PLGUI_API void OnMouseButtonClick (PLCore::uint32 nButton, const PLMath::Vector2i &vPos)
 Called when a mouse button is clicked.

Protected Attributes

PLCore::String m_sText
Image m_cIcon
Widgetm_pWidget
void * m_pData
TabBarm_pTabBar
int m_nIndex
bool m_bClosable
TabBarButtonm_pButtonClose

Detailed Description

Tab bar entry.


Constructor & Destructor Documentation

PLGUI_API PLGui::TabBarEntry::TabBarEntry ( Widget pParent = nullptr)

Constructor.

Parameters:
[in]pParentPointer to parent widget
virtual PLGUI_API PLGui::TabBarEntry::~TabBarEntry ( ) [virtual]

Destructor.


Member Function Documentation

PLGUI_API TabBar* PLGui::TabBarEntry::GetTabBar ( ) const

Get TabBar.

Returns:
TabBar

Get text.

Returns:
Text
PLGUI_API void PLGui::TabBarEntry::SetText ( const PLCore::String sText)

Set text.

Parameters:
[in]sTextText
PLGUI_API const Image& PLGui::TabBarEntry::GetIcon ( ) const

Get icon.

Returns:
Image

Reimplemented from PLGui::Widget.

PLGUI_API void PLGui::TabBarEntry::SetIcon ( const Image cIcon)

Set icon.

Parameters:
[in]cIconImage

Reimplemented from PLGui::Widget.

PLGUI_API Widget* PLGui::TabBarEntry::GetWidget ( ) const

Get associated widget.

Returns:
Widget (can be a null pointer)
Remarks:
see SetWidget()
PLGUI_API void PLGui::TabBarEntry::SetWidget ( Widget pWidget)

Set associated widget.

Parameters:
[in]pWidgetWidget (can be a null pointer)
Remarks:
You can use this function to associate a widget with a tab entry. Note however that this is only a pure data slot and is not used by the TabBar at all, so the TabBar doesn't automatically show or hide widgets based on the currently selected tab. If you want functionality like that, you can use TabContainer which has implemented that already and provides a window container with an associated TabBar to select windows.
PLGUI_API void* PLGui::TabBarEntry::GetUserData ( ) const

Get associated data.

Returns:
Data pointer
Remarks:
see SetData()

Reimplemented from PLGui::Widget.

PLGUI_API void PLGui::TabBarEntry::SetUserData ( void *  pData)

Set associated data.

Parameters:
[in]pDataData pointer
Remarks:
You can use this function to associate arbitrary data with a tab entry. This is a pure user data that is not used by the TabBar itself.

Reimplemented from PLGui::Widget.

PLGUI_API int PLGui::TabBarEntry::GetIndex ( ) const

Get tab index.

Returns:
Index of tab
PLGUI_API bool PLGui::TabBarEntry::IsClosable ( ) const

Check if tab can be closed by the user.

Returns:
'true' if tab is closable, else 'false'
PLGUI_API void PLGui::TabBarEntry::SetTabBar ( TabBar pTabBar) [protected]

Set TabBar.

Parameters:
[in]pTabBarTabBar
PLGUI_API void PLGui::TabBarEntry::SetIndex ( int  nIndex) [protected]

Set tab index.

Parameters:
[in]nIndexIndex of tab
PLGUI_API void PLGui::TabBarEntry::SetClosable ( bool  bClosable) [protected]

Set if tab can be closed by the user.

Parameters:
[in]bClosable'true' if tab is closable, else 'false'
virtual PLGUI_API PLMath::Vector2i PLGui::TabBarEntry::OnPreferredSize ( const PLMath::Vector2i vRefSize) const [protected, virtual]

Called when the widget is to calculate it's preferred size.

Parameters:
[in]vRefSizePrecalculated reference size, can be (-1, -1) if no reference size is available
Returns:
Preferred size
Remarks:
If the widget returns -1 in a component (X/Y), it means that there is no preferred size in that direction. A layout will in that case use 'as much space as possible', while the FitSize() functions will use the current size.

Reimplemented from PLGui::Widget.

virtual PLGUI_API void PLGui::TabBarEntry::OnAdjustContent ( ) [protected, virtual]

Called when the widget content has to be adjusted.

Reimplemented from PLGui::Widget.

virtual PLGUI_API void PLGui::TabBarEntry::OnMouseEnter ( ) [protected, virtual]

Called when the mouse has entered the widget.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::TabBarEntry::OnMouseLeave ( ) [protected, virtual]

Called when the mouse has left the widget.

Reimplemented from PLGui::WidgetFunctions.

virtual PLGUI_API void PLGui::TabBarEntry::OnMouseButtonClick ( PLCore::uint32  nButton,
const PLMath::Vector2i vPos 
) [protected, virtual]

Called when a mouse button is clicked.

Parameters:
[in]nButtonMouse button that is clicked
[in]vPosMouse position within the widget

Reimplemented from PLGui::WidgetFunctions.


Member Data Documentation

Text displayed in tab

Tab icon

Reimplemented from PLGui::Widget.

Widget associated with the tab (data only!)

void* PLGui::TabBarEntry::m_pData [protected]

User data

TabBar to which the entry belongs

Tab index

Can the tab be closed by the user?

Button to close the tab


The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:32
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported