Page 1 of 1
How can I create editbox without falagard look n feel?
Posted: Tue Jan 07, 2020 10:14
by mintogo
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?
Re: How can I create editbox without falagard look n feel?
Posted: Tue Jan 07, 2020 20:37
by Ident
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.
Re: How can I create editbox without falagard look n feel?
Posted: Wed Jan 08, 2020 05:09
by mintogo
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?
Posted: Wed Jan 08, 2020 08:36
by Ident
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.
Re: How can I create editbox without falagard look n feel?
Posted: Wed Jan 08, 2020 11:03
by mintogo
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?
Posted: Wed Jan 08, 2020 22:09
by Ident
Look at the application template on the default branch, it gives u basic info on setups like these maybe u miss something
Re: How can I create editbox without falagard look n feel?
Posted: Thu Jan 09, 2020 00:18
by mintogo
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?
Posted: Thu Jan 09, 2020 05:04
by mintogo
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.