Page 1 of 2

TEXTBOX - READONLY - BACKCOLOR

Posted: Fri Nov 06, 2009 3:33 pm
by mustafa
Hola amigos
Tengo una aplicación que calcula Días entre fechas, los dos primeros TEXTBOX se
entran las fechas y el resto solo es para el resultado y el historico del calculo anterior.
Los TEXTBOX que solo son para informar del Resultado y el Resto es el historico.
-> READONLY .T. y BACKCOLOR {180,200,255} <-
Cuando se compila con HMG no se pueden entrar datos READONLY .T. pero el fondo
del TEXTBOX no cambia el color , si se compila con Extended o con ooHG se ve el fondo de color del TEXTBOX.
Si pueden aportar alguna solucion les estaria muy agradecido.

Hello friends
I have an application that calculates days between dates, the first two TextBox
enter the dates and the rest is only for the result and the previous calculation
historic.
The TextBox that just are to report the results and the rest is history.
-> READONLY. T. and BACKCOLOR (180,200,255) <-
When compiled with HMG can not enter data READONLY. T. but the bottom
TextBox does not change the color, if compiled with Extended or ooHG see the
background color of the TextBox.
If you could provide any solution will be very grateful.

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Fri Nov 06, 2009 3:36 pm
by mustafa
Compile Extended o ooHG

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Fri Nov 06, 2009 3:38 pm
by mustafa
Los Prgs para su revision
Un saludo a todos
Mustafa

The PRGs for review
Greetings to all
Mustafa

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Fri Nov 06, 2009 4:56 pm
by Roberto Lopez
mustafa wrote:Los Prgs para su revision
Un saludo a todos
Mustafa

The PRGs for review
Greetings to all
Mustafa
HMG establishes read-only property for a textbox, sending the appropiate message to the control using corresponding Windows API function, so, the behavior and appearance of the control is determined by Windows.

I've not care specially about this, because I think that the user must have a consistent experience across applications. That was the goal of the Windows API creators, so, a read-only textbox should look the same in all applications.

Anyway, I'll consider the addition of this feature in future versions.

And, if someone has some sample to help Mustafa on this, please, post here.

TIA.

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Fri Nov 06, 2009 7:20 pm
by mustafa
Hola Maestro Roberto
Gracias por tu dedicacion en este tema, muy agradecido

Hello Master Roberto
Thank you for your dedication in this matter, very grateful

Un cordial saludo
Mustafa :P

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Sat Nov 07, 2009 7:29 pm
by mol
I think, this is the same problem as mine with progressbars as graphs - when I switch desktop for using windows themes, some settings of colours are from windows - when themes are off, all of them look as I defined them.

In my opinion, It would be great to programmatically control behavior of features - indenpendend from windows.

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Sat Nov 07, 2009 10:32 pm
by Roberto Lopez
mol wrote:I think, this is the same problem as mine with progressbars as graphs - when I switch desktop for using windows themes, some settings of colours are from windows - when themes are off, all of them look as I defined them.

In my opinion, It would be great to programmatically control behavior of features - indenpendend from windows.
The problem is basically because Windows XP/Vista/7 themes API are not fully backwards compatible with non-themed desktops. So, the same code that allowed you to change certain color when no XP theme is used, does not work when a theme is applied.

This behavior is by design.

The only way to overcome this is to create owner-drown versions of the controls.

The problem with this is that the control should be re-coded on every windows version to be in-sync with them to 'mimic' each new theme look (I've simplified the problem to explain it, but is really more complicated).

Please, do not forget that the idea of the themes, is that each control type have the same look in all applications.

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Sat Nov 07, 2009 10:44 pm
by Roberto Lopez
Roberto Lopez wrote: The problem is basically because Windows XP/Vista/7 themes API are not fully backwards compatible with non-themed desktops. So, the same code that allowed you to change certain color when no XP theme is used, does not work when a theme is applied.

This behavior is by design.

The only way to overcome this is to create owner-drown versions of the controls.

The problem with this is that the control should be re-coded on every windows version to be in-sync with them to 'mimic' each new theme look (I've simplified the problem to explain it, but is really more complicated).

Please, do not forget that the idea of the themes, is that each control type have the same look in all applications.

Anyway, there is a dirty trick (always there is one :) )

in \hmg\resources\minigui.rc, delete the line #6 (1 24 HMGRPATH\WindowsXP.Manifest) and recompile the resources...

and... VOILA!

Your application will not be themed even when XP style be active, so the colors will perform like in Win9x, so you could change progressbar color.

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Sat Nov 07, 2009 10:53 pm
by Roberto Lopez
Roberto Lopez wrote: Please, do not forget that the idea of the themes, is that each control type have the same look in all applications.

In the case that you attempt to research about this (and maybe contribute with a new control to HFCL), this is a good starting point:

http://www.tech-archive.net/Archive/VC/ ... 00336.html

Re: TEXTBOX - READONLY - BACKCOLOR

Posted: Thu Aug 24, 2023 6:20 pm
by edufloriv
Estimado Mustafa,

Yo soluciono ese problema usando el atributo DISABLEDBACKCOLOR ya que son textbox que siempre serán de solo lectura:
DISABLEDBACKCOLOR.png
DISABLEDBACKCOLOR.png (204.97 KiB) Viewed 4326 times
Y el resultado me queda así:
result.png
result.png (196.63 KiB) Viewed 4326 times
Saludos cordiales.

Hi Mustafa,

I resolve that setting the textbox attribute DISABLEDBACKCOLOR when textbox is going to be always READONLY:
DISABLEDBACKCOLOR.png
DISABLEDBACKCOLOR.png (204.97 KiB) Viewed 4326 times
And this is the result:
result.png
result.png (196.63 KiB) Viewed 4326 times
Best regards.