Colores del get en pantalla

Colores del get en pantalla

Postby noe aburto » Tue Nov 22, 2011 5:14 pm

Saludos

Tengo un problema con varios usuarios que por falta de buena vision no alcanzan a leer bien los gets en pantalla, los gets toman el color gris opcaco cuando no estan siendo editados o que son modo READONLY o el WHEN es falso.

Que podria hacer para que en general los gets tomen el color que yo defina en GET.... COLOR .....
aunque solamente los este desplegando y no editando.

Tengo esto:

oCtrl:SetColor(COLOR_NEGRO,COLOR_BLANCO) // no funciona, lo defino en cada get

y para ql que tiene el foco:

oCtrl:bGotFocus:={|oGet|oGet:SetColor(COLOR_NEGRO,if(oGet:cToolTip<>NIL,COLOR_SAMARILLO,COLOR_AMARILLO))
oCtrl:SetColorFocus(COLOR_AMARILLO)

[img][/c:\tmp\gets.bmp]
Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
User avatar
noe aburto
 
Posts: 418
Joined: Wed Nov 26, 2008 6:33 pm
Location: Morelia, Mich. Mexico.

Re: Colores del get en pantalla

Postby fgondi » Tue Nov 22, 2011 5:24 pm

Yo uso SetColor para cambiar el color de los get's desabilitados y me funciona bien.

Pero lo hago despues de definir la ventana
Code: Select all  Expand view
Activate Window oWnd
oGet:SetColor(


O en el On Init si es un diálogo
Code: Select all  Expand view
Activate Dialog oDlg On Init ( oGet:SetColor ...
Un saludo
Fernando González Diez
ALSIS Sistemas Informáticos
User avatar
fgondi
 
Posts: 694
Joined: Fri Oct 07, 2005 6:58 am
Location: Palencia, España

Re: Colores del get en pantalla

Postby noe aburto » Tue Nov 22, 2011 7:04 pm

Asunto resuelto.

La clase get maneja la varible :lDisColors que por inicio tien el valor .T., entonces lo que hago es

oGet:lDisColor:=.f.

ello obliga al get a tomar sel setcolor() los colores que le defino, de lo contrario hace esto:

SetTextColor(:nHD, GetSysColor(COLOR_GRAYTEXT))
Noé Aburto Sánchez
Tec. Prog. de Sistemas. -Morelia, Mich. México.
fwh 20.06, Harbour 3.2.0, bcc 7.4
TsBrowse 9.0, TsButton 7.0, xEdit 6.1
naburtos@gmail.com, noeaburto67@hotmail.com
User avatar
noe aburto
 
Posts: 418
Joined: Wed Nov 26, 2008 6:33 pm
Location: Morelia, Mich. Mexico.

Re: Colores del get en pantalla

Postby lubin » Tue Nov 22, 2011 7:28 pm

Hola Noe

En mi caso lo que hice fue cambiar la clase TGET agregando algunos cambios, de esa manera sin cambiar nada en los 1,700 Gets que tenia en mi sistema los Inhabilitados pasaban a tener un color mas legible, luego del cambio, ahora cada vez que compilo mi prg, adiciono el TGET.PRG, y listo, espero te sirva de algo :

1. Para poner color al Get inhabiitado cambie el metodo Paint()

Code: Select all  Expand view

//----------------------------------------------------------------------------//

METHOD Paint() CLASS TGet

   local aInfo := ::DispBegin()
   local hOldFont

   if ::oBrush != nil
      FillRect( ::hDC, GetClientRect( ::hWnd ), ::oBrush:hBrush )
   else
      CallWindowProc( ::nOldProc, ::hWnd, WM_ERASEBKGND, ::hDC, 0 )
   endif

   if IsWindowEnabled( ::hWnd )
      CallWindowProc( ::nOldProc, ::hWnd, WM_PAINT, ::hDC, 0 )
   else
      ***===>>>>>>>>>>> ESTAS LINEAS DEL IF  FUERON ANULADAS PARA PONER COLOR A TODOS LOS GETS EN DISABLE
      *if ::lDisColors
      *   SetTextColor( ::hDC, GetSysColor( COLOR_GRAYTEXT ) )
      *   SetBkColor( ::hDC, GetSysColor( COLOR_WINDOW ) )
      *else
         ** Cambio de Colores cuando el Get esta deshablitidado  (lubin)
         SetTextColor( ::hDC,RGB(128,0,0)   )  &&  SetTextColor( ::hDC, ::nClrText )
         SetBkColor( ::hDC, RGB(234,238,242) )   && SetBkColor( ::hDC, ::nClrPane )
      *endif
      if ::oFont != nil
         hOldFont = SelectObject( ::hDC, ::oFont:hFont )
      endif

      do case
         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_CENTER )
              SetTextAlign( ::hDC, TA_CENTER )
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 - GetSysMetrics( SM_CYHSCROLL ) ) / 2,;
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              else
                 ExtTextOut( ::hDC, 1, ( ::nWidth() - 3 ) / 2,;
                   { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif

         case lAnd( GetWindowLong( ::hWnd, GWL_STYLE ), ES_RIGHT )
              SetTextAlign( ::hDC, TA_RIGHT )
              if ::lSpinner
                 ExtTextOut( ::hDC, 1, ::nWidth() - 7 - GetSysMetrics( SM_CYHSCROLL ),;
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              else
                 ExtTextOut( ::hDC, 1, ::nWidth() - 7,;
                    { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
              endif

         otherwise
              SetTextAlign( ::hDC, TA_LEFT )
              ExtTextOut( ::hDC, 1, 2,;
                { 0, 0, ::nHeight(), ::nWidth() }, GetWindowText( ::hWnd ) )
      endcase

      if ::oFont != nil
         SelectObject( ::hDC, hOldFont )
      endif
   endif

   if ValType( ::bPainted ) == "B"
      Eval( ::bPainted, ::hDC, ::cPS, Self )
   endif

   ::DispEnd( aInfo )

return 1

 
User avatar
lubin
 
Posts: 439
Joined: Fri Dec 09, 2005 12:41 am
Location: Lima, Peru

Re: Colores del get en pantalla

Postby acuellar » Tue Nov 22, 2011 10:35 pm

Noe
con esto le da color al get que tiene el focus
Code: Select all  Expand view

SetGetColorFocus(RGB(238,232,170))
 


Saludos,

Adhemar
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1599
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia

Re: Colores del get en pantalla

Postby Daniel Garcia-Gil » Tue Nov 22, 2011 11:56 pm

Hola

revisa el ejemplo testget3.prg

Code: Select all  Expand view
  oGet3:lDisColors      := .f.       // Deactive disable color
   oGet3:nClrTextDis     := CLR_WHITE // Color text disable status
   oGet3:nClrPaneDis     := CLR_BLUE  // Color Pane disable status
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 29 guests

cron