Commit 2f9c3864 authored by cutealien's avatar cutealien

Add setTabMaxWidth to tabcontrol (backport from 1.6)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2651 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 63613912
......@@ -86,6 +86,12 @@ namespace gui
/** return Returns the height of the tabs */
virtual s32 getTabHeight() const = 0;
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
virtual void setTabMaxWidth(s32 width ) = 0;
//! get the maximal width of a tab
virtual s32 getTabMaxWidth() const = 0;
//! Set the alignment of the tabs
/** Use EGUIA_UPPERLEFT or EGUIA_LOWERRIGHT */
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) = 0;
......
......@@ -171,7 +171,6 @@ CGUITabControl::CGUITabControl(IGUIEnvironment* environment,
sprites = skin->getSpriteBank();
color = skin->getColor(EGDC_WINDOW_SYMBOL);
TabHeight = skin->getSize(gui::EGDS_BUTTON_HEIGHT) + 2;
TabMaxWidth = 3 * TabHeight;
}
UpButton = Environment->addButton(core::rect<s32>(0,0,10,10), this);
......@@ -699,6 +698,18 @@ s32 CGUITabControl::getTabHeight() const
return TabHeight;
}
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
void CGUITabControl::setTabMaxWidth(s32 width )
{
TabMaxWidth = width;
}
//! get the maximal width of a tab
s32 CGUITabControl::getTabMaxWidth() const
{
return TabMaxWidth;
}
//! Set the extra width added to tabs on each side of the text
void CGUITabControl::setTabExtraWidth( s32 extraWidth )
......
......@@ -125,9 +125,16 @@ namespace gui
//! Reads attributes of the element
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
//! Get the height of the tabs
virtual s32 getTabHeight() const;
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
virtual void setTabMaxWidth(s32 width );
//! get the maximal width of a tab
virtual s32 getTabMaxWidth() const;
//! Set the alignment of the tabs
//! note: EGUIA_CENTER is not an option
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment