change field atributes

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

change field atributes

Post by dragancesu »

When the field is enabled, then everything can change , but when it is inactive, then it can not

Is there any way to change the attribute fields (color) when the field is disabled

samples in attachment
Attachments
test1.zip
(716 Bytes) Downloaded 212 times
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: change field atributes

Post by andyglezl »

Hola Dragan, te refieres a esto ?
---------------------------------------
Hi Dragan, you mean this?


@ <nRow>, <nCol>
TEXTBOX <ControlName>
[ OF | PARENT <ParentWindowName> ]
[ HEIGHT <nHeight> ]
[ WIDTH <nWidth> ]
[ FIELD <FieldName> ]
[ VALUE <cValue> ]
[ READONLY ]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <ToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DISABLEDBACKCOLOR <aDisabledBackColor> ]
[ DISABLEDFONTCOLOR <aDisabledFontColor> ]
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: change field atributes

Post by dragancesu »

Maybe, but how change it?

Code: Select all

Win_1.mPOLJE2.DisabledBackColor := COLOR31
Win_1.mPOLJE2.DisabledFontColor := COLOR32  
compiler say

test.prg(87) Error E0030 Syntax error "syntax error at '.'"
test.prg(88) Error E0030 Syntax error "syntax error at '.'"
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: change field atributes

Post by andyglezl »

Bueno, si tu no anexas un ejemplo para probar, es estar adivinando para ver que puede ser...

* Definiste correctamente tu control ?
* Ya probaste con SetProperty(...)
* ...

En la definicion debes indicarle que color se va a usar cuando el control este disponible o no.
En la carpeta de HMG tenemos la ayuda /HMG/3.4/DOC/data/index.htm
Y en \HMG\3.4\SAMPLES tenemos varios ejemplos...
- \Applications\MiniWriter\miniwriter.prg
- \Controls\TextBox\TEXTBOX_1\demo.prg
-------------------------------------------------------------------------------------------------------------------
Well, if you do not appended an example to prove it is guesswork to see that it can be ...

* Correctly you defined your control?
* Have you tried to SetProperty(...)
* ...

In the definition you must indicate what color will be used when control is available or not.
In the folder of HMG we have the help /HMG/3.4/DOC/data/index.htm
And \HMG\3.4\SAMPLES have several examples ...
- \Applications\MiniWriter\miniwriter.prg
- \Controls\TextBox\TEXTBOX_1\Demo.prg
---------------------------------------------
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

TEXTBOX when DISABLE - Change color attributes

Post by Pablo César »

No veo que en esta seccion en Español sea tan solo para los del habla hispánica. :?

Pero me veo obligado a escribir en inglés (tambien) porque el colega Dragan es el autor de este tópico.
andyglezl wrote: Mon Oct 05, 2015 1:15 pm Bueno, si tu no anexas un ejemplo para probar, es estar adivinando para ver que puede ser...

* Definiste correctamente tu control ?
* Ya probaste con SetProperty(...)
Disculpame Andrés que yo te responda en lugar de Dragan. Pero él definió correctamente el control en cuestion y tambien puso su ejemplo. :oops:

Lo que veo, es que no es convencional ese pedido de Dragan que por general los controles desabilitados ( ENABLED := .F. ) en Windows tiene como padrón estar siempre en griz. No concuerdo con Microsoft en cierto casos (como este), porque muchas veces por cuestión de estética y no de funcionabilidad del própio control y que aú necesite ser cambiado el color para no quedar esteticamente desparejo con los otros controles coloridos.

Creo que es muy bueno que HMG lo haya disponibilizado, pero lamentablemente: NO FUNCIONAN en HMG las propiedades DISABLEDBACKCOLOR y DISABLEDFONTCOLOR en este control.

Y creo que talvez hayan más controles que no le funcionan, según Javier Tovar ( hace tiempo que no veo mensajes dél por aqui.. :| ) ya probó que no está funcionando.

Me gustaria aprovechar la ocasión y reiterar mi pedido de rehabilitacion de estas propiedades al Dr. Claudio Soto. Pues si están en la HMGDOC, es decir siempre estuvieron o talvez nunca ?
 
Screen104.png
Screen104.png (22.97 KiB) Viewed 3451 times
 
