1. Philippe BUCAILLE
  2. Beta Testing
  3. Friday, 14 February 2020 09:43 AM UTC
I have an application divided into 3 areas with separate graphic charters.
 
If I open a window in an area by selecting the theme, the windows already open in the other areas are refreshed with the new theme selected.

Is it possible to use several themes in the same application?
 
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Friday, 14 February 2020 19:04 PM UTC
  2. Beta Testing
  3. # 1

Hi Phillepe;

  Yes, you can!

  The approach would be to create your own "sub-themes" and name them ... as "Theme_xxxx.json. For example "theme-employee.json", "theme-Customer.json", etc. Then copy these theme files into the folder that is driving the main theme to be used. for example "Flat Blue Design".

   In the sub-theme files, you can target each area of your application by object reference. For example:

{
 "meta-info":
 {
  "version":"190"
 },
 "wn_employee_main":
    {
        "drawing":false,
        "default-style":true,
        "normal-state":
        {
            "background-color":"#E6E6E6",
            "border-color":"#B3B3B3"
        },
        "disabled-state":
        {
            "background-color":"#E6E6E6",
            "border-color":"#CCCCCC"
        }
    },
    "uo_custom_object":
    {
        "drawing":false,
        "default-style":true,
        "normal-state":
        {
            "background-color":"#E6E6E6",
            "border-color":"#B3B3B3"
        },
        "disabled-state":
        {
            "background-color":"#E6E6E6",
            "border-color":"#CCCCCC"
        }
    }
}

 

 When you use the ApplyTheme() command, the PB run-time will automatically search for all Theme_xxx.json file variations. If it finds a reference to a window or control name (as in the example from above), the sub-theme feature will over-ride the main theme for your named Window or Control Class with its specific look & feel from the sub-theme json declaration. In essence, over-riding the main theme.

Note: The above theme feature override will only work in PB2019R2

HTH

Regards ... Chris

Comment
  1. Philippe BUCAILLE
  2. Monday, 17 February 2020 15:23 PM UTC
Thank you for your reply.

I have seen this technique work very well.

However, our application has more than 400 windows. I have to define a json file for each window, it is much too cumbersome to implement.

The idea may be to dynamically create the JSON file when the window is first opened compared to a reference file.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Monday, 17 February 2020 19:39 PM UTC
Hi Phillippe;

Suggestion: write a small PB utility to walk through a PBL and generate the appropriate "Theme_xxxx.json" file for each Window/Control sequence you require.

Regards ... Chris
  1. Helpful
There are no comments made yet.
René Ullrich Accepted Answer Pending Moderation
  1. Friday, 14 February 2020 10:07 AM UTC
  2. Beta Testing
  3. # 2

Hi Philippe,

AFAIK you can't use different themes in the same application.

But PB 2019 R2 (currently Beta) allows to specify settings by window class. So you may specify different settings for the windows in your areas in one theme!

https://www.appeon.com/developers/pb-2019r2-beta.html

 

HTH,

René 

Comment
  1. Armeen Mazda @Appeon
  2. Friday, 14 February 2020 16:12 PM UTC
Rene is exactly right. Try the beta of 2019 R2 on a different test machine and see. You also might find it helpful to read the related documentation: https://docs.appeon.com/appeon_online_help/pb2019r2/pbug/ch04s04.html#Configuring_theme_settings_for_individual_controls
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.