Change Disable Fg color

Change Disable Fg color

Postby reinaldocrespo » Wed Sep 18, 2013 10:32 pm

Hi everyone;

When a control is disabled, it shows in a shade of gray --as it should and as the expected windows behavior. Having said that however, here is an unusual question: is there a way to disable a BUTTONBMP control object and yet change the text (fg) color? How?

Thank you for any help;


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Change Disable Fg color

Postby reinaldocrespo » Thu Sep 19, 2013 9:38 pm

Should I guess that this is just not possible?
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Change Disable Fg color

Postby James Bott » Thu Sep 19, 2013 11:30 pm

I'm not sure I understand the question. Does your bitmap button have a text bitmap? Or, is there such a thing as a bitmap button that also has text (I don't remember seeing such a button)?

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Change Disable Fg color

Postby reinaldocrespo » Fri Sep 20, 2013 12:14 am

Here is a sample:

Code: Select all  Expand view

   REDEFINE BUTTONBMP ID 202 OF ::oDlg BITMAP "exit16" TEXTLEFT ;
      ACTION ::oDlg:END() CANCEL ;
      TOOLTIP "Exit Dialog"

   REDEFINE BUTTONBMP oBtn ID 201 OF ::oDlg BITMAP "Save16" TEXTLEFT ;
      TOOLTIP "Save Sample Login Information"

   oBtn:bAction := { || ::SavePatientInfo(), ;
      iif( ::bOnSave != NIL, EVAL( ::bOnSave, SELF ), ) }

 


Image

When oBtn is disabled ( as in oBtn:disable() ) text shows in gray -as expected. The question is: is there any way to show foreground text on some other color when the button is disabled?


Reinaldo
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Change Disable Fg color

Postby James Bott » Fri Sep 20, 2013 1:31 pm

Rienaldo,

According to Microsoft's documentation, there is a color setting for this:

COLOR_GRAYTEXT Disabled (gray) text in buttons. This color is set to 0 if the current display driver does not support a solid gray color.


See here: http://msdn.microsoft.com/en-us/library ... 41(v=vs.85).aspx

I hope this helps.

--------------------

I note that you are using a button labeled "Exit." Assuming this is on some type of a data entry screen, this is not the Windows standard--"exit" is reserved only for exiting a program. When you use it elsewhere it is confusing to the user.

If the screen is modal, standard terms are "OK" and "Cancel." I am assuming your example is a non-modal window, and in this case the standard terms would be "Save" and "Close."

Just FYI.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Change Disable Fg color

Postby reinaldocrespo » Fri Sep 20, 2013 1:35 pm

standard terms are "OK" and "Cancel."


Always good to be reminded. I should be paying more attention to this.

Thank you very much.


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 107 guests