Para aquellos que todavia no se dieron cuenta la falta de estas propiedades (DISABLEDBACKCOLOR y DISABLEDFONTCOLOR), aprovecho el ejemplo de Dragan y disponibilizo con sugerida intentativa y probar (una vez más) que NO funciona. :(
Dragan.rar
Source and Executable
(1.24 MiB) Downloaded 202 times
 
Googled
I do not see that in this section in Spanish it is only for those of the Spanish speaking. :?

But I am forced to write in English (also) because colleague Dragan is the author of this topic.
andyglezl wrote: Mon Oct 05, 2015 1:15 pm Well, if you do not attach an example to prove, is to be guessing to see that it can be ...

* Did you correctly define your control?
* You tried with SetProperty (...)
Excuse me, Andrés, that I will answer instead of Dragan. But he correctly defined the control in question and also set his example. :oops:

What I see, is that it is not conventional (according MSDN) that Dragan's request in this control for disabled ( ENABLED: = .F. ) in Windows must be greyed. I do not agree with Microsoft in certain cases (like this one), because many times because of aesthetics and not the functionality of the own control and that it needs to be changed the color so as not to be aesthetically unequal with the other colorful controls.

I think it is very good that HMG has made it available, but unfortunately: DO NOT WORK in HMG the properties DISABLEDBACKCOLOR and DISABLEDFONTCOLOR in this control.

And maybe there are some more controls that do not work, according to Javier Tovar already proved that it is not working.
( I have not seen messages from him in a long time By here... :| )

I would like to take the opportunity and reiterate my request for the rehabilitation of these properties to Dr. Claudio Soto.
Well if it is in the HMGDOC, that's means it always were or maybe never ? :?
 
Screen104.png
Screen104.png (22.97 KiB) Viewed 3451 times
 
For those who still did not got the unsuccess result with these properties (DISABLEDBACKCOLOR and DISABLEDFONTCOLOR), I take the example of Dragan and make available with suggested attempt and prove (once again) that it does not work. :(
Dragan.rar
Source and Executable
(1.24 MiB) Downloaded 202 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: change field atributes

Post by srvet_claudio »

Is not a bug of HMG is a Windows behavioral, many color property not work with Windows theme active.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

change field atributes

Post by Pablo César »

Ohhh now I remember this... sorry Claudio, I have forgotten this damn Windows theme...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: change field atributes

Post by andyglezl »

Hola, aquí probando el DISABLEDFONTCOLOR / DISABLEDBACKCOLOR

DISABLEDFONTCOLOR.jpg
DISABLEDFONTCOLOR.jpg (170.65 KiB) Viewed 3378 times

Este ejemplo muestra que lo que no esta funcionando es el DISABLEDFONTCOLOR RED
al momento de deshabilitar el Control, supongo que es normal ya que eso indica que está deshabilitado.

Probado en HMG 3.4.3 con Win7
---------------------------------------------------------------------------------------------------------------------------------
This example shows that what is not working is the DISABLEDFONTCOLOR RED
At the time of disabling the Control, I suppose that is normal since that indicates that it is disabled.

Tested on HMG 3.4.3 with Win7

Code: Select all

#include <hmg.ch>


Function Main()

	LOCAL xVal:= MemoRead( "demo.prg" )
	
	DEFINE WINDOW w_test AT 240 , 850 WIDTH 1050 HEIGHT 730 BACKCOLOR BLUE TITLE "DISABLEDFONTCOLOR / DISABLEDBACKCOLOR" MAIN NOSIZE NOMAXIMIZE NOMINIMIZE 
   
		ON KEY ESCAPE ACTION Thiswindow.Release()
  		
		@ 030,010 EDITBOX EB_1 WIDTH 500 HEIGHT 630 VALUE xVal FONT "Droid Sans Mono" SIZE 10 FONTCOLOR BLACK BACKCOLOR { 227, 239, 255 } ;
			  MAXLENGTH 500 

		@ 030,520 EDITBOX EB_2 WIDTH 500 HEIGHT 630 VALUE xVal FONT "Droid Sans Mono" SIZE 10 FONTCOLOR BLACK BACKCOLOR { 227, 239, 255 } ; 
			  MAXLENGTH 500  DISABLEDFONTCOLOR RED DISABLEDBACKCOLOR CYAN // { 227, 239, 255 }

			  // Al parecer, lo que no funciona es el DISABLEDFONTCOLOR RED 
			  // al momento de deshabilitarlo.   Probado en HMG 3.4.3 con Win7
			  // -----------------------------------------------------------------
			  // It seems that what is not working is the DISABLEDFONTCOLOR RED
			  // at the moment of disabling it.  Tested on HMG 3.4.3 with Win7

		  w_test.EB_2.Enabled := .F.

	END WINDOW
	CENTER WINDOW w_test 
	ACTIVATE WINDOW w_test 
  
Return
Andrés González López
Desde Guadalajara, Jalisco. México.
Post Reply