[Solved] Moving The Window Problem

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

Oam
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Nov 13, 2014 07:01

[Solved] Moving The Window Problem

Postby Oam » Thu Nov 13, 2014 08:05

Hello,

I got cegui setup with the first five tutorials within the wiki.

To describe my current situation, I have the default window set up with it's initial attributes set up as:

Code: Select all

  fWnd->setPosition(CEGUI::UVector2(CEGUI::UDim(0.25f, 0.0f), CEGUI::UDim(0.25f, 0.0f)));
  // set size to be half the size of the parent
  fWnd->setSize(CEGUI::USize(CEGUI::UDim(0.5f, 0.0f), CEGUI::UDim(0.5f, 0.0f)));


Set up the same as it is with the tutorial. However, I am currently experiencing an issue when trying to move this window.

I am injecting these corresponding inputs to the system:

Code: Select all

CEGUI::System::getSingleton().getDefaultGUIContext().injectMousePosition(gameMouse.GetPosition().x, gameMouse.GetPosition().y);
 
  if (gameMouse.KeyDown(Input::MI_LBUTTON) && !this->mouseDown)
  {
    this->mouseDown = true;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonDown(CEGUI::MouseButton::LeftButton);
  }
 
  if (gameMouse.KeyUp(Input::MI_LBUTTON) && this->mouseDown)
  {
    this->mouseDown = false;
    CEGUI::System::getSingleton().getDefaultGUIContext().injectMouseButtonUp(CEGUI::MouseButton::LeftButton);
  }


Upon clicking my window's title bar and holding left mouse down, the window does follow my mouse cursor as expected. However, the farther I move the window to the left (x direction only), un-clicking left mouse button and then re-clicking left mouse button to recapture the window to follow the mouse cursor; the window's activation area for the title bar seems to diminish from the left side to the right side of the title bar. I'll attempt to provide an image example. I know my mouse inputs are correct because the CEGUI mouse cursor reflects the correct system mouse cursor in the application.

Image:
http://i.imgur.com/ZELhkvT.png

Hopefully there is someone out there that may recognize this situation. Do I need to provide an update call to my window upon each delta movement that the window is dragged of some sort, and not just the key injections ? Thank you for any clarification.

[EDIT]
Upon further investigation it seems like it's only the Top Left Quadrant of my application window when the window title bar isn't able to activate upon mouse click for window drag, when trying to re-grab the title bar for dragging to another location on the screen. I am calling the injectTimePulse function as well in my main loop.
Last edited by Oam on Fri Nov 14, 2014 07:23, edited 1 time in total.

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Moving The Window Problem

Postby Kulik » Thu Nov 13, 2014 11:19

What the... :shock:

If the mouse cursor moves around the screen as expected we can rule out mouse position injects. button down and up are also injected properly it seems.

It could be that you have a default window that's always on top or something and it's eating the events in the top left quadrant. Could you dump your entire GUISheet to see if that's the case?

You have provided no logs which is unfortunate. We want to see which renderer, which CEGUI version, which OS, which compiler. At the very least.

Oam
Not too shy to talk
Not too shy to talk
Posts: 23
Joined: Thu Nov 13, 2014 07:01

Re: Moving The Window Problem

Postby Oam » Thu Nov 13, 2014 12:24

Hello Kulik,

Thank you for your reply. This situation is actually a little bit humorous, I actually just came to the realization of what the problem was a minute ago. This project is also utilizing AntTweakBar for various editor features. CEGUI is going to be utilized for our main application interface. But, turns out the AntTweakBar was capturing the inputs for the mouse, I was unaware that it was still processing inputs even after it was invisible, haha. Where I was clicking was also the location where the AntTweakBar is located upon it being activated (f2).

Moved other issue to : viewtopic.php?f=10&t=6929
Last edited by Oam on Fri Nov 14, 2014 07:22, edited 1 time in total.

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

Re: Moving The Window Problem

Postby Ident » Thu Nov 13, 2014 14:26

Is the initial issue resolved? if yes then please make a new thread for the new issue you have. Also always post logs. http://www.cegui.org.uk/phpBB2/viewtopi ... =10&t=3351
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 18 guests