Jump to content

[SOLVED] In AppWall GUI focus works incorrect.


photo

Recommended Posts

Hello,

I'm using AppWall and MOUSE_SOFT. I have two gui pointers gui_prim and gui_sec. I trying to create a dialog in runtime. For simplifying problem, i use WidgetWindow in example.

I have three different types of behavior.

1 - I create window in primary gui and then attach window to it:

	WidgetWindowPtr wnd = WidgetWindow::create(gui_prim, "test window");
	gui_prim->addChild(wnd->getWidget(), Gui::ALIGN_OVERLAP | Gui::ALIGN_CENTER);
	wnd->release();

Everything works correct. Widget is created in the center of left screen, and overlaps any element.

2 - Create in prim or sec (same bahavior), attach to sec

Window appears in the center of a right screen, but if i click at any widget, i can interact with (edittext, scrollbox, etc), window moves under it.

3 - Create in sec, add in prim

If i move window over edittext, editline etc - ok, but if i move window over scrollbox and click on it (on window), it stopes to interact with mouse, but stil renders over scrollbox.

wnd->setPermanentFocus(); doesn't help

Thank you.

Link to comment
  • 2 weeks later...

Hello, I made a simple example with this error.

When I create wdt_edittext in gui_sec - everything works correct, but if i create it in gui_prim - wdt_edittext overlaps dialog.

I have to create it in gui_prim, because in my actual programm i use UI-file.

Command arguments are -data_path ../ -engine_config "../data/Test_gui/unigine.cfg" -console_command "" -width 2 -height 1 -extern_plugin "AppWall" -extern_define MOUSE_SOFT

PS: i have modified version of AppWall.cpp see 

 

AppSystemLogic.cpp AppSystemLogic.h

Edited by muslaev.ilya
Link to comment

Hi, thanks for the sample.

All issues are caused by unusual usage of widgets and gui. If you'll create a widget in the same gui it'll work as expected.

This code works fine:

wdt_edittext = WidgetEditText::create(gui_sec);
wdt_edittext->setHeight(400);
wdt_edittext->setWidth(500);
gui_sec->addChild(wdt_edittext->getWidget(), Gui::ALIGN_CENTER | Gui::ALIGN_OVERLAP);

This one isn't:

wdt_edittext = WidgetEditText::create(gui_prim);
wdt_edittext->setHeight(400);
wdt_edittext->setWidth(500);
gui_sec->addChild(wdt_edittext->getWidget(), Gui::ALIGN_CENTER | Gui::ALIGN_OVERLAP);

Could this be a typo or you're doing this on purpose?

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

I'm doing this on purpose, because in my program i using UI file. So i create UserInterfacePtr in gui_prim, but attach widgets in different monitors (gui).

ui_file = UserInterface::create(gui_prim, "Interface.ui");

wdt_hbox_prim = WidgetHBox::cast(ui_file->getWidget(ui_file->findWidget("hbox_prim")));
gui_prim->addChild(wdt_hbox_prim->getWidget(), Gui::ALIGN_OVERLAP);

wdt_vbox_sec = WidgetVBox::cast(ui_file->getWidget(ui_file->findWidget("vbox_sec")));
gui_sec->addChild(wdt_vbox_sec->getWidget());

Is the only way is to create a different ui file for each monitor?

Link to comment
  • morbid changed the title to [SOLVED] In AppWall GUI focus works incorrect.
×
×
  • Create New...