Titlebar
The Titlebar is a text line at the top of the display which contains an application's title, status, and, optionally, the current system date and time. It is the application's responsibility to properly format the title/status string, while LHAPI is responsible for updating the date and time to keep them current. Titlebar displays the title/status string left-justified and the date/time right-justified on the titlebar line. (If you choose to create a titlebar with a date/time, you must subclass all of your NULLEVENT messages on to Object, not filter them out. Object is the one responsible for calling the DateTime window with a NOTIFY, NOTIFY_UPDATE message during NULLEVENT processing.)
Window Structure Details
n int x,y,w,h: LHAPI automatically sets these values during the CREATE message processing to the entire extent of the titlebar, including any DateTime window which is automatically created by LHAPI.
- PLHRES Title: Title is a near pointer to a far pointer to a string buffer containing the main application name and status. Titlebar displays this string left-justified on the titlebar line. It is the responsibility of the application to properly format this string (padding it with spaces when necessary).
- PLHDATA Data: Not used.
- UINT LogicalSize: Not used.
- UINT Style TITLE_NODATETIME: When set, LHAPI does not display the current system date & time. By default (when this bit is not set), LHAPI automatically creates and updates a DateTime window on the right side of the TitleBar window.
DateTime Window Styles
These styles are valid only for the DateTime window (the one pointed to by TitleBar's Menu field). They are not to be set in the TitleBar's style field.
DATETIME_BOTH: Display date and time.
DATETIME_INVERSE: Show the text as white on black.
DATETIME_DATE: Display the date only.
DATETIME_TIME: Display the time only.
DATETIME_RIGHT: Right-justify the date/time string.
- PLHWINDOW Parent: Used by the Object class handler.
- PLHFKEYS FKeys: Used by the Object class handler.
- PLHMENU Menu (cast to PLHWINDOW); Menu points to the DateTime window structure which is filled in and created by LHAPI (unless the TITLE_NODATETIME style is being used).
- UINT Selection: Not used.
- UINT WindowTop: Not used.
- Font: Automatically set by LHAPI.
Messages
- DRAW: Titlebar only responds to the DRAW_TITLE submessage to display the Title string in reverse video on the left side of the titlebar line. Titlebar passes all draw messages to the Object class handler.
- CREATE: Titlebar sets the x,y,w,h and Font fields to LHAPI internally-specified values. Titlebar sets the Style field to STYLE_NOFOCUS. Once the message is passed to the Object class handler, Object creates a child DateTime window if the TITLE_NODATETIME style bit is not set. LHAPI automatically fills in the LHWINDOW structure pointed to by the Menu field to be used as the DateTime window structure.
- SETFOCUS: Passed to the Object class handler.
- LOSEFOCUS: Passed to the Object class handler.
- NOTIFY: Passed to the Object class handler.
- APPEAR: Passed to the Object class handler.
- DISAPPEAR: Passed to the Object class handler.
- NULLEVENT: Passed to the Object class handler.
- DESTROY: Passed to the Object class handler.
- TERMINATE: Passed to the Object class handler.
- ACTIVATE: Passed to the Object class handler.
- DEACTIVATE: Passed to the Object class handler.
- COMMAND: Passed to the Object class handler.