tgui::editbox missing colorFocused

Started by billarhos, 28 October 2015, 08:20:37

billarhos

Hi

I am trying to set different color on edit boxes when they are focused but can not find such a color parameter. On the other hand a texture with name
"m_textureFocused" is present.

Also i have realize that editboxes (maybe and other widgets) are not possible to receive focus (via pEditBox->focus();).
To make an edit box receive focus, you have first to click on it. After that it is focus able. In order to work around this, i have added
this code in my initialize function.

for (sf::Uint32 i = 0; i < EditBoxes::Count; i++)
{
mGui.add(pEditBoxes[i]);
pEditBoxes[i]->leftMousePressed(pEditBoxes[i]->getPosition().x + 5, pEditBoxes[i]->getPosition().y + 5);
}


Maybe just the carret is the problem thai is not blinking.
I do not use container or childwindow.

missing something?

thank you

texus

Focused is a state which exists since the early versions of tgui but which never evolved with it. It makes sense for basic widgets like button and edit box but widgets like slider don't support it at all. Pressing the tab key moved the focus from one widget to the next but once containers like panel and child window were added even this started giving issues. The point is that focusing support is somewhat broken and has to be rewritten from scratch to be really useful again.

Although there still is a function to set a focused texture (and Black.png even still contains the needed images), it is not even used by any of the themes that comes with tgui. When rewriting the widgets to support colors instead of textures, I didn't even take the effort to implement the focused state for colored widgets because it would have to be changed later anyway. That's why there is a function for a texture but not for a color.

I don't want to touch the focusing anywhere soon because even I don't know how edit box is currently functioning. Technically it is not allowed to be in focus state because it requires the focus image, but it can't receive text input if it is not focused. Most likely I solved this by somehow making EditBox and TextBox exceptions on the rule a long time ago.