1. Colin Cruikshank
  2. PowerBuilder
  3. Monday, 5 October 2020 13:32 PM UTC

Hello,

I have a mousemove script that changes the colour of the column header on a grid datawindow to indicate that the column header is clickable for sorting. The column header is a text control. I now want to use the theme feature, so in order to facilitate this, I have applied an expression with a modify statement to change the backcolour when the cursor hovers over. It is not working, however, when the theme is applied. Here is the code:

If Right( dwo.Name, 2 ) = '_t' AND &
    pos( band_at_pointer, 'header', 1 ) > 0 AND &
    this.Object.DataWindow.Processing = string( 1 ) Then
    //They are hovering over a sortable dw grid column header
    string rs
    rs = this.Modify( dwo.Name + '.background.color="0~tRGB(0,0,255)"')

.....

The modify statement is succeeding ( returning an empty string ), but the back color is not changing. Futher, when I add the expression on the text control right in the painter, it still does not change. Interestingly enough, if I change the modify statement to:

rs = this.Modify( dwo.Name + '.color="0~tRGB(0,0,255)"')

The font color changes. In the article on Themes, the following statement about datawindows seems to indicate that I can override the text fields back colour:

"The settings of the background color and font color of Column, Text, Computed Field, and GroupBox controls by expression or the modify function has higher priorities than the theme settings (settings in the painter have no effect)."

Am I missing something horribly obvious here? I am using PowerBuilder 2019 R2 Build 2328.

Thanks in advance.

Accepted Answer
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Monday, 12 October 2020 09:00 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Colin,

In order to make the background color of the Text object in the Header band in a Gird DW more consistent, it is not supported to modify the text background color in the Header band in PB Theme.

If you would like the special effects when hovering the mouse over the text object in the Header Band, I suggest you: modify the Font Color/Bold/Size, etc. of the text object to work it around.


Regards,
Ken

Comment
There are no comments made yet.
Colin Cruikshank Accepted Answer Pending Moderation
  1. Tuesday, 13 October 2020 13:07 PM UTC
  2. PowerBuilder
  3. # 1

Thank you Ken for a definitive answer. I will look for an alternative.

 

Colin

Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Monday, 5 October 2020 21:08 PM UTC
  2. PowerBuilder
  3. # 2

Hi Colin,

Just a guess, but you might confirm that <object>.background.mode=0

Based on the documentation, what you are trying should work...

Comment
  1. Colin Cruikshank
  2. Tuesday, 6 October 2020 15:21 PM UTC
Confirmed that mode was 0, no change.



I wonder if this is a bug in the Theme feature?
  1. Helpful
  1. Ronnie Po
  2. Tuesday, 6 October 2020 17:09 PM UTC
It might be a bug. It's probably not a bad idea to report it in a support ticket.



This shouldn't make a difference, but I'd give this a try just to see if it has an effect:



rs = this.Modify( dwo.Name + '.color=' + string(rgb(0,0,255)))
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.