edit box
edit box
Hey all,
I want to create an edit box but i have some problems, here is my code:
consoleedit=guienv->addEditBox(edit,(0,330,800,350),true,console);
and i defined:
const wchar_t edit[5]='cool';
When I compile it displays the error:"initializing' : cannot convert from 'const int' to 'const unsigned short [5]'
There are no conversions to array types, although there are conversions to references or pointers to arrays"
I know the problem is in wchar_t but I never worked before with wchar and I don't know how to fix it
Thanks
I want to create an edit box but i have some problems, here is my code:
consoleedit=guienv->addEditBox(edit,(0,330,800,350),true,console);
and i defined:
const wchar_t edit[5]='cool';
When I compile it displays the error:"initializing' : cannot convert from 'const int' to 'const unsigned short [5]'
There are no conversions to array types, although there are conversions to references or pointers to arrays"
I know the problem is in wchar_t but I never worked before with wchar and I don't know how to fix it
Thanks
Hi
To catch a enter in a edit box look at gui event EGET_EDITBOX_ENTER
In the doc http://irrlicht.sourceforge.net/docu/na ... i.html#a57
/ErMurazor
Project YAMMO
http://stenhard.net
To catch a enter in a edit box look at gui event EGET_EDITBOX_ENTER
In the doc http://irrlicht.sourceforge.net/docu/na ... i.html#a57
/ErMurazor
Project YAMMO
http://stenhard.net
Thanks guys for your replays but I got one last noob question.
Really sorry for the noobish question.
I use the gettext() to store the editbox input, but can i turn it into text string? cause i want to check what the user puts in, compare with another text and create an effect based on the comparison.
Any ideas?
Thanks
Really sorry for the noobish question.
I use the gettext() to store the editbox input, but can i turn it into text string? cause i want to check what the user puts in, compare with another text and create an effect based on the comparison.
Any ideas?
Thanks
I know, very very late answer, but may be it can still help.
there is no problem to convert the text into a String. It does it automatically.
m_pWorld->m_Name = m_pNewScreen->m_pEditBox_Welt->getText();
where m_Name is a member variable of CString :
CString m_Name;
so when you geht the text from the editbox it will be stored in m_Name which is a String. If you want a casting now to get from that String a char too, you can do this:
wchar_t tempStr[TMPBUF_SIZE];
_mbstowcsz(tempStr, m_pWorld->m_Name, m_pWorld->m_Name.GetLength() + 1);
and put tempStr where ever you need it. eg: m_pListScreens->addItem(tempStr);
there is no problem to convert the text into a String. It does it automatically.
m_pWorld->m_Name = m_pNewScreen->m_pEditBox_Welt->getText();
where m_Name is a member variable of CString :
CString m_Name;
so when you geht the text from the editbox it will be stored in m_Name which is a String. If you want a casting now to get from that String a char too, you can do this:
wchar_t tempStr[TMPBUF_SIZE];
_mbstowcsz(tempStr, m_pWorld->m_Name, m_pWorld->m_Name.GetLength() + 1);
and put tempStr where ever you need it. eg: m_pListScreens->addItem(tempStr);