1. Steven Green
  2. PowerBuilder
  3. Tuesday, 19 October 2021 02:23 AM UTC

Hi, I wanted to create my own custom theme in Powerbuilder 21

Inside "C:\Program Files (x86)\Appeon\PowerBuilder 21.0\IDE\theme", I have copied over the "Flat Design Blue" in the same directory and named it something else.

In the new custom theme.json file, I deleted all the contents in it.

From the Flat Design Blue theme.json file, I copied "checkbox" and pasted it into my custom theme.json file, however it fails to apply this specific theme. Any idea why this is happening?

 

Here is what was copied over:

 ```

"checkbox":
    {
        "drawing":true,
        "normal-state":
        {
            "text-font":{"color":"#000000"},
            "box-images":
            {
                "unchecked":{"file":"checkbox-box-normal-unchecked.bmp"},
                "checked":{"file":"checkbox-box-normal-checked.bmp"},
                "indeterminate":{"file":"checkbox-box-normal-indeterminate.bmp"}
            }
        },
        "hover-state":
        {
            "text-font":{"color":"#000000"},
            "box-images":
            {
                "unchecked":{"file":"checkbox-box-hover-unchecked.bmp"},
                "checked":{"file":"checkbox-box-hover-checked.bmp"},
                "indeterminate":{"file":"checkbox-box-hover-indeterminate.bmp"}
            }
        },
        "pressed-state":
        {
            "text-font":{"color":"#000000"},
            "box-images":
            {
                "unchecked":{"file":"checkbox-box-pressed-unchecked.bmp"},
                "checked":{"file":"checkbox-box-pressed-checked.bmp"},
                "indeterminate":{"file":"checkbox-box-pressed-indeterminate.bmp"}
            }
        },
        "focused-state":
        {
            "text-font":{"color":"#000000"},
            "box-images":
            {
                "unchecked":{"file":"checkbox-box-focused-unchecked.bmp"},
                "checked":{"file":"checkbox-box-focused-checked.bmp"},
                "indeterminate":{"file":"checkbox-box-focused-indeterminate.bmp"}
            }
        },
        "disabled-state":
        {
            "text-font":{"color":"#999999"},
            "box-images":
            {
                "unchecked":{"file":"checkbox-box-disabled-unchecked.bmp"},
                "checked":{"file":"checkbox-box-disabled-checked.bmp"},
                "indeterminate":{"file":"checkbox-box-disabled-indeterminate.bmp"}
            }
        }
    }

```

Benjamin Gaesslein Accepted Answer Pending Moderation
  1. Tuesday, 19 October 2021 12:13 PM UTC
  2. PowerBuilder
  3. # 1

Hi Steven,

try a validator like https://jsonlint.com/ to look for issues with your JSON file.

You say you "deleted all the content" and pasted this in, so is this your entire file? If so, it's not complete and there's a trailing comma even though "checkbox" is the last key. You have to have at least this:

{
	"meta-info":
	{
		"version":"190"
	},
	"checkbox":
	{
		
	}
}

 

The theme.json file (or any JSON string, for that matter) consists of a JSON object literal that contains a comma-seperated list of key/value pairs. Keys must be unique strings while values can be various datatypes, including JSON objects. See https://www.json.org/json-en.html 

 

Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Tuesday, 19 October 2021 15:53 PM UTC
  2. PowerBuilder
  3. # 2

In the past I tried something similar by deleting everything and only leaving in what I needed to be changed, but that didn't work.

It needs 'everything', and with your modifications made inside of that. Correct me if I'm wrong.

Comment
  1. Steven Green
  2. Wednesday, 20 October 2021 00:22 AM UTC
So I copied everything over but I disabled the checkbox to be false for the drawing setting. However when I launch my software, the checkbox is still being applied.



I know there are settings and inside of them they have checkboxes as well, which one am I looking for?
  1. Helpful
  1. Benjamin Gaesslein
  2. Wednesday, 20 October 2021 08:13 AM UTC
Datawindow columns with the Checkbox edit style, maybe? Listviews can have checkboxes, too, I think. Just [Ctrl]+[F] for "checkbox" and you should find the settings. Not all of them can be toggled off individually, I think.
  1. Helpful 1
  1. Miguel Leeuwe
  2. Wednesday, 20 October 2021 08:34 AM UTC
Hi Steven, I'll try to do something similar myself (today), whenever I get some time. Meanwhile, could you try to customize something else and see if that works? I'm saying it because I think that checkboxes are a bit funny with background colors even without themes if they are 3d, they don't show background color changes, if I remember well.

  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 19 October 2021 16:11 PM UTC
  2. PowerBuilder
  3. # 3

Hi Steven, You need the full themes.json content but set the rest of the controls to disabled...

drawing":false

...as outlined in this tech article: https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/301-applying-a-new-ui-theme-to-your-application-2

 

Comment
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.