Bold text on a button bar

Bold text on a button bar

Postby hag » Sat Aug 29, 2009 4:11 pm

Hello all:

In my app I have a button bar initialized:
DEFINE BUTTONBAR oBar SIZE 73.5 ,78 2007 OF oWnd1
Works fine.

I have text on the bar...so far no problem.
This code is coloring the text : oBar:nClrText = nRGB( 0, 0, 128 )...This Works fine

My question is how can i get the text on the bar in BOLD.

Any help appreciated
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Bold text on a button bar

Postby James Bott » Sat Aug 29, 2009 6:18 pm

Harvey,

Try:

define font oFont "Arial" size 0, -8 bold

oBar:setFont( oFont )

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Bold text on a button bar

Postby hag » Sat Aug 29, 2009 8:29 pm

James:
Doesnt work. Here is all the code.

Code: Select all  Expand view


//Define the button

DEFINE BUTTONBAR oBar   SIZE 73.5 ,46 2007 OF oWnd1                       

// color of text
oBar:nClrText = nRGB( 0, 0, 128 )      

// Define font
DEFINE FONT oFont1 NAME "Arial" SIZE 10,-8 BOLD

// set font as James suggested
oBar:setFont(ofont1)      

// color of the obar
 oBar:bClrGrad = { | lInvert | If( ! lInvert,;
  { { 0.50, nRGB( 178, 187, 202 ), nRGB( 137, 155, 179 ) },;
  {   0.50, nRGB( 129, 149, 174 ), nRGB( 114, 132, 156 ) } },;
  { { 0.50, nRGB( 139, 166, 193 ), nRGB(  69, 119, 170 ) },;
   {   0.50, nRGB(  52, 104, 152 ), nRGB(  50, 107, 162 ) } } ) }

// text to be displayed on oBar
// displayed fine but not bold.

 DEFINE BUTTON prompt "Financial"+CRLF+"Analysis "+CRLF+"No. 1" of oBar
 
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Bold text on a button bar

Postby James Bott » Sat Aug 29, 2009 8:35 pm

Harvey,

It looks like you want bold text on the button not the bar. I expect you need to define the button font not the bar font.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Bold text on a button bar

Postby hag » Sat Aug 29, 2009 11:32 pm

Thanks for getting back to me. I looked in FWH help and it says... define button prompt "help" of oBar FONT oFont1... Font oFont1 should work. It doesn't.

Any other ideas?
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Bold text on a button bar

Postby ukoenig » Sun Aug 30, 2009 8:52 am

Harvey,

there are some post, I talked about this problem.

With more tests on VTitle, I think it is a good Replacement for Buttonbars,
if You want to do something special and create Your own Buttonbar.
Button-Actions are added in FWH-0.08 and Tooltips will still be included by Daniel.

Another Test with BTNBMP :
Image

Code: Select all  Expand view

...
...
nSCR0 := GetSysMetrics(0)  // Screen-Width
nSCR17 := GetSysMetrics(17)  // Screen-Hight - Title-Height
   
//Title 4 Vertical ( Right )
// Top, Left - Width / Height
@  0, nSCR0 - 80 TITLE oTitle4 size 80, nSCR17 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT
   
@  0, nSCR0 - 95 TITLE oTitle3 size 15, nSCR17 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 1 TOPRIGHT

@   10,  10 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\32X32\keys.bmp"        SIZE 30, 30 REFLEX TRANSPARENT ;
ACTION Msgalert( "Button 1")
@  70,  20  TITLETEXT OF oTitle4 TEXT "Button 1"  FONT oFont2 COLOR CLR_BLACK  
   
@  100,  20 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\AlphaBmp\explorer.BMP" SIZE 30, 30 REFLEX ANIMA
@  160,  20  TITLETEXT OF oTitle4 TEXT "Button  2"  FONT oFont2 COLOR CLR_BLACK  
   
@ 190,   15 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\AlphaBmp\movie.BMP"    SIZE 50, 60 ANIMA LEVEL 100
@  250,  20  TITLETEXT OF oTitle4 TEXT "Button  3"  FONT oFont2 COLOR CLR_BLACK  
   
@ 280,   15 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\AlphaBmp\movie.bmp"    SIZE 50, 60 ANIMA LEVEL 255
@  340,  20  TITLETEXT OF oTitle4 TEXT "Button  4"  FONT oFont2 COLOR CLR_BLACK  
   
@ 370,  20 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\AlphaBmp\explorer.BMP" SIZE 30, 30 REFLEX ANIMA
@  430,  20  TITLETEXT OF oTitle4 TEXT "Button  5"  FONT oFont2 COLOR CLR_BLACK  
   
@ 460,  20 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\32X32\keys.bmp"        SIZE 30, 30 REFLEX TRANSPARENT
@  520,  20  TITLETEXT OF oTitle4 TEXT "Button  6"  FONT oFont2 COLOR CLR_BLACK  
   
