diff --git a/include/IGUIComboBox.h b/include/IGUIComboBox.h index 9680e915..08e48cde 100644 --- a/include/IGUIComboBox.h +++ b/include/IGUIComboBox.h @@ -26,19 +26,23 @@ namespace gui //! Returns amount of items in box virtual s32 getItemCount() = 0; - //! returns string of an item. the idx may be a value from 0 to itemCount-1 + //! Returns string of an item. the idx may be a value from 0 to itemCount-1 virtual const wchar_t* getItem(s32 idx) = 0; - //! adds an item and returns the index of it + //! Adds an item and returns the index of it virtual s32 addItem(const wchar_t* text) = 0; - //! deletes all items in the combo box + //! Removes an item from the combo box. + /** Warning. This will change the IDs of all following items */ + virtual void removeItem(s32 id) = 0; + + //! Deletes all items in the combo box virtual void clear() = 0; - //! returns id of selected item. returns -1 if no item is selected. + //! Returns id of selected item. returns -1 if no item is selected. virtual s32 getSelected() = 0; - //! sets the selected item. Set this to -1 if no item should be selected + //! Sets the selected item. Set this to -1 if no item should be selected virtual void setSelected(s32 id) = 0; }; diff --git a/include/IGUIContextMenu.h b/include/IGUIContextMenu.h index 69a5f6ff..5e84a0a6 100644 --- a/include/IGUIContextMenu.h +++ b/include/IGUIContextMenu.h @@ -69,6 +69,9 @@ namespace gui \param enabled: True if it is enabled, otherwise false. */ virtual void setItemChecked(s32 idx, bool enabled) = 0; + //! Check if a menu item is checked + /** \param idx: Zero based index of the menu item */ + virtual bool isItemChecked(s32 idx) = 0; //! Removes a menu item /** \param idx: Zero based index of the menu item */ diff --git a/include/IGUIEditBox.h b/include/IGUIEditBox.h index a2056391..a4764940 100644 --- a/include/IGUIEditBox.h +++ b/include/IGUIEditBox.h @@ -33,7 +33,7 @@ namespace gui //! Sets another color for the text. /** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined - in the skin, but the set color instead. You don't need to call + in the skin, but the set color instead. You don't need to call IGUIEditBox::enableOverrrideColor(true) after this, this is done by this function. If you set a color, and you want the text displayed with the color diff --git a/include/IGUIImage.h b/include/IGUIImage.h index fec3aba0..ef0fd6b9 100644 --- a/include/IGUIImage.h +++ b/include/IGUIImage.h @@ -28,17 +28,24 @@ namespace gui //! destructor ~IGUIImage() {}; - //! sets an image + //! Sets an image virtual void setImage(video::ITexture* image) = 0; - //! sets the colour of the image + //! Sets the colour of the image virtual void setColor(video::SColor color) = 0; - //! sets if the image should scale to fit the element + //! Sets if the image should scale to fit the element virtual void setScaleImage(bool scale) = 0; - //! sets if the image should use its alpha channel to draw itself + //! Sets if the image should use its alpha channel to draw itself virtual void setUseAlphaChannel(bool use) = 0; + + //! Returns true if the image is scaled to fit, false if not + virtual bool isImageScaled() const = 0; + + //! Returns true if the image is using the alpha channel, false if not + virtual bool isAlphaChannelUsed() const = 0; + }; diff --git a/include/IGUIListBox.h b/include/IGUIListBox.h index 284fb557..b723f985 100644 --- a/include/IGUIListBox.h +++ b/include/IGUIListBox.h @@ -45,6 +45,9 @@ namespace gui //! Removes an item from the list virtual void removeItem(s32 index) = 0; + //! Returns the icon of an item + virtual s32 getIcon(s32 id) const = 0; + //! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of //! the built-in-font by default. A sprite can be displayed in front of every list item. //! An icon is an index within the icon sprite bank. Several default icons are available in the diff --git a/include/IGUIMeshViewer.h b/include/IGUIMeshViewer.h index ea849111..21fad0b3 100644 --- a/include/IGUIMeshViewer.h +++ b/include/IGUIMeshViewer.h @@ -35,13 +35,16 @@ namespace gui //! destructor ~IGUIMeshViewer() {}; - //! sets the mesh to be shown + //! Sets the mesh to be shown virtual void setMesh(scene::IAnimatedMesh* mesh) = 0; - //! sets the material + //! Gets the displayed mesh + virtual scene::IAnimatedMesh* getMesh() const = 0; + + //! Sets the material virtual void setMaterial(const video::SMaterial& material) = 0; - //! gets the material + //! Gets the material virtual const video::SMaterial& getMaterial() = 0; }; diff --git a/include/IGUIStaticText.h b/include/IGUIStaticText.h index 372f71b2..e496dd49 100644 --- a/include/IGUIStaticText.h +++ b/include/IGUIStaticText.h @@ -37,7 +37,7 @@ namespace gui //! Sets another color for the text. /** If set, the static text does not use the EGDC_BUTTON_TEXT color defined - in the skin, but the set color instead. You don't need to call + in the skin, but the set color instead. You don't need to call IGUIStaticText::enableOverrrideColor(true) after this, this is done by this function. If you set a color, and you want the text displayed with the color diff --git a/include/IGUITabControl.h b/include/IGUITabControl.h index 160de8ca..1959236a 100644 --- a/include/IGUITabControl.h +++ b/include/IGUITabControl.h @@ -33,6 +33,13 @@ namespace gui //! sets the color of the background, if it should be drawn. virtual void setBackgroundColor(video::SColor c) = 0; + + //! 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; + }; //! A standard tab control diff --git a/source/Irrlicht/CGUIComboBox.cpp b/source/Irrlicht/CGUIComboBox.cpp index 03681122..e3bcf8ec 100644 --- a/source/Irrlicht/CGUIComboBox.cpp +++ b/source/Irrlicht/CGUIComboBox.cpp @@ -74,6 +74,18 @@ const wchar_t* CGUIComboBox::getItem(s32 idx) return Items[idx].c_str(); } +//! Removes an item from the combo box. +void CGUIComboBox::removeItem(s32 idx) +{ + if (idx < 0 || idx >= (s32)Items.size()) + return; + + if (Selected == idx) + Selected = -1; + + Items.erase(idx); +} + //! Returns caption of this element. const wchar_t* CGUIComboBox::getText() { diff --git a/source/Irrlicht/CGUIComboBox.h b/source/Irrlicht/CGUIComboBox.h index 8257ccfd..4e791b9a 100644 --- a/source/Irrlicht/CGUIComboBox.h +++ b/source/Irrlicht/CGUIComboBox.h @@ -34,6 +34,9 @@ namespace gui //! adds an item and returns the index of it virtual s32 addItem(const wchar_t* text); + //! Removes an item from the combo box. + virtual void removeItem(s32 id); + //! deletes all items in the combo box virtual void clear(); diff --git a/source/Irrlicht/CGUIContextMenu.cpp b/source/Irrlicht/CGUIContextMenu.cpp index ced0d35b..2db8021f 100644 --- a/source/Irrlicht/CGUIContextMenu.cpp +++ b/source/Irrlicht/CGUIContextMenu.cpp @@ -49,7 +49,7 @@ CGUIContextMenu::~CGUIContextMenu() //! Returns amount of menu items s32 CGUIContextMenu::getItemCount() const { - return Items.size(); + return (s32)Items.size(); } @@ -137,6 +137,19 @@ bool CGUIContextMenu::isItemEnabled(s32 idx) return Items[idx].Enabled; } +//! Returns if a menu item is checked +bool CGUIContextMenu::isItemChecked(s32 idx) +{ + if (idx < 0 || idx >= (s32)Items.size()) + { + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return false; + } + + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return Items[idx].Checked; +} + //! Sets if the menu item should be enabled. void CGUIContextMenu::setItemEnabled(s32 idx, bool enabled) diff --git a/source/Irrlicht/CGUIContextMenu.h b/source/Irrlicht/CGUIContextMenu.h index 520b36c7..365b15d6 100644 --- a/source/Irrlicht/CGUIContextMenu.h +++ b/source/Irrlicht/CGUIContextMenu.h @@ -50,6 +50,9 @@ namespace gui //! Sets if the menu item should be enabled. virtual void setItemEnabled(s32 idx, bool enabled); + //! Returns if a menu item is checked + virtual bool isItemChecked(s32 idx); + //! Sets if the menu item should be checked. virtual void setItemChecked(s32 idx, bool enabled); diff --git a/source/Irrlicht/CGUIImage.cpp b/source/Irrlicht/CGUIImage.cpp index 274e7730..89f47c70 100644 --- a/source/Irrlicht/CGUIImage.cpp +++ b/source/Irrlicht/CGUIImage.cpp @@ -108,6 +108,20 @@ void CGUIImage::setScaleImage(bool scale) ScaleImage = scale; } +//! Returns true if the image is scaled to fit, false if not +bool CGUIImage::isImageScaled() const +{ + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return ScaleImage; +} + +//! Returns true if the image is using the alpha channel, false if not +bool CGUIImage::isAlphaChannelUsed() const +{ + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return UseAlphaChannel; +} + //! Writes attributes of the element. void CGUIImage::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) diff --git a/source/Irrlicht/CGUIImage.h b/source/Irrlicht/CGUIImage.h index e9122b27..4c8d4faf 100644 --- a/source/Irrlicht/CGUIImage.h +++ b/source/Irrlicht/CGUIImage.h @@ -37,6 +37,12 @@ namespace gui //! sets if the image should use its alpha channel to draw itself virtual void setUseAlphaChannel(bool use); + //! Returns true if the image is scaled to fit, false if not + virtual bool isImageScaled() const; + + //! Returns true if the image is using the alpha channel, false if not + virtual bool isAlphaChannelUsed() const; + //! Writes attributes of the element. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options); diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index 6d13df4b..eea1e8e3 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -80,6 +80,14 @@ const wchar_t* CGUIListBox::getListItem(s32 id) return Items[id].text.c_str(); } +//! Returns the icon of an item +s32 CGUIListBox::getIcon(s32 id) const +{ + if (id<0 || id>((s32)Items.size())-1) + return -1; + + return Items[id].icon; +} //! adds an list item, returns id of item diff --git a/source/Irrlicht/CGUIListBox.h b/source/Irrlicht/CGUIListBox.h index f20d5684..68219319 100644 --- a/source/Irrlicht/CGUIListBox.h +++ b/source/Irrlicht/CGUIListBox.h @@ -31,7 +31,7 @@ namespace gui //! returns amount of list items virtual s32 getItemCount(); - //! returns string of a list item. the may be a value from 0 to itemCount-1 + //! returns string of a list item. the id may be a value from 0 to itemCount-1 virtual const wchar_t* getListItem(s32 id); //! adds an list item, returns id of item @@ -59,6 +59,9 @@ namespace gui //! returns the id of the new created item virtual s32 addItem(const wchar_t* text, s32 icon); + //! Returns the icon of an item + virtual s32 getIcon(s32 id) const; + //! removes an item from the list virtual void removeItem(s32 id); diff --git a/source/Irrlicht/CGUIMeshViewer.cpp b/source/Irrlicht/CGUIMeshViewer.cpp index de827335..641f0d84 100644 --- a/source/Irrlicht/CGUIMeshViewer.cpp +++ b/source/Irrlicht/CGUIMeshViewer.cpp @@ -61,7 +61,11 @@ void CGUIMeshViewer::setMesh(scene::IAnimatedMesh* mesh) Mesh->grab(); } - +//! Gets the displayed mesh +scene::IAnimatedMesh* CGUIMeshViewer::getMesh() const +{ + return Mesh; +} //! sets the material void CGUIMeshViewer::setMaterial(const video::SMaterial& material) diff --git a/source/Irrlicht/CGUIMeshViewer.h b/source/Irrlicht/CGUIMeshViewer.h index 94fc0c4a..3a1f6c1e 100644 --- a/source/Irrlicht/CGUIMeshViewer.h +++ b/source/Irrlicht/CGUIMeshViewer.h @@ -28,6 +28,9 @@ namespace gui //! sets the mesh to be shown virtual void setMesh(scene::IAnimatedMesh* mesh); + //! Gets the displayed mesh + virtual scene::IAnimatedMesh* getMesh() const; + //! sets the material virtual void setMaterial(const video::SMaterial& material); diff --git a/source/Irrlicht/CGUITabControl.cpp b/source/Irrlicht/CGUITabControl.cpp index e26592eb..54d4e03b 100644 --- a/source/Irrlicht/CGUITabControl.cpp +++ b/source/Irrlicht/CGUITabControl.cpp @@ -81,6 +81,18 @@ void CGUITab::setBackgroundColor(video::SColor c) BackColor = c; } +//! returns true if the tab is drawing its background, false if not +bool CGUITab::isDrawingBackground() const +{ + _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; + return DrawBackground; +} + +//! returns the color of the background +video::SColor CGUITab::getBackgroundColor() const +{ + return BackColor; +} //! Writes attributes of the element. void CGUITab::serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) diff --git a/source/Irrlicht/CGUITabControl.h b/source/Irrlicht/CGUITabControl.h index 8301e338..9851db89 100644 --- a/source/Irrlicht/CGUITabControl.h +++ b/source/Irrlicht/CGUITabControl.h @@ -41,6 +41,12 @@ namespace gui //! sets the color of the background, if it should be drawn. virtual void setBackgroundColor(video::SColor c); + //! returns true if the tab is drawing its background, false if not + virtual bool isDrawingBackground() const; + + //! returns the color of the background + virtual video::SColor getBackgroundColor() const; + //! Writes attributes of the element. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options);