Specifying a theme for the application UI
You can apply one of the following themes to the window,
DataWindow, and all visual controls (except Line, Oval, Rectangle,
RowndRectangle, Picture, PictureHyperLink, and Animation) in your
application.
-
Flat Design Blue — this theme is evolved from the Windows
10 style, featuring a flat design style in contrasting to a
prominent UI content. The window style is similar to that of
Windows 10. The controls are flattened, and the color is gray in
the normal state, and blue in the default state, making a more
visually appealing and recognizable UI. -
Flat Design Grey — this theme is based on the original
PowerBuilder style. It retains most of the color matching of the
controls, and removes their 3D effect so they are flattened; the
window is displayed in a gray background, making the UI convenient
for users to read the improves user experience. -
Flat Design Silver — this theme is a combination of the
modern designs. The theme removes the control border, and divides
controls by shallow color blocks, making the UI more concise and
focused.
If no theme is applied or if the theme is unsupported for a
control, the style of windows, DataWindow, and controls will be
determined by the Windows operating system.
| Do not use theme | Flat Design Blue | Flat Design Grey | Flat Design Silver | |
|---|---|---|---|---|
| Window background color | Light grey | White | Grey | White |
| Font color | Black | Black | Black | Silver Black |
| Control background color | System | White | White | White or Shallow Color Block |
| Button | System | 2D | 2D | 2D |
| Border | 3D | 2D | 2D | No Border |
| Border thickness | 1 pixel | 1 pixel | 1 pixel | No Border |
To select a theme:
-
In the Application painter, select the General tab
page. -
On the General tab page, click the Additional Properties
button to display the Application properties dialog box. -
In the Application properties dialog box, select the Themes
tab, and then select a theme from the list.Three system themes are provided by default. You can
customize these system themes or use your own themes. -
Preview how UI will look like after a theme is
applied. -
Click OK.
To customize or create a theme:
-
Locate the “theme180” folder in the
“AppeonSharedPowerBuilder” directory.There are by default three sub-folders; each represents one
type of UI theme: Flat Design Blue, Flat Design Grey, and Flat
Design Silver. You can add your own themes here. -
Open the sub-folder for the type of the UI theme you want to
customize.Each sub-folder contains a bunch of image files which
represent the state (checked, unchecked, indeterminate, enabled,
disabled, hover, pressed etc.) of the controls, DataWindow and
window and a “theme.json” file which is configurable for the theme
settings (such as color, state, border, text etc). -
In the “theme.json” file, adjust the UI theme settings for
the controls, DataWindow and window.If you want to permanently keep your settings, it is
recommended that you add a sub-folder that contains the image
files and the “theme.json” file. The sub-folder name will be
automatically recognized as a custom theme and listed for
selection in the Themes tab.If you directly make changes to the system theme and
unpredictable problem occurs, you can click the Restore button to
restore the system theme.
To make the theme effective:
-
Click the Run or Select and Run button on the PowerBar to
run the application and see the UI effect of the selected
theme.The UI theme only takes effect at runtime, not at the
development stage or under preview.Note
When you build the application, you should not check the
“Windows classic style” option. If “Windows classic style” is
selected, the application UI will be rendered in the Windows
classic style instead of the selected theme. The “Windows
classic style” option takes precedence over the selected
theme.Note
When creating the application installation package, the
“theme180” folder (just like the other resource files) must be
manually copied to the root of the application installation
directory.
You can also get or set a theme in scripts by calling the system
function GetTheme or ApplyTheme. For more, see the section called “GetTheme” in PowerScript Reference and
the section called “ApplyTheme” in PowerScript Reference.