1. Yiannis Papadomichelakis
  2. Beta Testing
  3. Thursday, 20 February 2020 15:22 PM UTC

 

Hi Powerbuilders...!

In order to give a prettier UI, sometimes, I use singleline controls, in combination with roundrectagle controls. The singlelineedit control is without border, so the result could be like this:

When using themes, the controls obey theme colors, but RoundRectangles don't (which of course is good).

As you expect, when using themes, the appearance is ruined. The SingleLineEdit uses the color setting of the theme, while the RoundRectangles uses Window background.

Is it possible to know the real color of a the SingleLineEdit so I can dynamicaly adjust the color of the RoundRectangle?

(You have to assume that the application can use any available theme)

 

Any ideas?

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 20 February 2020 20:57 PM UTC
  2. Beta Testing
  3. # 1

Hi Yiannis;

  Unfortunately, there is no GetThemeXxxxx() methods for individual controls to introspect what theme settings are affecting a specific control. Sounds like your looking for the equivalent of a DataWindow's Describe() command for themes.

  The only way I can think of currently for getting this is information to read the JSON for the active theme and parse these settings out via PowerScript. Not a trivial coding exercise though I am afraid.

Regards ... Chris

 

Comment
  1. Michael Kramer
  2. Thursday, 20 February 2020 21:22 PM UTC
I'm with Chris on this one. You would have to lookup active color by interpreting the JSON files - and understanding how theme features resolves active color value.

AND - it becomes tricky because you can define hover effect using themes so that background color changes as mouse pointer moves across certain controls. So you would need to check for color changes during pointer movement. Difficult to do high performance in regular PowerScript.
  1. Helpful
  1. David Peace (Powersoft)
  2. Friday, 21 February 2020 13:51 PM UTC
Agreed, this is why personally I do not like the Themes implementation. It is moving away from the core values of PB and the runtime environment where the developer could easily evaluate the runtime settings for objects and controls.
  1. Helpful
  1. Yiannis Papadomichelakis
  2. Friday, 21 February 2020 17:26 PM UTC
Well... I can't say that I dont like Themes implementation. I just think that it's NOT mature enough. In many cases, theme will fulfill their purpose... but there are also many cases that will make your life very difficult.

So, I think we need these GetThemeXxxxx() methods Chris...!
  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.