1) On IGUIWindow. Is there any way to prevent irrlicht from drawing the X to close the window?
2) On IGUIListBox. It always displays an scrollbar even if it's not needed. Can you make it only appear when necessary?
I know I could change those things in the irrlicht source, but I was wondering if there is some way to do this using the IGUISkin or something else.
Thanks.
________
Vapir no2
A couple of GUI questions
A couple of GUI questions
Last edited by rimbou on Fri Feb 18, 2011 6:07 pm, edited 1 time in total.
Yes that was very easy. getCloseButton()->setVisible(0)JP wrote:1) should be quite simple if you look at the API
I guess I'll have to add a function to the IGUIListBox that returns a pointer to the IGUIScrollBarJP wrote: 2) you can set the scrollbar invisible yourself though i don't know if there's any easy way of knowing whether it's needed or not.
________
Lamborghini Lm002 Specifications
Last edited by rimbou on Fri Feb 18, 2011 6:07 pm, edited 1 time in total.
If anyone is interested I made a patch:
I probably didn't use the right diff options to make the patch, so please enlienghten me on what options should I use
________
BUY NO2 VAPORIZER
Code: Select all
$ diff old --to-file=new
diff --to-file=new old/CGUIListBox.cpp new/CGUIListBox.cpp
382a383,387
> //! Returns a pointer to the Scroll Bar
> IGUIScrollBar* CGUIListBox::getScrollBar()
> {
> return ScrollBar;
> }
diff --to-file=new old/CGUIListBox.h new/CGUIListBox.h
71a72,74
> //! Returns a pointer to the Scroll Bar
> virtual IGUIScrollBar* getScrollBar();
>
diff --to-file=new old/IGUIListBox.h new/IGUIListBox.h
15a16
> class IGUIScrollBar;
60a62,64
>
> //! Returns a pointer to the Scroll Bar
> virtual IGUIScrollBar* getScrollBar() = 0;
________
BUY NO2 VAPORIZER
Last edited by rimbou on Sat Mar 12, 2011 6:06 am, edited 1 time in total.
This patch adds getScrollBar() to IGUIListBox. This is useful for example if you dont want to display the scrollbar on the listbox.
Example:
Here it is with the other options.
________
MY WEBCAMS HOOKUP
Example:
Code: Select all
ListBox->getScrollBar()->setVisible(0);
Code: Select all
$ diff -Naurp old new
diff -Naurp old/CGUIListBox.cpp new/CGUIListBox.cpp
--- old/CGUIListBox.cpp 2006-11-26 07:11:36.000000000 +0100
+++ new/CGUIListBox.cpp 2006-12-13 19:35:49.687500000 +0100
@@ -380,6 +380,11 @@ void CGUIListBox::setIconFont(IGUIFont*
IconFont->grab();
}
+//! Returns a pointer to the Scroll Bar
+IGUIScrollBar* CGUIListBox::getScrollBar()
+{
+ return ScrollBar;
+}
} // end namespace gui
} // end namespace irr
diff -Naurp old/CGUIListBox.h new/CGUIListBox.h
--- old/CGUIListBox.h 2006-11-26 07:11:34.000000000 +0100
+++ new/CGUIListBox.h 2006-12-13 19:35:11.796875000 +0100
@@ -69,6 +69,9 @@ namespace gui
//! Update the position and size of the listbox, and update the
scrollbar
virtual void updateAbsolutePosition();
+ //! Returns a pointer to the Scroll Bar
+ virtual IGUIScrollBar* getScrollBar();
+
private:
struct ListItem
diff -Naurp old/IGUIListBox.h new/IGUIListBox.h
--- old/IGUIListBox.h 2006-06-17 08:12:12.000000000 +0200
+++ new/IGUIListBox.h 2006-12-13 19:36:17.562500000 +0100
@@ -13,6 +13,7 @@ namespace irr
namespace gui
{
class IGUIFont;
+ class IGUIScrollBar;
//! Default list box GUI element.
class IGUIListBox : public IGUIElement
@@ -58,6 +59,9 @@ namespace gui
//! sets the selected item. Set this to -1 if no item should be
selected
virtual void setSelected(s32 id) = 0;
+
+ //! Returns a pointer to the Scroll Bar
+ virtual IGUIScrollBar* getScrollBar() = 0;
};
MY WEBCAMS HOOKUP