1. Valdas Vaitiekaitis
  2. PowerBuilder
  3. Monday, 7 June 2021 14:45 PM UTC

How do I modify theme of an object, that is added with function OpenUserObject(), like this:

uo_StaticText luo_StaticText
THIS.OpenUserObject(luo_StaticText, 270, 380)

 

I've made a custom theme-custom.json file in my theme folder, it looks something like this:

{
"meta-info":
{
"version":"190"
},
"w_themestest_main$statictext":
{
"drawing":false
},
"w_themestest_main$userobject":
{
"drawing":false
}
}

It does disable theme for objects that are added via IDE, but I can't figure out how to modify object added with OpenUserObject().

Please see attached sample project.

I also tried "w_themestest_main$uo_statictext" and "uo_statictext", does not work either...

Any ideas?

 

Attachments (1)
Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 7 June 2021 15:49 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Valdis;

  Unfortunately, that is theme feature is not supported as even when you create an over-riding theme extension, the object name and it's parent have to be known before the Theme is enabled. In your case, the OpenUserObject() is using a dynamic pointer. However, it even gets worse as you progress into a full dynamic class name user object instantiation, for example:

  • DragObject lo_open
  • string       ls_name
  • ls_name = sle_user.Text
  • THIS.OpenUserObject (lo_open, ls_name, 100, 200)

  In both cases, this would (AFAIK) require an enhancement to the PBVM (runtime) as say something like for example a new Theme.Refresh() command that the PB App could call after a visible dynamic object(s) are created (ie OpenUserObject, OpenTabPage, etc).

Regards ... Chris

Comment
  1. Valdas Vaitiekaitis
  2. Tuesday, 8 June 2021 05:09 AM UTC
But if I modify main theme.json file and set "statictext":{"drawing":false} then it works, why override theme extension does not?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Tuesday, 8 June 2021 15:08 PM UTC
Yes, that would work as it affects *any* class of type "static text" regardless of the current instantiated name.
  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.