Readonly and/or disable GETs background color

Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Thu Aug 04, 2022 7:16 pm

Dear friends, how can I change the readonly and/or disable GETs background color?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby cmsoft » Thu Aug 04, 2022 10:24 pm

Change data
nClrTextDis, nClrPaneDis and lDisColors

Code: Select all  Expand view
#include "fivewin.ch"

FUNCTION Main()
local oForm, oSay, oGet, oGet2, nValue := 0, nValue2 := 0, oBot2
DEFINE DIALOG oForm TITLE "Background Disable gets" FROM 05,15 TO 13,70
@ 05,70 GET oGet VAR nValue PICTURE "9999" PIXEL OF oForm RIGHT when(nValue2 = 0)
@ 20,70 GET oGet2 VAR nValue2 PICTURE "9999" PIXEL OF oForm RIGHT
oGet:nClrTextDis := nRgb(0,255,0)
oGet:nClrPaneDis := nRgb(255,0,0)
oGet:lDisColors := .f.
@ 35,40 BUTTON oBot2 PROMPT "&Salir" OF oForm SIZE 30,10 ACTION oForm:End()  PIXEL
ACTIVATE DIALOG oForm CENTER

RETURN nil
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Fri Aug 05, 2022 9:49 am

Thank you. So we have to color the background during the paint event, right? And "who" exactly give the default COLOR_WINDOW color to the readonly GETs? Is it an internal Windows behaviour that can be change only using paint event?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby Otto » Fri Aug 05, 2022 10:24 am

Hello Enrico,

Because I just see you here online I have a question:
Enrico, I am a very satisfied user of your dbf editor.
Is there maybe a newer version.
It would be practical for me if I could adjust the column width.

Best regards,
Otto


EMAGDBU.EXE 595.456 10.03.2011 16:05 -a-
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Re: Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Fri Aug 05, 2022 10:30 am

Hi Otto, you can find the latest release on my website, in the download section. And no, it is not possible to adjust the columns width, sorry.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby cmsoft » Fri Aug 05, 2022 12:49 pm

Enrico Maria Giordano wrote:Thank you. So we have to color the background during the paint event, right? And "who" exactly give the default COLOR_WINDOW color to the readonly GETs? Is it an internal Windows behaviour that can be change only using paint event?

EMG

Si no se especifica lDisColors en false ni bColor, el color del panel disable lo genera con nClrP := GetSysColor( COLOR_WINDOW )
User avatar
cmsoft
 
Posts: 1189
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Fri Aug 05, 2022 12:55 pm

cmsoft wrote:Si no se especifica lDisColors en false ni bColor, el color del panel disable lo genera con nClrP := GetSysColor( COLOR_WINDOW )


Yes, but I was referring to the fact that the background color of the readonly GETs is set inside the paint event, if I read the TGet source code correctly. Is it the only way? Or are there other ways to override the defaul readonly color?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby Horizon » Fri Aug 05, 2022 1:27 pm

//TGet():bColorBlock := { |oGet| IF( oGet:lFocused, { CLR_WHITE, CLR_HBLUE }, IF( .NOT. oGet:lActive, {CLR_BLACK, CLR_HGRAY}, {CLR_BLACK, CLR_WHITE} )) }
//fix for readonly gets
// TGet():lDisColors := .f.
// TGet():nClrGrayText := 25
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Fri Aug 05, 2022 1:34 pm

Ok, bColorBlock (actually bColor) is evaluated inside paint event. So this is the only option, it seems. I would like to avoid using paint event.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby Enrico Maria Giordano » Sat Aug 06, 2022 3:31 pm

Ok, never mind, it was my fault, sorry. I can change the GETs color (normal, readonly or disabled) with the usual SetColor() function. I forgot to have some code that changed the color back. :-)

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Readonly and/or disable GETs background color

Postby shrifw » Fri Aug 11, 2023 7:21 pm

Dear Rao Sir ,

I am not able to set color for READONLY GETs ( WHEN condition ). Could you please share code to set code at global level.

Code: Select all  Expand view


  TGet():bColorBlock := { |oGet| IF( oGet:lFocused, { CLR_WHITE, CLR_HBLUE }, IF( .NOT. oGet:lActive, {CLR_BLACK, CLR_HGRAY}, {CLR_BLACK, CLR_WHITE} )) }

@   10,  150  SAY ":" GET aoGET[ 6 ] VAR oAcctRec2:mail_to SIZE 450, C_GETH PIXEL OF oWnd ;
    NOBORDER FONT oApp:oFontGet UPDATE WHEN ( nGrpd == 2 )

 


Thanks
Shridhar
shrifw
 
Posts: 54
Joined: Fri Aug 28, 2009 5:25 am

Re: Readonly and/or disable GETs background color

Postby Rick Lipkin » Fri Aug 11, 2023 8:58 pm

Enrico

Hope this is what you are looking for ...

SetGetColorFocus( rgb(209,224,252) ) // global color for gets

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2618
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Readonly and/or disable GETs background color

Postby shrifw » Sat Aug 12, 2023 12:13 pm

Hi Rick ,

I had tried this SetGetColorFocus but does not work for READONLY GETs .

Thanks
Shridhar
shrifw
 
Posts: 54
Joined: Fri Aug 28, 2009 5:25 am

Re: Readonly and/or disable GETs background color

Postby karinha » Sat Aug 12, 2023 3:56 pm

Code: Select all  Expand view

#Include "Fivewin.Ch"

#Define CLR_SOFTYELLOW nRGB( 255, 251, 225 )

FUNCTION Main()

   LOCAL...
   MEMVAR...
   PRIVATE..
   PUBLIC...


   SetBalloon( .T. )
   SkinButtons()

   SetGetColorFocus( CLR_LGREEN )

   tGet():lDisColors  := .F. // WHEN( .F. )
   tGet():nClrTextDis := CLR_HBLUE
   tGet():nClrPaneDis := CLR_SOFTYELLOW

   // continue...

RETURN NIL
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Readonly and/or disable GETs background color

Postby shrifw » Sat Aug 12, 2023 5:43 pm

Hi Karinha ,

Thanks for this but mine requirement is bit different as given below :

GETs are classified
==================
1. READ/WRITE GET Focus ==> { nRGB(111, 30, 81) , nRGB(245, 235, 147) }
2. READ/WRITE GET Un-Focus ==> { nRGB(43, 43, 43) , nRGB(248, 239, 186) }
3. READONLY GET ==> { nRGB(43, 43, 43) , nRGB(248, 239, 186) }

How we can achieve this ?

Thanks
Shridhar
shrifw
 
Posts: 54
Joined: Fri Aug 28, 2009 5:25 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 90 guests