Tabpage Color under 254

This forum is for eXpress++ general support.
Post Reply
Message
Author
edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Tabpage Color under 254

#1 Post by edv-rudrich »

Hi --
(IMPORTANT)

this change:
1084. DCTABPAGE .. COLOR now supports a code block for the foreground and
background colors.

causes extreme trouble in our tabpage coloring!
The xBase methods for setting the color do not work anymore -

And: (from our point of view...) it always DID support codeblocks..

Our code was:
@ 00,00 DCTABPAGE o4TabPage ;
CAPTION "ShF8 - Numbers" ;
PARENT oDlg ;
COLOR {||if(M->USER == "PCH", {GRA_CLR_BLACK, GRA_CLR_BACKGROUND}, {GRA_CLR_BLACK, GraMakeRGBColor({205,205,175})}) }

And we set Tabpage color depending on some vars in the code by:
// Changing Tabpage colors
IF nZNR_Status = 0
o4TabPage:SetColorBG(GRA_CLR_YELLOW)
ELSEIF nZNR_Status = 1
o4TabPage:SetColorBG(GRA_CLR_GREEN)
ELSEIF nZNR_Status = 2
o4TabPage:SetColorBG(GRA_CLR_RED)
ENDIF

This code does not affect the tabpages colors anymore..

Any help or workaround urgently needed!!

- Michael

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Re: Tabpage Color under 254

#2 Post by edv-rudrich »

S T O P

this must have another reason...

I'm working on a test program..

Sorry

- Michael

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Tabpage Color under 254

#3 Post by Tom »

Hi, Michael.

The color with tabpages does not work with SL1 anymore if tabpages use visual styles (default). If Roger finds a color clause inside DCTABPAGE, he switches visual style off for this tabpage. This is what you should do - or add a "dummy" color clause to DCTABPAGE.

Tom
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Re: Tabpage Color under 254

#4 Post by edv-rudrich »

Don't think so:

it must have todo with the change number 1084..

Before (Version 252) : If I set the color with :SetColorBG it 'keeps' the change..
Now: If I now set it with :setcolorBG, it changes back to the original color in the codeblock every time the
getlist is refreshed!!


Try this:
#INCLUDE "dcdialog.CH"

procedure appsys
return

procedure main
Local Getlist := {}
@ 00,00 DCTABPAGE o4TabPage ;
SIZE 100,20 ;
CAPTION "ShF8 - Z-Nummern" ;
COLOR {||{GRA_CLR_BLACK, GraMakeRGBColor({205,205,175})} }

@ 10,10 DCPUSHBUTTON CAPTION "Change Color" SIZE 12,1.2 ACTION {||o4TabPage:SetColorBG(GRA_CLR_RED), sleep(50), DC_GetRefresh(Getlist)} PARENT o4TabPage

DCREAD GUI FIT TITLE "TabTest" ADDBUTTONS to lOK



return

- MIchael

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tabpage Color under 254

#5 Post by rdonnay »

Tom and Michael -

I made 2 changes to the tabpage color system in build 254.

1. Requested by Tom - switch off :visualStyle if a color clause exists.

2. Requested by Brian Wolfsohn - Support Code blocks for color (as documented).

The 2nd issue never did work. It only evaluated the code block when the tabpage was first created but then never after that.
I fixed that, but now that causes a problem for Michael.

The existence of the code block overrides any settings in your code because the code block is always evaluated on a DC_GetRefresh().

Michael - This should fix your problem (make sure your color clause is not a codeblock) :

Code: Select all

@ 00,00 DCTABPAGE o4TabPage ;
CAPTION "ShF8 - Numbers" ;
PARENT oDlg ;
COLOR if(M->USER == "PCH", {GRA_CLR_BLACK, GRA_CLR_BACKGROUND}, {GRA_CLR_BLACK, GraMakeRGBColor({205,205,175})}) 
The eXpress train is coming - and it has more cars.

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Re: Tabpage Color under 254

#6 Post by edv-rudrich »

Roger -

thanks.. yes the second change is what causes my trouble..
The codeblock did only fire the first time when the tab was created..

I could fix it by using a variable for the background like:

if .. <something>
nBackColor := GRA_CLR_RED
else
nBackColor := GRA_CLR_GREEN
endif

and code:
DCTABPAGE bla lba
COLOR {||{GRA_CLR_BLACK, nBackColor} }

and simply change the color by changing the var nBackColor

if <something>
nBackColor := GRA_CLR_SCHWEINCHENROSA
elseif <something else>
nBackColor := GRA_CLR_FROSCHGRÜN
else
nBackColor := GRA_CLR_LASS_WIE_ES_IST
endif


- Michael

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Tabpage Color under 254

#7 Post by rdonnay »

Michael -

Yes, I was going to suggest that as another possible solution.
It looks like you already figured that out.

Roger
The eXpress train is coming - and it has more cars.

edv-rudrich
Posts: 33
Joined: Wed Jan 27, 2010 10:23 pm

Re: Tabpage Color under 254

#8 Post by edv-rudrich »

Roger -

I now changed all the code that way -- was not a big deal...

Pls leave it as it is ;o))

Thks

- Michael

User avatar
Tom
Posts: 1171
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Tabpage Color under 254

#9 Post by Tom »

Hi, Michael.

If you post code to the forum, use the "CODE" button or code-tags to embed it. This is much easier to read:

Code: Select all

FUNCTION Michael(lEverythingWorks)
  IF lEverythingWorks
    FindAReasonToMoanAnyWay()
  ENDIF
RETURN TheRiverNile
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply