Page 1 of 1

DCCHECKBOX/DCGROUP with SL1

Posted: Fri Apr 16, 2010 9:47 am
by Tom
Hi, Roger.

I guess, a Get/Set-color-function for checkboxes and groups is needed. If they are placed on the new tabpages (SL1), they/their captions (groups) always appear with the background color returned by GRA_BACKGROUND, and this is NOT the background color of the tabpages (which is white by default). Even if the colors are set for a checkbox (i.e. GRA_CLR_BLACK, GRA_CLR_WHITE) and the checkbox is disabled when the dialog comes up, they have the GRA_BACKGROUND background until they turn to be enabled. BTW, this turns into real sh*t if skins are used (Alaska missed something with AutomationTranslateColor there). This problem appears with DCSAY .. GETs turned into checkboxes with the CHECKGET option aswell.

Tom.

Re: DCCHECKBOX/DCGROUP with SL1

Posted: Sat Apr 17, 2010 8:10 am
by rdonnay
Tom -

I agree with you.
I'm seeing the same problem on my Scrabble project.
I'll see what I can do.

Roger

Re: DCCHECKBOX/DCGROUP with SL1

Posted: Sat Apr 17, 2010 8:22 am
by rdonnay
This is one of those problems where we need Alaska's help.

I can't find a workaround.

Re: DCCHECKBOX/DCGROUP with SL1

Posted: Sat Apr 17, 2010 12:21 pm
by Pablo Botella
Hi Roger,

If you send me a small sample in plain Xbase++ showing the trouble I will add 10 - 12 lines with the workarround. Will be as simple as subclass the parent window and handle the WM_CTLCOLOR... messages ( WM_CTLCOLORBTN in the case of the checkbox)

Regards,
Pablo

Re: DCCHECKBOX/DCGROUP with SL1

Posted: Sat Apr 17, 2010 12:41 pm
by rdonnay
Pablo -

That is very generous of you to offer a fix.
I will send you a small sample soon.
Taking the day off today.

Roger

Re: DCCHECKBOX/DCGROUP with SL1

Posted: Sat Apr 17, 2010 6:03 pm
by Cliff Wiernik
The background color with themes/SL1/tabpage is the GRA_CLR_WHITE by default, it is the LUNA theme color, it is almost white in some places and slightly darker than white in others.

This is what I use for my DCCHECKBOXES. They are on a DCGROUP that is on a DCSTATIC that has the bgcolor of XBPSYSCLR_TRANSPARENT.

Code: Select all

To configure based on whether I want themes or not:

  IF m->G_lUseThemeTabPage
    m->G_nBGColor := XBPSYSCLR_TRANSPARENT
  ELSE
    m->G_nBGColor := GRA_CLR_BACKGROUND
  ENDIF

 Actual DCCHECKBOX:

    @ 1,1 DCCHECKBOX PROMPT 'Canada' ;
               COLOR {|| LB_CheckBoxColor()}

FUNCTION LB_CheckBoxColor():

  FUNCTION LB_CheckBoxColor(lUseTheme)
    LOCAL aColors

    DEFAULT lUseTheme TO .T.
    IF LB_IsThemeActiveTabPage() .AND. lUseThem
      aColors := {GRA_CLR_BLACK, m->G_nBGColor}                       // this is set to XBPSYSCLR_TRANSPARENT if I want themes in use
    ELSE
      aColors := {GRA_CLR_BLACK,GRA_CLR_BACKGROUN}
    ENDIF

  RETURN aColors


This appears to work properly for me. The same type of problem occurs with color highlights. I had to change it to not repaint in GRA_CLR_BACKGOUND to remove the highlites. That is why Roger added to code to post your own repainting code for this. To allow me to override the standard methodology that does not work with themes.

Cliff