TEXTBOX - READONLY - BACKCOLOR

HMG en Español

Moderator: Rathinagiri

User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

TEXTBOX - READONLY - BACKCOLOR

Post 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.
Attachments
ErrorSin.jpg
ErrorSin.jpg (87.7 KiB) Viewed 16945 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: TEXTBOX - READONLY - BACKCOLOR

Post by mustafa »

Compile Extended o ooHG
Attachments
ErrorColor.jpg
ErrorColor.jpg (87.82 KiB) Viewed 16946 times
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: TEXTBOX - READONLY - BACKCOLOR

Post by mustafa »

Los Prgs para su revision
Un saludo a todos
Mustafa

The PRGs for review
Greetings to all
Mustafa
Attachments
CalcuDay.zip
(12.44 KiB) Downloaded 667 times
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
edufloriv
Posts: 235
Joined: Thu Nov 08, 2012 3:42 am
DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
Location: PERU

Re: TEXTBOX - READONLY - BACKCOLOR

Post 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 4104 times
Y el resultado me queda así:
result.png
result.png (196.63 KiB) Viewed 4104 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 4104 times
And this is the result:
result.png
result.png (196.63 KiB) Viewed 4104 times
Best regards.

Eduardo Flores Rivas


LIMA - PERU
Post Reply