FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Change Disable Fg color
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Change Disable Fg color
Posted: 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.

Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Change Disable Fg color
Posted: Thu Sep 19, 2013 09:38 PM

Should I guess that this is just not possible?

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Change Disable Fg color
Posted: 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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Change Disable Fg color
Posted: Fri Sep 20, 2013 12:14 AM
Here is a sample:

Code (fw): Select all Collapse
   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 ), ) }




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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Change Disable Fg color
Posted: Fri Sep 20, 2013 01: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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: Change Disable Fg color
Posted: Fri Sep 20, 2013 01: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.

Continue the discussion