//  @ 550,  20 TITLEIMG OF oTitle4 BITMAP ".\bitmaps\AlphaBmp\explorer.BMP" SIZE 30, 30 REFLEX ANIMA
//  @  610,  20  TITLETEXT OF oTitle4 TEXT "Button  7"  FONT oFont2 COLOR CLR_BLACK  
   
// replacement of => Button 7
// -------------------------------
@ 550, 2 BTNBMP oBtn1 OF oTitle4 2007 ;
SIZE 75, 75 ;
FILENAME ".\bitmaps\32X32\keys.bmp" ;
ACTION MsgAlert( "Button-Click", "Button 1" ) ;
PROMPT "But.1" ;
FONT oButtFont ;
TOP
oBtn1:lTransparent := .t.  
oBtn1:cTooltip := "Button1"
oBtn1:SetColor( 128 )

oTitle4:lRound := .F.
oTitle4:aGrdBack = { { 0.9, 15851661, 16708826 },{ 0.9, 16708826, 15851661 } }
oTitle3:lRound := .F.
oTitle3:aGrdBack = { { 0.1, 15851661, 128 },{ 0.1, 128, 15851661 } }
...
...
 


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bold text on a button bar

Postby nageswaragunupudi » Sun Aug 30, 2009 10:20 am

Mr Harvey

Buttons in Buttonbar ignore any font setting of the button.
In case a font is set to Buttonbar and that font's facename is 'Tahoma' ( not even 'TAHOMA' ) of any size that font is used and otherwise Tahoma 0,-11 is forced.

You can make the button prompts' font bold if you define

DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-<anysize> BOLD
DEFINE BUTTONBAR ....
oBar:SetFont( oFont )

We may request Mr Antonio to advise if this restriction of Tahoma can be removed in the next versions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10625
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Bold text on a button bar

Postby hag » Sun Aug 30, 2009 4:45 pm

All:

Thanks for all the help. Still no bold. :(

Roa:

You said that tahoma is forced. Then you indicated that if I define the font using tahoma and BOLD it should work.
It Doesnt always back to same font. Nothing changes.

Buttons in Buttonbar ignore any font setting of the button.
In case a font is set to Buttonbar and that font's facename is 'Tahoma' ( not even 'TAHOMA' ) of any size that font is used and otherwise Tahoma 0,-11 is forced.

You can make the button prompts' font bold if you define

DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-<anysize> BOLD
DEFINE BUTTONBAR ....
oBar:SetFont( oFont )

We may request Mr Antonio to advise if this restriction of Tahoma can be removed in the next versions.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Bold text on a button bar

Postby ukoenig » Sun Aug 30, 2009 6:13 pm

Harvey,

the Solution works fine here :

Image

Code: Select all  Expand view

...
...
DEFINE FONT oFont NAME 'Tahoma' SIZE 0,-14 BOLD

DEFINE WINDOW oWnd TITLE "Gradient-Selection for Buttonbar" MDI MENU TMenu():New()

DEFINE BUTTONBAR oBar OF oWnd SIZE 100, 100 2007 TOP

oBar:bClrGrad = { | | { { 0.10,16643551, 15716726 }, ;
                       { 0.10, 15716726, 16643551 } } }

oBar:nClrText = 128
oBar:SetFont( oFont )

DEFINE BUTTON oBtn1 OF oBar ACTION Tools(oWnd,oBar,oBtn1) ;
RESOURCE "magic" PROMPT "Bar-Selection" TOOLTIP "Bar-Select"

DEFINE BUTTON oBtn2 OF oBar ACTION MsgAlert( "Under construction", "Open") ;
RESOURCE "open" PROMPT "Open" + CRLF + "Project" TOOLTIP "Open Project"

DEFINE BUTTON oBtn3 OF oBar ACTION MsgAlert( "Under construction", "Save") ;
RESOURCE "floppy" PROMPT "Save" + CRLF + "Project" TOOLTIP "Save Project"

DEFINE BUTTON oBtn4 OF oBar ACTION MsgAlert( "Save / Restore" + CRLF + ;
"your design" + CRLF + ;
"in a INI-File","Project-Info" ) ;
RESOURCE "help" PROMPT "Help" TOOLTIP "Project"

DEFINE BUTTON oBtn5 OF oBar ACTION NIL;
RESOURCE "calendar"

DEFINE BUTTON oBtn6 OF oBar ACTION oWnd:End() ;
RESOURCE "quit" PROMPT "Exit" TOOLTIP "Close Bar-Gradient"
...
...
 

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Bold text on a button bar

Postby James Bott » Sun Aug 30, 2009 7:09 pm

Harvey,

>You said that tahoma is forced. Then you indicated that if I define the font using tahoma >and BOLD it should work. It Doesnt always back to same font. Nothing changes.

Did you notice that he mentioned that you must use "Tahoma" in mixed case exactly like in the quotes? Not "TAHOMA" nor "tahoma."

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Bold text on a button bar

Postby hag » Sun Aug 30, 2009 7:12 pm

James:

Exactly right...Now works. Thanks to all.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 35 guests