Commit bb890274 authored by cutealien's avatar cutealien

- Add interface for easier access to scrollbars for IGUIListBox, IGUITreeView and IGUITable

- Add IGUITable::getItemHeight


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4813 dfc29bdd-3216-0410-991c-e03cc46cb475
parent bf42d8d6
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- Add interface for easier access to scrollbars for IGUIListBox, IGUITreeView and IGUITable
- Fix serializing colors as strings. Was previously mixing up strings with number-arrays and hex color values. Now using hex color values always, but also fixed the the handling when it get's number-array strings. - Fix serializing colors as strings. Was previously mixing up strings with number-arrays and hex color values. Now using hex color values always, but also fixed the the handling when it get's number-array strings.
- Fix IAttributes::setAttribute implementation for textures (did do nothing before). - Fix IAttributes::setAttribute implementation for textures (did do nothing before).
- Added support for separate blending in OpenGL and D3D9 drivers. - Added support for separate blending in OpenGL and D3D9 drivers.
...@@ -8,6 +9,7 @@ Changes in 1.9 (not yet released) ...@@ -8,6 +9,7 @@ Changes in 1.9 (not yet released)
- Added BlendFactor field to SMaterial which allow user to set blending factor per SMaterial set call without use EMT_ONETEXTURE_BLEND type. - Added BlendFactor field to SMaterial which allow user to set blending factor per SMaterial set call without use EMT_ONETEXTURE_BLEND type.
- Fixed issue with blending operation set to EBO_NONE and some transparent material types. - Fixed issue with blending operation set to EBO_NONE and some transparent material types.
- Add a code profiler (stop-watch style) - Add a code profiler (stop-watch style)
- Add IGUITable::getItemHeight to access item (row) height
- Add override font to IGUITable - Add override font to IGUITable
- IGUITable can now disable the active column. - IGUITable can now disable the active column.
- IGUIElement::getElementFromPoint now virtual - IGUIElement::getElementFromPoint now virtual
......
...@@ -13,6 +13,7 @@ namespace irr ...@@ -13,6 +13,7 @@ namespace irr
namespace gui namespace gui
{ {
class IGUISpriteBank; class IGUISpriteBank;
class IGUIScrollBar;
//! Enumeration for listbox colors //! Enumeration for listbox colors
enum EGUI_LISTBOX_COLOR enum EGUI_LISTBOX_COLOR
...@@ -128,6 +129,9 @@ namespace gui ...@@ -128,6 +129,9 @@ namespace gui
//! Sets whether to draw the background //! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0; virtual void setDrawBackground(bool draw) = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
}; };
......
...@@ -13,6 +13,7 @@ namespace irr ...@@ -13,6 +13,7 @@ namespace irr
namespace gui namespace gui
{ {
class IGUIFont; class IGUIFont;
class IGUIScrollBar;
//! modes for ordering used when a column header is clicked //! modes for ordering used when a column header is clicked
enum EGUI_COLUMN_ORDERING enum EGUI_COLUMN_ORDERING
...@@ -208,6 +209,15 @@ namespace gui ...@@ -208,6 +209,15 @@ namespace gui
/** Currently this is the override font when one is set and the /** Currently this is the override font when one is set and the
font of the active skin otherwise */ font of the active skin otherwise */
virtual IGUIFont* getActiveFont() const = 0; virtual IGUIFont* getActiveFont() const = 0;
//! Get the height of items/rows
virtual s32 getItemHeight() const = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
}; };
......
...@@ -15,6 +15,7 @@ namespace gui ...@@ -15,6 +15,7 @@ namespace gui
{ {
class IGUIFont; class IGUIFont;
class IGUITreeView; class IGUITreeView;
class IGUIScrollBar;
//! Node for gui tree view //! Node for gui tree view
...@@ -268,6 +269,12 @@ namespace gui ...@@ -268,6 +269,12 @@ namespace gui
//! Returns the node which is associated to the last event. //! Returns the node which is associated to the last event.
/** This pointer is only valid inside the OnEvent call! */ /** This pointer is only valid inside the OnEvent call! */
virtual IGUITreeViewNode* getLastEventNode() const = 0; virtual IGUITreeViewNode* getLastEventNode() const = 0;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
}; };
......
...@@ -906,6 +906,11 @@ void CGUIListBox::setDrawBackground(bool draw) ...@@ -906,6 +906,11 @@ void CGUIListBox::setDrawBackground(bool draw)
DrawBack = draw; DrawBack = draw;
} }
//! Access the vertical scrollbar
IGUIScrollBar* CGUIListBox::getVerticalScrollBar() const
{
return ScrollBar;
}
} // end namespace gui } // end namespace gui
} // end namespace irr } // end namespace irr
......
...@@ -131,6 +131,9 @@ namespace gui ...@@ -131,6 +131,9 @@ namespace gui
//! Sets whether to draw the background //! Sets whether to draw the background
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_; virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const _IRR_OVERRIDE_;
private: private:
struct ListItem struct ListItem
......
// This file is part of the "Irrlicht Engine". // This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h // For conditions of distribution and use, see copyright notice in irrlicht.h
// Written by Michael Zeilfelder // Written by Michael Zeilfelder
// TODO: We should have more pages for groups that don't fit into the display area.
// So additional to CurrentGroupIdx we would also have a current-page-for-current-group thing.
// The interface doesn't have to be changed for that - just the implementation.
#include "CGUIProfiler.h" #include "CGUIProfiler.h"
#ifdef _IRR_COMPILE_WITH_GUI_ #ifdef _IRR_COMPILE_WITH_GUI_
......
...@@ -1099,6 +1099,24 @@ IGUIFont* CGUITable::getActiveFont() const ...@@ -1099,6 +1099,24 @@ IGUIFont* CGUITable::getActiveFont() const
return 0; return 0;
} }
//! Get the height of items/rows
s32 CGUITable::getItemHeight() const
{
return ItemHeight;
}
//! Access the vertical scrollbar
IGUIScrollBar* CGUITable::getVerticalScrollBar() const
{
return VerticalScrollBar;
}
//! Access the horizontal scrollbar
IGUIScrollBar* CGUITable::getHorizontalScrollBar() const
{
return HorizontalScrollBar;
}
//! Writes attributes of the element. //! Writes attributes of the element.
void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const void CGUITable::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const
{ {
......
...@@ -152,6 +152,15 @@ namespace gui ...@@ -152,6 +152,15 @@ namespace gui
//! Get the font which is used right now for drawing //! Get the font which is used right now for drawing
virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_; virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_;
//! Get the height of items/rows
virtual s32 getItemHeight() const _IRR_OVERRIDE_;
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const _IRR_OVERRIDE_;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const _IRR_OVERRIDE_;
//! Writes attributes of the object. //! Writes attributes of the object.
//! Implement this to expose the attributes of your scene node animator for //! Implement this to expose the attributes of your scene node animator for
//! scripting languages, editors, debuggers or xml serialization purposes. //! scripting languages, editors, debuggers or xml serialization purposes.
......
...@@ -1081,6 +1081,18 @@ void CGUITreeView::setImageList( IGUIImageList* imageList ) ...@@ -1081,6 +1081,18 @@ void CGUITreeView::setImageList( IGUIImageList* imageList )
} }
} }
//! Access the vertical scrollbar
IGUIScrollBar* CGUITreeView::getVerticalScrollBar() const _IRR_OVERRIDE_
{
return ScrollBarV;
}
//! Access the horizontal scrollbar
IGUIScrollBar* CGUITreeView::getHorizontalScrollBar() const _IRR_OVERRIDE_
{
return ScrollBarH;
}
} // end namespace gui } // end namespace gui
} // end namespace irr } // end namespace irr
......
...@@ -297,6 +297,12 @@ namespace gui ...@@ -297,6 +297,12 @@ namespace gui
virtual IGUITreeViewNode* getLastEventNode() const _IRR_OVERRIDE_ virtual IGUITreeViewNode* getLastEventNode() const _IRR_OVERRIDE_
{ return LastEventNode; } { return LastEventNode; }
//! Access the vertical scrollbar
virtual IGUIScrollBar* getVerticalScrollBar() const _IRR_OVERRIDE_;
//! Access the horizontal scrollbar
virtual IGUIScrollBar* getHorizontalScrollBar() const _IRR_OVERRIDE_;
private: private:
//! calculates the heigth of an node and of all visible nodes. //! calculates the heigth of an node and of all visible nodes.
void recalculateItemHeight(); void recalculateItemHeight();
......
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