How can I create editbox without falagard look n feel?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

How can I create editbox without falagard look n feel?

Postby mintogo » Tue Jan 07, 2020 10:14

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?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: How can I create editbox without falagard look n feel?

Postby Ident » Tue Jan 07, 2020 20:37

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"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: How can I create editbox without falagard look n feel?

Postby mintogo » Wed Jan 08, 2020 05:09

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?

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: How can I create editbox without falagard look n feel?

Postby Ident » Wed Jan 08, 2020 08:36

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"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: How can I create editbox without falagard look n feel?

Postby mintogo » Wed Jan 08, 2020 11:03

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.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: How can I create editbox without falagard look n feel?

Postby Ident » Wed Jan 08, 2020 22:09

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"

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: How can I create editbox without falagard look n feel?

Postby mintogo » Thu Jan 09, 2020 00:18

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.

mintogo
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Fri Dec 29, 2017 01:17

Re: How can I create editbox without falagard look n feel?

Postby mintogo » Thu Jan 09, 2020 05:04

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests