FontColor and button - is it possible to change?
Moderator: Rathinagiri
FontColor and button - is it possible to change?
Is any possibility to change font color of button caption?
I need to distinguish one of button.
Regards, Marek
I need to distinguish one of button.
Regards, Marek
Re: FontColor and button - is it possible to change?
Not tested !
_SetFontColor ( ControlName, ParentForm , Value )
Regards
_SetFontColor ( ControlName, ParentForm , Value )
Regards
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
Re: FontColor and button - is it possible to change?
It doesn't work 
It's Windows problem, I think.
When you run:
you'll get NIL value
Marek

It's Windows problem, I think.
When you run:
Code: Select all
MsgBox(hb_valtoexp(_GetFontColor(cControlName, cParentFormName)))
Marek
Re: FontColor and button - is it possible to change?
Yes
If control have color value: it will return Array[3]
If control have color value: it will return Array[3]
Code: Select all
#include "hmg.ch"
Function Main()
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 480 ;
MAIN;
TITLE '_SetFontColor / _GetFontColor: Test' ;
ON INIT { || _SetFontColor( 'BUTTON_1', 'FORM_1', { 255, 128, 16 } ), _SetFontColor( 'BUTTON_2', 'FORM_1', { 16, 128, 255 } ), _SetFontColor( 'TXT01', 'FORM_1', { 255, 128, 16 } ), _SetFontColor( 'TXT02', 'FORM_1', { 16, 128, 255 } ) }
@ 100,30 BUTTON Button_1 CAPTION 'ANYTHING 01' PICTURE "button.bmp" WIDTH 120 HEIGHT 80 ACTION MSGBOX( hb_valtoexp( _GetFontColor( 'BUTTON_1', 'FORM_1' ) ) )
@ 200,30 BUTTON Button_2 CAPTION 'ANYTHING 02' PICTURE "button.bmp" WIDTH 120 HEIGHT 80 ACTION MSGBOX( hb_valtoexp( _GetFontColor( 'BUTTON_2', 'FORM_1' ) ) )
@ 100,160 textbox TXT01 value REPL('!', 150 ) WIDTH 360 HEIGHT 80
@ 200,160 textbox TXT02 value REPL('x', 150 ) WIDTH 360 HEIGHT 80
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
M., Ronaldo
By: IMATECH
Imation Tecnologia
By: IMATECH
Imation Tecnologia
- salamandra
- Posts: 311
- Joined: Thu Jul 31, 2008 8:33 pm
- DBs Used: DBF, MySQL, SQL
- Location: Brazil
Re: FontColor and button - is it possible to change?
Hi Ronaldo
,
in black color, even using the windows default theme (Win9x.).
IMHO, it´s easier to resolve the issue using a bitmap image
[]´s Salamandra

Yes, if a color has been assigned it´s returned Array [3], but the captions are still shownYes
If control have color value: it will return Array[3]
in black color, even using the windows default theme (Win9x.).

IMHO, it´s easier to resolve the issue using a bitmap image

[]´s Salamandra
There is one time in which is crucial awakening. That time is now. ( Buddha )
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
FontColor and button - is it possible to change?
No way ! It´s does not working !
Yes, but it would it be better to be able to assign fontcolor in buttons.salamandra wrote:IMHO, it´s easier to resolve the issue using a bitmap image
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: FontColor and button - is it possible to change?
HI:mol wrote:Is any possibility to change font color of button caption?
I need to distinguish one of button.
Regards, Marek
I think that to work would be needed to modify "INITBUTTON"
in D:\hmg.3.0.42\SOURCE\c_button.c to include the style
BS_OWNERDRAW, that way you send messages to the button to change the style of it.
Code: Select all
HB_FUNC( INITBUTTON )
{
HWND hwnd;
HWND hbutton;
int Style ;
hwnd = (HWND) hb_parnl (1);
Style = BS_NOTIFY | WS_CHILD | BS_PUSHBUTTON ;
if ( hb_parl (10) )
{
Style = Style | BS_FLAT ;
}
if ( ! hb_parl (11) )
{
Style = Style | WS_TABSTOP ;
}
if ( ! hb_parl (12) )
{
Style = Style | WS_VISIBLE ;
}
if ( hb_parl (13) )
{
Style = Style | BS_MULTILINE ;
}
hbutton = CreateWindow( "button" ,
hb_parc(2) ,
Style ,
hb_parni(4) ,
hb_parni(5) ,
hb_parni(6) ,
hb_parni(7) ,
hwnd ,
(HMENU)hb_parni(3) ,
GetModuleHandle(NULL) ,
NULL ) ;
hb_retnl ( (LONG) hbutton );
}
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
FontColor and button - is it possible to change?
Thank you very much Daniel for your contrib. I do not tested, I do not know if is working.
I always I am afraid to change original lib of hmg. So in this case, Mr. Rathinagiri and Mr. Roberto, is it possible to include this changing in button defnition ? This is very important and makes powerfull our HMG !
I always I am afraid to change original lib of hmg. So in this case, Mr. Rathinagiri and Mr. Roberto, is it possible to include this changing in button defnition ? This is very important and makes powerfull our HMG !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- danielmaximiliano
- Posts: 2625
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: FontColor and button - is it possible to change?
Hola Pablo:Pablo César wrote:Thank you very much Daniel for your contrib. I do not tested, I do not know if is working.
I always I am afraid to change original lib of hmg. So in this case, Mr. Rathinagiri and Mr. Roberto, is it possible to include this changing in button defnition ? This is very important and makes powerfull our HMG !
voy a intentar charlar con el amigo Jair Pinho si tiene tiempo para intentar modificar el Boton. el ah modificado colores en el Menu.
http://hmgforum.com/viewtopic.php?f=24& ... hilit=jair
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO