TEXTBOX - READONLY - BACKCOLOR

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
mustafa
Posts: 587
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 44 times

TEXTBOX - READONLY - BACKCOLOR

Post by mustafa » Fri Nov 06, 2009 3:33 pm

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 2503 times

User avatar
mustafa
Posts: 587
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 44 times

Post by mustafa » Fri Nov 06, 2009 3:36 pm

Compile Extended o ooHG
Attachments
ErrorColor.jpg
ErrorColor.jpg (87.82 KiB) Viewed 2502 times

User avatar
mustafa
Posts: 587
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 44 times

Post by mustafa » Fri Nov 06, 2009 3:38 pm

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 173 times

User avatar
Roberto Lopez
HMG Founder
Posts: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Fri Nov 06, 2009 4:56 pm

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: 587
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 44 times

Post by mustafa » Fri Nov 06, 2009 7:20 pm

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: 2842
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 119 times
Been thanked: 64 times
Contact:

Post by mol » Sat Nov 07, 2009 7:29 pm

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: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Sat Nov 07, 2009 10:32 pm

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: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Sat Nov 07, 2009 10:44 pm

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: 3899
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 135 times

Post by Roberto Lopez » Sat Nov 07, 2009 10:53 pm

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)

Post Reply