Hi,
Is there any class which is like EditBox, but on multiple lines ? I haven't seen anything for that in the API reference (statictext can be multiwrapped, but it's ... static. And EditBox are single line).
Or is there a way to 'cheat' with a combo of statictext and editbox ?
(As you can see, i'm fond of editboxes )
EditBox on multiple lines ?
I finally tried another way to have a textbox : i have a statictext, and when it's hovered, i display a cursor ("|") inside ... i can write, delete characters, but i have a little problem : some of my keys aren't recognized by the engine ...
For example : ?!.,;&é"'(-è_çà123456789$£, etc.
I get this message : "Could not find win32 key for x11 key.".
How can I correct that ? it's rather awkward* ...
*especially for these keys : "é" "è", because i'm french, and ".".
For example : ?!.,;&é"'(-è_çà123456789$£, etc.
I get this message : "Could not find win32 key for x11 key.".
How can I correct that ? it's rather awkward* ...
*especially for these keys : "é" "è", because i'm french, and ".".
Even if I seem to talk alone (one my favorite occupations ) ... i post again.
I finally tried a third method to have a textbox : a statictext with border behind an editbox of the same dimensions and hidden (ransparent font and no border).
This is the code :
So, I have juste to create the Textbox :
TextBox MytextBox(env, L"", rect<s32>(200,200,600,400), true, 0, 15, 16, 255);
And to update it at each drawing :
MytextBox.update();
I finally tried a third method to have a textbox : a statictext with border behind an editbox of the same dimensions and hidden (ransparent font and no border).
This is the code :
Code: Select all
class TextBox
{
IGUIEnvironment * env;
IGUIStaticText * TextBoxShown;
IGUIEditBox * TextBoxImpl;
public:
TextBox(IGUIEnvironment*, const wchar_t*, const core::rect<s32>&, bool, IGUIElement*, s32, s32, s32);
void update();
};
TextBox::TextBox(IGUIEnvironment* _env, const wchar_t* IniText, const core::rect<s32>& rectangle, bool border, IGUIElement* parent, s32 id, s32 id2, s32 maxLength)
{
env = _env;
TextBoxShown = env->addStaticText(IniText, rectangle, border, true, parent, id);
TextBoxImpl = env->addEditBox(IniText, rectangle, true, parent, id2);
TextBoxImpl->setOverrideColor(SColor(0,0,0,0));
TextBoxImpl->setMax(maxLength);
}
void TextBox::update()
{
TextBoxShown->setText(TextBoxImpl->getText());
}
TextBox MytextBox(env, L"", rect<s32>(200,200,600,400), true, 0, 15, 16, 255);
And to update it at each drawing :
MytextBox.update();
I would be very proud to manage to do this ... but i'be some questions :
-to modify EditBox, for example : do I need to modify only "CGUIEditBox.h" and "CGUIEditBox.cpp" and they run make to compile the engine, or is there anything else to do ?
-will Irrlicht have soon an "official" textbox, or shall I modify these files each time i change my irrlicht version ?
-how can i become a cPp 3133t/m4st4 ? (just kidding)
-is my english correct ?
-to modify EditBox, for example : do I need to modify only "CGUIEditBox.h" and "CGUIEditBox.cpp" and they run make to compile the engine, or is there anything else to do ?
-will Irrlicht have soon an "official" textbox, or shall I modify these files each time i change my irrlicht version ?
-how can i become a cPp 3133t/m4st4 ? (just kidding)
-is my english correct ?