Custom Title Bars |
The standard Windows title bar is a horizontal bar located at the top of a panel that displays the panel title. It may also provide an application icon to access the system menu, as well as buttons to minimize, maximize/restore and close the application. Title bars are also draggable, allowing the panel to be moved by clicking and dragging the title bar.
The NOMADS Custom Title Bar feature, added in PxPlus 2017, allows you to design your own title bar to customize the look and feel of your application. It can be a simple header with logos, text, shapes and special controls added at the top of your panel below the Windows title bar and menu. You can suppress the Windows title bar entirely and create your own system menu, minimize, maximize/restore and close buttons. You can specify different custom title bars for different modules in your application or even for different panels. You can also specify which modules or panels should not use the custom title bar.
Title bars can be added system wide, to a library or to a panel. You can suppress the title bar at the library and panel levels. See Assigning Custom Title Bars.
For information on creating a custom title bar, see Creating a Custom Title Bar.
|
|
This is an example of a custom title bar that suppresses the Windows title bar by using a Thin with no caption frame style, displays the company logo and panel caption on a gradient background, and provides its own Minimize, Maximize/Restore and Close buttons. |
Custom title bars can be easily added to all panels that meet the required criteria. Title bars will not be displayed on panels that:
Title bars can be added system wide, to a library or to a panel. You can suppress the title bar at the library and panel levels. See Assigning Custom Title Bars.
A custom title bar consists of a panel similar to an Embedded Panel with its contents placed at the top of the panel being displayed. Unlike the embedded panel, however, it does not have to be physically included in the definition of the panel on which it is displayed. At run time, all the controls on the title bar panel will appear at the top of the current active panel.
Creating a custom title bar is much like defining any panel. When defining a title bar panel, you can specify a default program and logic events in the panel header. The controls on the title bar can include any of the Control Types available in the NOMADS Panel Designer (Button, Multi-Line, Drop Box, etc.). Some special considerations need to be observed when defining the custom title bar panel, as not all features are applicable, e.g. menu bars, status bars, etc.
The following sections outline the details to consider when defining the Panel Header, Controls and Resizing aspects of the custom title bar.
Many of the settings in the Panel Header are ignored, as these are supplied at run time by the current panel being displayed.
The table below describes the Panel Header settings that are used. Special note should be taken regarding the use of the Frame Style parameter on the Attributes tab.
Display | |||||||||||||
Default Program |
Name of program to supply logic for events triggered by controls on the title bar. | ||||||||||||
Parameters |
| ||||||||||||
Logic | |||||||||||||
Pre-Display |
Executes after the Pre-Display logic for the current panel and prior to the controls on the title bar being drawn. | ||||||||||||
Post-Display |
Executed after the controls on the title bar are drawn and before the controls on the current panel are drawn. | ||||||||||||
On Exit |
Executes prior to the On Exit logic of the current panel. |
The controls on the title bar can include any of the Control Types available in the NOMADS Panel Designer. They must have unique names to avoid any confusion with duplicate control names.
Special control names are available, which are listed below, to process the minimize, maximize/restore, close, and system menu buttons, as well as a special Fonted Text control name to display the panel caption. When the specified names are used for the buttons, they will be processed automatically by the system, which supplies the logic to process them and determines which of the buttons should be hidden/shown/enabled/disabled based on the settings for the current panel being displayed.
(Support to automatically set the logic for Custom title bar standard variables was added in PxPlus 2019.)
Control Name |
Control Type |
Description |
Px_TitleBar_Caption |
Fonted Text |
Automatically sets and updates the panel caption. |
Px_TitleBar_Close |
Button |
Panel Close button. |
Px_TitleBar_Max |
Button |
Maximize/Restore button. Unlike the standard Windows button that changes images based on the window state, this button supports only one image. |
Px_TitleBar_Min |
Button |
Panel Minimize button. |
Px_TitleBar_SysMenu |
Button |
System Menu button. The system menu consists of the Restore/Move/Size/Minimize/Maximize/Close options that are usually associated with the Application icon in the upper left corner of the standard Windows title bar. |
If you use your own names for the standard controls, you will have to supply your own logic for processing. In addition, you will have to hide/show/enable/disable the appropriate buttons, depending on the settings for the panel being displayed.
If you want to use a colored background on your title bar with transparent buttons, be sure to use the 4D Visual Effect for your application. This can be set in Library Defaults (Display tab), or you can set the %NOMADS'Visual_Override property to 4.
At run time, the title bar will be stretched horizontally to span the panel being displayed. Therefore, the title bar panel should be defined as Custom Resize, and the various controls that should be extended horizontally should be set to Stretch. The other Fixed Size controls can be anchored to a side or left to float. The title bar will not grow vertically.
Custom title bars can be assigned at several hierarchical levels within an application, which allows you to customize different aspects of your application and give each one its own unique look and feel. You can also use the same hierarchical levels to prevent panels from displaying the title bar.
These hierarchical levels are:
Level |
Description |
General |
Assign a title bar panel to the %NOMADS'TitleBar$ property to apply the title bar system wide. The title bar is assigned by specifying the panel name and library name, separated by a comma. Example: %NOMADS'TitleBar$="TitleBarHdr,mylib" |
Library |
Assign a title bar in Library Defaults to apply a specified title bar to all panels in the library. This allows you to have a different look and feel for different aspects of your application. You can also set the Library option to prevent the panels in that library from displaying title bars set at the General level. Note: |
Panel |
Assign a title bar in the Panel Header to apply a specified title bar to that panel or to prevent the panel from displaying any title bar. Note: |
Important Note: |
When a custom title bar is used, it is displayed above the contents of the current panel being displayed. The title bar is stretched horizontally to fill the width of the panel.
If a standard Windows title bar with a caption is used, this will be displayed at the very top of the panel, followed by the menu bar (if one has been defined for the current panel), followed by the custom title bar, and finally, the contents of the current panel.
Example:
If the standard Windows title bar is replaced using a caption-less Frame Style, certain Windows behaviours that are dependent on the caption bar will no longer be available or will be available in a different format. For example, the custom title bar will have no indication to show which panel is active, unlike the Windows caption bar that is dimmed when inactive. In addition, double-clicking the custom title bar will not maximize/restore the panel, nor will moving the panel against the top of the screen. Finally, moving the panel by clicking and dragging the Windows caption bar will be replaced by implementing Full Screen Drag, which allows you to move the panel by clicking and dragging any blank area of the panel.