Possible bug with title bar?

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Evenstar
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Tue Feb 28, 2006 23:14

Possible bug with title bar?

Postby Evenstar » Thu Apr 13, 2006 22:58

I had previously posted about adding a transparent title bar to a frame window. I have managed to do that successfully, but I ran into another problem.

Before I continue, I need to set the stage. My purpose for having a transparent title bar is so that I can move the window around by clicking and dragging. The transparency will allow the contents of the window to be displayed. In order for this to work, the title bar has to be topmost because the main portion of the window is a static image. If the title bar is not topmost, then mouse down events will never reach the title bar even if the static image does not handle them. Having the title bar top most presents its own set of problems. Namely, all mouse down events are swallowed by the title bar.

What I'm wanting to do is trap EventMouseButtonDown events for the title bar. If the events occur over specific areas of my window, I want to simply ignore the event. Otherwise, I want the default event handler to handle it. In theory, I should be able to return false from my event handler to let the default event handler take charge, or true to tell the default event handler to ignore the event. That's my understanding of it, anyway.

What happens is that the default handler always handles the event.

The code for the Titlebar class says:

Code: Select all

void Titlebar::onMouseButtonDown(MouseEventArgs& e)
{
  // Base class processing
  Window::onMouseButtonDown(e);

  if (e.button == LeftButton)
  {
    ...
 
    e.handled = true;       
  }



It seems to me that after the base class processing completes its call to Window::onMouseButtonDown(e), it should check to see if e.handled is true. If it is, the function should return without further processing.

Thanks,
Brian

Evenstar
Not too shy to talk
Not too shy to talk
Posts: 26
Joined: Tue Feb 28, 2006 23:14

Postby Evenstar » Fri Apr 14, 2006 19:52

Well, I just ran into another problem. I modified my code to inform the TitleBar to ignore the mouse events if the event has been handled; however I'm needing the event to be passed on to the windows beneath the title bar window. Is there some way of telling the title bar to ignore the event completely except in certain circumstances?

As a "for instance", consider the following:

You have a checkerboard pattern (black/white) that you are displaying as a static image. The pattern encompasses the entire window. Now, you want to be able to click and drag the window when clicking in a white area, but you want to pass on all the other mouse down events to the static image window. So, clicking white can drag and clicking black signals the static window. In order for the first condition to be performed, a transparent title bar needs to be added to the window, and that title bar must encompass the entire window as well (if there is another way to allow the complete window to be dragged, please let me know.)

I've actually done most of this. The only remaining part is the notification to the static image that a mouse down event needs to be handled. If I signal to the title bar that the event has been handled as I proposed in the original post, the title bar will not be moved. However, setting the event handled flag to true also prevents the window that I'm actually wanting to click from receiving the notification. This is kind of confusing, I know.

So, if there are no other ways of handling moving the window, is there a way to temporarily disable the title bar from its default behavior?

Thanks,
Brian


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests