I just downloaded v0.97 (and later the latest svn-version) of QuickGUI to give it a try. I really got quick into it and its very easy to use, good job
However, I stepped into a first crash with the console/labelarea:
if you input a line without whitespaces, that is wider than the textarea itself and submit it, the console crashes, and i think i figured out why:
// The rest of the caption is less than the width of the Widget.
if( end == static_cast<int>(mCaption.length()) )
// Remaining portion of caption is larger than the width of the widget.
// Iterate backwards until we find a space.
while( !mText->isSpace(mCaption[end]) )
This part of the _getLine(int startIndex)-Method in quickguilabelarea.cpp does not take into account, that a word without whitespaces could have been to long for the text area. The 'else' part tries to roll back but won't find any Whitespace and so try to test mCaption[-1].
Thanks for spotting this, I forgot to gaurd against that case. What should be the default behavior for this? Just breaking the line at the point where it is longer than the space allotted, and continuing the text below, right?
I'd like to point out some other points:
First, could you provide a focus funciton which gains focus of mInputBox?
In our application, if you press ^ , the console pops up and the focus should be in the input box (so you don't need a mouse cursor and click in it)
Also, there seems to be strange behavior when I manually call addText:
error LNK2019: unresolved external symbol "public: void __thiscall QuickGUI::Console::addText(class Ogre::UTFString const &)" (?addText@Console@QuickGUI@@QAEXABVUTFString@Ogre@@@Z) referenced in function "public: void __thiscall psi::EgoDevice::CreateGUI(void)" (?CreateGUI@EgoDevice@psi@@QAEXXZ)
This type of error mostly occurs, when a method is declared but not defined.
But I check the quickGUI code and it actually is there.
Do you have an idea what could cause this?
I tried it with the quickGUIDemo - same error.
The reason why we would need this functionality is, if the user enters a console instruction, we'd like to give him/her feedback ("unknown", "new value = ... " etc. )
Thanks for you time
I will make sure a "focus" function exists, and that the input text box is given focus.
For the error, I'm not sure the problem.. could be that I'm forgetting to export Console or LabelArea to dll, but I've ran these in the demo before. Maybe your lib or headers is/are not in sync with the code base? I'll see if I can repro this at home.
Also, it may be a couple of days before I commit it. I'll add it tonight, but I can't easily commit at the moment, without introducing an awkward state of QGUI.
What should be the default behavior for this? Just breaking the line at the point where it is longer than the space allotted, and continuing the text below, right?
Yes, i think in such a case, a word is just cutted and continued in the next line.
I just came up with another console-nice2have
How about "iterating" through the last entered commands with the UP- & DOWN -cursor. (dos-like)
Is this technically possible without having to rebuild the whole console?
Regarding the addText issue you had earlier, the Console class was not being exported to the dll, so this is fixed now. (need to commit..)
For your request I'd need to make a container (probably vector) to store entered input. Pretty simple to do, I will add this in, and tie it to the up/down arrows. (is this what you mean by up/down cursor?)
(is this what you mean by up/down cursor?)
yeah i guess so
cursor probably was the wrong name, since the mouse has a cursor and the keyboard has keys ...