2009-01-27 05:23:36 -08:00
|
|
|
// Copyright (C) 2002-2009 Nikolaus Gebhardt
|
2007-05-20 11:03:49 -07:00
|
|
|
// This file is part of the "Irrlicht Engine".
|
|
|
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
|
|
|
|
|
|
|
#ifndef __I_GUI_TAB_CONTROL_H_INCLUDED__
|
|
|
|
#define __I_GUI_TAB_CONTROL_H_INCLUDED__
|
|
|
|
|
|
|
|
#include "IGUIElement.h"
|
|
|
|
#include "SColor.h"
|
2007-12-21 23:49:29 -08:00
|
|
|
#include "IGUISkin.h"
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
namespace irr
|
|
|
|
{
|
|
|
|
namespace gui
|
|
|
|
{
|
|
|
|
//! A tab, onto which other gui elements could be added.
|
|
|
|
class IGUITab : public IGUIElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
|
|
|
|
: IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
|
|
|
|
|
|
|
|
//! Returns number of tab if in tabcontrol.
|
|
|
|
/** Can be accessed later IGUITabControl::getTab() by this number. */
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual s32 getNumber() const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! sets if the tab should draw its background
|
|
|
|
virtual void setDrawBackground(bool draw=true) = 0;
|
|
|
|
|
|
|
|
//! sets the color of the background, if it should be drawn.
|
|
|
|
virtual void setBackgroundColor(video::SColor c) = 0;
|
2007-05-26 13:44:25 -07:00
|
|
|
|
|
|
|
//! returns true if the tab is drawing its background, false if not
|
|
|
|
virtual bool isDrawingBackground() const = 0;
|
|
|
|
|
|
|
|
//! returns the color of the background
|
|
|
|
virtual video::SColor getBackgroundColor() const = 0;
|
2007-12-21 23:49:29 -08:00
|
|
|
|
|
|
|
//! sets the color of the text
|
|
|
|
virtual void setTextColor(video::SColor c) = 0;
|
|
|
|
|
|
|
|
//! gets the color of the text
|
|
|
|
virtual video::SColor getTextColor() const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
//! A standard tab control
|
|
|
|
class IGUITabControl : public IGUIElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
//! constructor
|
|
|
|
IGUITabControl(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
|
|
|
|
: IGUIElement(EGUIET_TAB_CONTROL, environment, parent, id, rectangle) {}
|
|
|
|
|
|
|
|
//! Adds a tab
|
|
|
|
virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) = 0;
|
|
|
|
|
|
|
|
//! Returns amount of tabs in the tabcontrol
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual s32 getTabCount() const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Returns a tab based on zero based index
|
|
|
|
/** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
|
|
|
|
\return Returns pointer to the Tab. Returns 0 if no tab
|
2008-05-22 04:51:37 -07:00
|
|
|
is corresponding to this tab. */
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual IGUITab* getTab(s32 idx) const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
|
|
|
|
//! Brings a tab to front.
|
|
|
|
/** \param idx: number of the tab.
|
2008-05-22 04:51:37 -07:00
|
|
|
\return Returns true if successful. */
|
2007-05-20 11:03:49 -07:00
|
|
|
virtual bool setActiveTab(s32 idx) = 0;
|
|
|
|
|
|
|
|
//! Brings a tab to front.
|
|
|
|
/** \param tab: pointer to the tab.
|
2008-05-22 04:51:37 -07:00
|
|
|
\return Returns true if successful. */
|
2007-05-20 11:03:49 -07:00
|
|
|
virtual bool setActiveTab(IGUIElement *tab) = 0;
|
|
|
|
|
|
|
|
//! Returns which tab is currently active
|
2007-09-15 17:18:13 -07:00
|
|
|
virtual s32 getActiveTab() const = 0;
|
2007-12-21 23:49:29 -08:00
|
|
|
|
|
|
|
//! Set the height of the tabs
|
|
|
|
virtual void setTabHeight( s32 height ) = 0;
|
|
|
|
|
|
|
|
//! Get the height of the tabs
|
|
|
|
/** return Returns the height of the tabs */
|
|
|
|
virtual s32 getTabHeight() const = 0;
|
|
|
|
|
|
|
|
//! Set the alignment of the tabs
|
2009-01-27 05:23:36 -08:00
|
|
|
/** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
|
2007-12-21 23:49:29 -08:00
|
|
|
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
|
|
|
|
|
|
|
|
//! Get the alignment of the tabs
|
|
|
|
/** return Returns the alignment of the tabs */
|
|
|
|
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const = 0;
|
|
|
|
|
|
|
|
//! Set the extra width added to tabs on each side of the text
|
|
|
|
virtual void setTabExtraWidth( s32 extraWidth ) = 0;
|
|
|
|
|
|
|
|
//! Get the extra width added to tabs on each side of the text
|
|
|
|
/** return Returns the extra width of the tabs */
|
|
|
|
virtual s32 getTabExtraWidth() const = 0;
|
2007-05-20 11:03:49 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // end namespace gui
|
|
|
|
} // end namespace irr
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|