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
