Commit acff12d1 authored by cutealien's avatar cutealien

Can now enable/disable backround drawing for IGUITable and IGUIProfiler.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4968 dfc29bdd-3216-0410-991c-e03cc46cb475
parent c45988b8
--------------------------
Changes in 1.9 (not yet released)
- Can now enable/disable backround drawing for IGUITable.
- Bugfix: Cloning CBillboardSceneNode now copies colors and sizes.
- EditBox works now with numpad on X11
- Added helper functions for converting between wchar and utf-8. Patch provided by Hendu.
......
......@@ -340,6 +340,7 @@ int main()
IGUIProfiler is can be used to show active profiling data at runtime.
*/
receiver.GuiProfiler = env->addProfilerDisplay(core::recti(40, 140, 600, 470));
receiver.GuiProfiler->setDrawBackground(true);
/*
Get a monospaced font - it's nicer when working with rows of numbers.
......
......@@ -53,6 +53,13 @@ namespace gui
/** Currently this is the override font when one is set and the
font of the active skin otherwise */
virtual IGUIFont* getActiveFont() const = 0;
//! Sets whether to draw the background. By default disabled,
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
};
} // end namespace gui
......
......@@ -218,6 +218,13 @@ namespace gui
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
//! Sets whether to draw the background.
virtual void setDrawBackground(bool draw) = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
};
......
......@@ -19,6 +19,7 @@ namespace gui
CGUIProfiler::CGUIProfiler(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIProfiler(environment, parent, id, rectangle)
, DisplayTable(0), CurrentGroupIdx(0), CurrentGroupPage(0), NumGroupPages(1), IgnoreUncalled(false)
, DrawBackground(false)
{
Profiler = &getProfiler();
......@@ -26,7 +27,7 @@ CGUIProfiler::CGUIProfiler(IGUIEnvironment* environment, IGUIElement* parent, s3
// Really just too lazy to code a complete new element for this.
// If anyone can do this nicer he's welcome.
DisplayTable = Environment->addTable(r, this, -1, true);
DisplayTable = Environment->addTable(r, this, -1, DrawBackground);
DisplayTable->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT);
DisplayTable->setSubElement(true);
rebuildColumns();
......@@ -257,6 +258,20 @@ IGUIFont* CGUIProfiler::getActiveFont() const
return 0;
}
//! Sets whether to draw the background. By default disabled,
void CGUIProfiler::setDrawBackground(bool draw)
{
DrawBackground = draw;
if ( DisplayTable )
DisplayTable->setDrawBackground(draw);
}
//! Checks if background drawing is enabled
bool CGUIProfiler::isDrawBackgroundEnabled() const
{
return DrawBackground;
}
} // end namespace gui
} // end namespace irr
......
......@@ -52,6 +52,13 @@ namespace gui
//! Get the font which is used right now for drawing
virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_;
//! Sets whether to draw the background. By default disabled,
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_;
virtual IGUIElement* getElementFromPoint(const core::position2d<s32>& point) _IRR_OVERRIDE_
{
// This element should never get focus from mouse-clicks
......@@ -72,6 +79,7 @@ namespace gui
irr::s32 CurrentGroupPage;
irr::s32 NumGroupPages;
bool IgnoreUncalled;
bool DrawBackground;
};
} // end namespace gui
......
......@@ -1117,6 +1117,19 @@ IGUIScrollBar* CGUITable::getHorizontalScrollBar() const
return HorizontalScrollBar;
}
//! Sets whether to draw the background.
void CGUITable::setDrawBackground(bool draw)
{
DrawBack = draw;
}
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
bool CGUITable::isDrawBackgroundEnabled() const
{
return DrawBack;
}
//! Writes attributes of the element.
void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{
......
......@@ -34,7 +34,7 @@ namespace gui
~CGUITable();
//! Adds a column
//! If columnIndex is outside the current range, do push new colum at the end
//! If columnIndex is outside the current range, do push new column at the end
virtual void addColumn(const wchar_t* caption, s32 columnIndex=-1) _IRR_OVERRIDE_;
//! remove a column from the table
......@@ -63,7 +63,7 @@ namespace gui
//! columns can be resized by drag 'n drop
virtual void setResizableColumns(bool resizable) _IRR_OVERRIDE_;
//! can columns be resized by dran 'n drop?
//! can columns be resized by drag 'n drop?
virtual bool hasResizableColumns() const _IRR_OVERRIDE_;
//! This tells the table control which ordering mode should be used when
......@@ -76,10 +76,10 @@ namespace gui
//! Returns which row is currently selected
virtual s32 getSelected() const _IRR_OVERRIDE_;
//! set wich row is currently selected
//! set currently selected row
virtual void setSelected( s32 index ) _IRR_OVERRIDE_;
//! Returns amount of rows in the tabcontrol
//! Returns amount of rows in the tab control
virtual s32 getRowCount() const _IRR_OVERRIDE_;
//! adds a row to the table
......@@ -161,6 +161,13 @@ namespace gui
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const _IRR_OVERRIDE_;
//! Sets whether to draw the background.
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_;
//! Writes attributes of the object.
//! Implement this to expose the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml serialization purposes.
......
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