How to disable a listbox select feature?
-
qwertyCoder
- Posts: 40
- Joined: Wed May 07, 2008 4:37 pm
- Location: Asheville, NC, USA
How to disable a listbox select feature?
Is there a way to make a list box unable to select anything? Im using a listbox as a sort of chat log, so there is no need to select anything, but Im not finding an option to disable selections or the like. Any ideas other than implementing a separate GUI object?
---------------------------------------
---------------------------------------
Code: Select all
int main()
{
if (bCodeDoesntWork)
{
int res = AttemptFix(this);
if (failed(res))
{
PullHair();
}
}
}
-
qwertyCoder
- Posts: 40
- Joined: Wed May 07, 2008 4:37 pm
- Location: Asheville, NC, USA
Additionally, Im trying to get the text inside the listbox to be bigger, setItemHeight seems to only set the height of each list item, not the font size. Im not finding any font references in the gui elements...
o.O I would have thought that font face and size would have been implemented much in the same way each items color can be changed.
o.O I would have thought that font face and size would have been implemented much in the same way each items color can be changed.
---------------------------------------
---------------------------------------
Code: Select all
int main()
{
if (bCodeDoesntWork)
{
int res = AttemptFix(this);
if (failed(res))
{
PullHair();
}
}
}
The listbox is using the IGUISkin-font. Can't override that currently.
With setEnabled(false) you can disable input for the listbox, although it will probably also affect the colors. Otherwise you can also try to catch mouse-events in your event-receiver when the listbox has the focus or the mouse is above it . In that case it's probably best to take a look at CGUIListBox::OnEvent (in CGUIListBox.cpp) to check which events are used.
Or use a custom gui-element for your chat.
Also search around the forum - there are other chat-implementations already I think.
With setEnabled(false) you can disable input for the listbox, although it will probably also affect the colors. Otherwise you can also try to catch mouse-events in your event-receiver when the listbox has the focus or the mouse is above it . In that case it's probably best to take a look at CGUIListBox::OnEvent (in CGUIListBox.cpp) to check which events are used.
Or use a custom gui-element for your chat.
Also search around the forum - there are other chat-implementations already I think.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
qwertyCoder
- Posts: 40
- Joined: Wed May 07, 2008 4:37 pm
- Location: Asheville, NC, USA
Can the gui element such as a listbox be derived and certain functions overloaded? or would i have to code one from scratch following the default listbox structure? o.O
---------------------------------------
---------------------------------------
Code: Select all
int main()
{
if (bCodeDoesntWork)
{
int res = AttemptFix(this);
if (failed(res))
{
PullHair();
}
}
}
-
qwertyCoder
- Posts: 40
- Joined: Wed May 07, 2008 4:37 pm
- Location: Asheville, NC, USA
Well if Im going to go that far I suppose it would behoove me to simply create a custom gui element that contains both the chat history as well as the chat entry edit box and functions to handle various features....question is, to do that should i inherit from guielement and have members for each actual item (history and edit) or should i inherit from listbox and add a child in the constructor that is a pointer to the edit box? o.O
---------------------------------------
---------------------------------------
Code: Select all
int main()
{
if (bCodeDoesntWork)
{
int res = AttemptFix(this);
if (failed(res))
{
PullHair();
}
}
}