|
Home > Archive > dBASE Questions and Answers > August 2005 > Disabled color
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| eric wu 2005-08-03, 8:24 pm |
| when a component is disabled on a form ,the system will automatically make
the charactor color lighter.
In WindowsXP , the color looks too light .
Is there a way to tell the system to use other color a little bit dark ?
| |
| Robert Bravery 2005-08-03, 8:24 pm |
| HI,
Use the when event, return false, then you can set the control to any color
you want
Robert
"eric wu" <ericwuu@hotmail.com> wrote in message
news:D4oJhJGmFHA.1188@news-server...
> when a component is disabled on a form ,the system will automatically make
> the charactor color lighter.
> In WindowsXP , the color looks too light .
> Is there a way to tell the system to use other color a little bit dark ?
>
>
>
| |
| Dan Bernard 2005-08-03, 8:24 pm |
| Eric,
I usually create a function called "onoff" within my forms, it looks
something like this:
function onoff
parameters state
if state = false
setstate = {;return false}
setcolor = "black/silver"
form.field1.when = setstate
form.field2.when = setstate
form.field3.when = setstate
*
form.field1.colornormal = setcolor
form.field2.colornormal = setcolor
form.field3.colornormal = setcolor
else
setstate = {;return true}
setcolor = "black/lightskyblue"
form.field1.when = setstate
form.field2.when = setstate
form.field3.when = setstate
*
form.field1.colornormal = setcolor
form.field2.colornormal = setcolor
form.field3.colornormal = setcolor
*
form.field1.setfocus()
endif
return
I initially set the "when" property to return false and the color to my
choice for disabled. It may seem like a lot of work but now everywhere you
want to turn a set of fields on or off simply:
class::onoff(true) or class::onoff(false)
Hope that helps,
Dan
"eric wu" <ericwuu@hotmail.com> wrote in message
news:D4oJhJGmFHA.1188@news-server...
> when a component is disabled on a form ,the system will automatically make
> the charactor color lighter.
> In WindowsXP , the color looks too light .
> Is there a way to tell the system to use other color a little bit dark ?
>
>
>
| |
| eric wu 2005-08-03, 8:24 pm |
| Thank you all for help.
But I hope there's an easier way to change the color for disabled components
..
where does the system ( dBase or Windows ) store the info of the color# for
disabled components ?
I guess if I can access and modify the info , then all color will be
changed.
?
"eric wu" <ericwuu@hotmail.com> wrote in message
news:D4oJhJGmFHA.1188@news-server...
> when a component is disabled on a form ,the system will automatically make
> the charactor color lighter.
> In WindowsXP , the color looks too light .
> Is there a way to tell the system to use other color a little bit dark ?
>
>
>
| |
| Gerald Lightsey 2005-08-04, 3:23 am |
| On Wed, 3 Aug 2005 16:10:51 -0500, in the dbase.how-to group, eric wu
said...
> Thank you all for help.
> But I hope there's an easier way to change the color for disabled components
> .
>
> where does the system ( dBase or Windows ) store the info of the color# for
> disabled components ?
> I guess if I can access and modify the info , then all color will be
> changed.
> ?
Prototype the required API call...
if type('GetSysColor') # 'FP'
extern culong GetSysColor( cint ) user32
endif
determine colors...
nInactiveBorder = GetSysColor( 11 ) //Border of inactive window
nInactiveCaption = GetSysColor( 3 ) // Caption of inactive window
nInactiveCaptionText
= GetSysColor( 19 ) // Text of inactive window
Then once you get the existing values you will need to determine the
color values you want to set them to and use the SetSysColors API to set
them as you want.
Then you would be a poor programmer if you changed your customer's
system colors and did not change them back when your PLUS application
closes so you will need to set all of the system colors back in the
canClose method of your main form.
All in all this appears to be more work than the solution Dan Bernard
provided to you that works only within the PLUS environment. If you are
presumptuous enough to change your customer's Windows system colors it
affects every application that your customer runs-multitask while your
PLUS application is running. If I were your customer I would not be
pleased with your programming approach.
Gerald
| |
| eric wu 2005-08-04, 9:25 am |
| Thank you very much!
does the codes work also in Visual dBase 5.7 ?
"Gerald Lightsey" <glightsey1@cox.net> wrote in message
news:MPG. 1d5b4706fea7bd079898
65@news.dbase.com...
> On Wed, 3 Aug 2005 16:10:51 -0500, in the dbase.how-to group, eric wu
> said...
>
> Prototype the required API call...
> if type('GetSysColor') # 'FP'
> extern culong GetSysColor( cint ) user32
> endif
>
> determine colors...
> nInactiveBorder = GetSysColor( 11 ) //Border of inactive window
> nInactiveCaption = GetSysColor( 3 ) // Caption of inactive window
> nInactiveCaptionText
= GetSysColor( 19 ) // Text of inactive window
>
> Then once you get the existing values you will need to determine the
> color values you want to set them to and use the SetSysColors API to set
> them as you want.
>
> Then you would be a poor programmer if you changed your customer's
> system colors and did not change them back when your PLUS application
> closes so you will need to set all of the system colors back in the
> canClose method of your main form.
>
> All in all this appears to be more work than the solution Dan Bernard
> provided to you that works only within the PLUS environment. If you are
> presumptuous enough to change your customer's Windows system colors it
> affects every application that your customer runs-multitask while your
> PLUS application is running. If I were your customer I would not be
> pleased with your programming approach.
>
> Gerald
>
| |
| eric wu 2005-08-04, 1:26 pm |
| I am new to API
sorry I've no luck searching the internet to find out how to use the
SetSysColors API ....
can you show me a smiple example ? Thanks!
"Gerald Lightsey" <glightsey1@cox.net> wrote in message
news:MPG. 1d5b4706fea7bd079898
65@news.dbase.com...
> On Wed, 3 Aug 2005 16:10:51 -0500, in the dbase.how-to group, eric wu
> said...
>
> Prototype the required API call...
> if type('GetSysColor') # 'FP'
> extern culong GetSysColor( cint ) user32
> endif
>
> determine colors...
> nInactiveBorder = GetSysColor( 11 ) //Border of inactive window
> nInactiveCaption = GetSysColor( 3 ) // Caption of inactive window
> nInactiveCaptionText
= GetSysColor( 19 ) // Text of inactive window
>
> Then once you get the existing values you will need to determine the
> color values you want to set them to and use the SetSysColors API to set
> them as you want.
>
> Then you would be a poor programmer if you changed your customer's
> system colors and did not change them back when your PLUS application
> closes so you will need to set all of the system colors back in the
> canClose method of your main form.
>
> All in all this appears to be more work than the solution Dan Bernard
> provided to you that works only within the PLUS environment. If you are
> presumptuous enough to change your customer's Windows system colors it
> affects every application that your customer runs-multitask while your
> PLUS application is running. If I were your customer I would not be
> pleased with your programming approach.
>
> Gerald
>
| |
| Gerald Lightsey 2005-08-06, 8:23 pm |
| On Thu, 4 Aug 2005 09:45:46 -0500, in the dbase.how-to group, eric wu
said...
> I am new to API
> sorry I've no luck searching the internet to find out how to use the
> SetSysColors API ....
> can you show me a smiple example ? Thanks!
I have never used this particular API for the good reasons I gave to you
in my response. I am quite covered up with work at the moment so it
will be a while before I can give you an example of how to do something
I don't advise - like mixing nitroglycerin.
If you don't get the help you want elsewhere I will try to get back to
you later.
While you are waiting, I suggest you check your system colors. It is
possible that your Development PC has been set to some non-standard
inactive colors and that the phenomenon you are observing is not a
problem with the standard inactive colors but rather a problem with the
setting on YOUR PC. There are several things you can check.
1. Use the API calls I gave to you to obtain the numeric system colors.
Convert them to hex with "0x" + itoh(NumericColor). Post your colors
here and ask others to respond with their settings which would confirm
whether your setting are reasonably standard.
2. Settings|Control Panel|Display|Appear
ance|Advanced|Item and check the
colors of the two inactive choices in the drop down.
3. Test your application under development on another PC or two.
There nothing to be gained by "spinning your wheels" over a color
problem and taking an ill-advised approach to change your customer's
settings only to find out that the only PC around that has a problem is
YOUR development PC. Microsoft has a lot of time and effort involved in
determining the default look and feel of Windows. It is not very likely
that they would have selected inactive colors that are totally
unsatisfactory. If you are the only one who is perceiving a problem
then it is altogether likely that the problem is in your environment.
Gerald
| |
| eric wu 2005-08-07, 1:23 pm |
| ThankS!!
"Gerald Lightsey" <glightsey1@cox.net> wrote in message
news:MPG. 1d5c762a5b15cc899898
66@news.dbase.com...
> On Thu, 4 Aug 2005 09:45:46 -0500, in the dbase.how-to group, eric wu
> said...
>
> I have never used this particular API for the good reasons I gave to you
> in my response. I am quite covered up with work at the moment so it
> will be a while before I can give you an example of how to do something
> I don't advise - like mixing nitroglycerin.
>
> If you don't get the help you want elsewhere I will try to get back to
> you later.
>
> While you are waiting, I suggest you check your system colors. It is
> possible that your Development PC has been set to some non-standard
> inactive colors and that the phenomenon you are observing is not a
> problem with the standard inactive colors but rather a problem with the
> setting on YOUR PC. There are several things you can check.
>
> 1. Use the API calls I gave to you to obtain the numeric system colors.
> Convert them to hex with "0x" + itoh(NumericColor). Post your colors
> here and ask others to respond with their settings which would confirm
> whether your setting are reasonably standard.
>
> 2. Settings|Control Panel|Display|Appear
ance|Advanced|Item and check the
> colors of the two inactive choices in the drop down.
>
> 3. Test your application under development on another PC or two.
>
> There nothing to be gained by "spinning your wheels" over a color
> problem and taking an ill-advised approach to change your customer's
> settings only to find out that the only PC around that has a problem is
> YOUR development PC. Microsoft has a lot of time and effort involved in
> determining the default look and feel of Windows. It is not very likely
> that they would have selected inactive colors that are totally
> unsatisfactory. If you are the only one who is perceiving a problem
> then it is altogether likely that the problem is in your environment.
>
> Gerald
|
|
|
|
|