views:

156

answers:

2

How can I implement a non-modal sliding notification bar, such as Firefox, Beyond Compare, and VMware Workstation 6.5 use, in client-side Windows apps?

Any language or framework is fine for now; my current app is in Delphi / C++Builder, but I'm also interested in comparing frameworks and prototyping some UIs.

Related question: This question asks about doing so in Java.

A: 

In Delphi, I believe that you can change a property on the Dialog itself (change the window type away from "Dialog" and select the standard windowed alternative). Sorry I cannot be more specific, it has been about two years since I last worked on a Delphi app.

Mark Brittingham
Making a non-modal dialog is easy; I'm instead interested in an easy way to create notification bars that are part of the parent window.
Josh Kelley
Oops, sorry. Can't you just put a status bar at the bottom and change the status bar text property? Alternatively, a panel whose height is changed to "open" it up and, after a delay, changed back to zero?
Mark Brittingham
+1  A: 

Beyond Compare's notification bar doesn't slide, it just pops open, so I can't offer any help on that. The notification bar itself is just a TPanel with a TImage and TLabel for the image/text. It's placed on the main window at design time and it's set to align bottom. Normally it's hidden, and when there's a message to display we set the Visible property to true.

There's different ways to hide the notification, depending on how you want it to behave. In BC we install keyboard and mouse hooks (SetWindowsHookEx with WH_KEYBOARD or WH_MOUSE) and hide it on key up and mouse button events. Alternatively, like Mark said, you could hide it after a delay, add a close button to the side, or just watch for specific events in your app and manually hide it then.

Craig Peterson