Hi
I trying to create text edit box with out any looknfeel file(xml).
I create class inherit CEGUI::Window class and define CEGUI::EditBox* instance.
like below in header file.
CEGUI::Editbox* _editBox;
and then in source file.
_editBox = new CEGUI::Editbox("CEGUI/Editbox", "editBox");
_editBox->setArea(CEGUI::UDim(1.0, 0), CEGUI::UDim(1.0, 0), CEGUI::UDim(1.0, 0), CEGUI::UDim(1.0, 0)); // cover parent
_editBox->setText("TEST TEXT"); // for text test
_editBox->setFont(CEGUI::System::getSingleton().getDefaultGUIContext().getDefaultFont()); // default system font
this->addChild(_editBox); // add to parent as child
but there is nothing.
It's not available create editbox without falagard type?
How can I create editbox without falagard look n feel?
Moderators: CEGUI MVP, CEGUI Team
Re: How can I create editbox without falagard look n feel?
Have you taken a look at the samples used in the sample browser? it is full of example lines on how to do this. You do not create a Editbox directly, you create a window of the LNF type you want, the rest is data driven.
CrazyEddie: "I don't like GUIs"
Re: How can I create editbox without falagard look n feel?
Ident wrote:Have you taken a look at the samples used in the sample browser? it is full of example lines on how to do this. You do not create a Editbox directly, you create a window of the LNF type you want, the rest is data driven.
Ok, I understood and fix it.
write editbox in looknfeel file and create editbox from it.
I have another question about editbox class.
There is not exist align(vert, horz) option for text in editbox, still?
Re: How can I create editbox without falagard look n feel?
mintogo wrote:Ident wrote:Have you taken a look at the samples used in the sample browser? it is full of example lines on how to do this. You do not create a Editbox directly, you create a window of the LNF type you want, the rest is data driven.
Ok, I understood and fix it.
write editbox in looknfeel file and create editbox from it.
I have another question about editbox class.
There is not exist align(vert, horz) option for text in editbox, still?
Try using CEED, you can download it precompiled from our website. It shows you all options you got.
CrazyEddie: "I don't like GUIs"
Re: How can I create editbox without falagard look n feel?
Ident wrote:mintogo wrote:Ident wrote:Have you taken a look at the samples used in the sample browser? it is full of example lines on how to do this. You do not create a Editbox directly, you create a window of the LNF type you want, the rest is data driven.
Ok, I understood and fix it.
write editbox in looknfeel file and create editbox from it.
I have another question about editbox class.
There is not exist align(vert, horz) option for text in editbox, still?
Try using CEED, you can download it precompiled from our website. It shows you all options you got.
Ok I will try.
now I try to input some text in editbox.
I inject key/char in MFC message function [OnKeyUp, OnKeyDown].
I translate VK_UP to CEGUI::Key::Scan::ArrowUp, VK_LEFT to CEGUI::Key::Scan::ArrowLeft, VK_RIGHT to CEGUI::Key::Scan::ArrowRight and VK_DOWN to CEGUI::Key::Scan::ArrowDown and inject key code.
but When I press arrow key, there is nothing happen in editbox.
Re: How can I create editbox without falagard look n feel?
Look at the application template on the default branch, it gives u basic info on setups like these maybe u miss something
CrazyEddie: "I don't like GUIs"
Re: How can I create editbox without falagard look n feel?
Ident wrote:Look at the application template on the default branch, it gives u basic info on setups like these maybe u miss something
Yeap I already check the cegui sample framework source code.
Actually, backspace, delete, home and end keys are work properly.
only arrow type buttons are not working.
Re: How can I create editbox without falagard look n feel?
mintogo wrote:Ident wrote:Look at the application template on the default branch, it gives u basic info on setups like these maybe u miss something
Yeap I already check the cegui sample framework source code.
Actually, backspace, delete, home and end keys are work properly.
only arrow type buttons are not working.
Ok..
I found solution myself..
If someone use CEGUI with MFC and want to use system key in CEGUI. (such as arrow key)
Arrow key is use as key to change focus between MFC dialogs.
so you need to add [OnGetDlgCode] message and add return DLGC_WANTALLKEYS;
UINT OpenGLRenderer::OnGetDlgCode()
{
// TODO: Add your message handler code here and/or call default
return DLGC_WANTALLKEYS;
}
like this.
Who is online
Users browsing this forum: No registered users and 11 guests