Color of DCCHECKBOX
Color of DCCHECKBOX
Hi,
is a way to change color of check box in DCCHECKBOX (and in DCRADIOBUTTON)? For example, I want that check box will be yellow when is edit protect, and white (normal) when no. I know, that when use clause WHEN the check box can be grayed, but this is for me not useful.
Regards
Piotr
is a way to change color of check box in DCCHECKBOX (and in DCRADIOBUTTON)? For example, I want that check box will be yellow when is edit protect, and white (normal) when no. I know, that when use clause WHEN the check box can be grayed, but this is for me not useful.
Regards
Piotr
Re: Color of DCCHECKBOX
Hi, Piotr.
Just add a COLOR-codeblock:
This will color the text and the background of the checkbox and/or radio button, not the controls themselves.
Just add a COLOR-codeblock:
Code: Select all
@ 1,1 DCCHECKBOX lWhatever PROMPT 'Check this' COLOR {||{GRA_CLR_WHITE,GRA_CLR_RED}} // same with DCRADIO
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Color of DCCHECKBOX
Tom,
the COLOR work fine, but only for caption (text). I want change color only for the check box (inside).
Piotr
the COLOR work fine, but only for caption (text). I want change color only for the check box (inside).
Piotr
Re: Color of DCCHECKBOX
This is something you can't do when working with standard Xbase parts. You will have to use a different control.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Color of DCCHECKBOX
You could simulate this by creating a set of bitmaps with different colors.
They would need to look like a checkbox.
They would need to look like a checkbox.
The eXpress train is coming - and it has more cars.
Re: Color of DCCHECKBOX
not sure which Part you mean with "inside" "Check" in Checkbox itself on left side is a Bitmap and depend on visual StylePiotr D wrote:the COLOR work fine, but only for caption (text). I want change color only for the check box (inside).
Frame with Text are Font-Color where Font-Color itself can´t be change
"green" is what i have try "to paint" ... but it is not stable this Way.
what you need is Ownerdraw ... it is "just" a Button.
---
Roger talk about seperat Image to show Status.
as i know Express++ have "PUSHLIKE" Style for Button this is also possible with Checkbox, Radio and 3-State Button.
greetings by OHR
Jimmy
Jimmy
Re: Color of DCCHECKBOX
Jimmy,
"inside" I understand stricte. I mean about pool inside small frame, a background for check, which is ever white.
Piotr
"inside" I understand stricte. I mean about pool inside small frame, a background for check, which is ever white.
Piotr
Re: Color of DCCHECKBOX
Piotr -
Now that I am locked down in my apartment I have few activities that preserve my interests, therefore this little challenge sounds like something that is welcomed. I will write you a sample program.
Now that I am locked down in my apartment I have few activities that preserve my interests, therefore this little challenge sounds like something that is welcomed. I will write you a sample program.
The eXpress train is coming - and it has more cars.
Re: Color of DCCHECKBOX
Here is the sample program that I promised (no bitmaps required) :
Code: Select all
#INCLUDE "dcdialog.CH"
#INCLUDE "dcbitmap.CH"
#INCLUDE "appevent.CH"
#command @ <row>, <col> CHECKBUTTON <checked> CAPTION <caption>;
=> CheckButton( GetList, <row>, <col>, @<checked>, <caption> )
FUNCTION Main()
LOCAL GetList[0], lCheck1 := .f., lCheck2 := .f., lCheck3 := .t.
@0,0 DCSAY 'Check Buttons:' SAYSIZE 0 FONT '10.Arial'
@2,0 CHECKBUTTON lCheck1 CAPTION 'Check me First'
@4,0 CHECKBUTTON lCheck2 CAPTION 'Check me Next'
@6,0 CHECKBUTTON lCheck3 CAPTION 'Check me Last'
DCREAD GUI FIT TITLE 'Check Button Test'
RETURN nil
* ---------
FUNCTION CheckButton( GetList, nRow, nCol, lChecked, cCaption )
LOCAL oButton
@ nRow, nCol DCPUSHBUTTONXP ;
CAPTION {|| IIF(lChecked,'4',' ')} ;
SIZE 5,1.8 ;
ACTION {|a,b,o|lChecked := !lChecked, ;
o:setCaption(IIF(lChecked,'4',' ')), ;
o:bgColor := IIF(lChecked,GRA_CLR_YELLOW,GRA_CLR_WHITE ), ;
o:invalidateRect() } ;
OBJECT oButton ;
FONT '26.ZapFDingBats' ;
GRADIENT 1 REVERSE ;
COLOR nil, IIF(lChecked,GRA_CLR_YELLOW,GRA_CLR_WHITE) ;
CLICKCOLOR nil, GRA_CLR_WHITE ;
BORDERCOLOR GRA_CLR_BLACK ;
RADIUS 10 ;
FOCUSRECT 0
@ DCGUI_ROW, DCGUI_COL + 10 DCSAY cCaption SAYSIZE 0 ;
FONT '16.Arial' ;
EVAL {|o|o:lbClick := {||Eval(oButton:activate)}}
RETURN nil
* ---------
PROC appsys ; RETURN
- Attachments
-
- CheckButton.jpg (20.83 KiB) Viewed 17634 times
The eXpress train is coming - and it has more cars.
Re: Color of DCCHECKBOX
Roger,
Thank you for that tips. This is probably the only right way to achieve the effect I expect. You are (as always) great. I wish you good health.
Regards
Piotr
Thank you for that tips. This is probably the only right way to achieve the effect I expect. You are (as always) great. I wish you good health.
Regards
Piotr