Different Size BTNBMP from Code / Resource ?

Different Size BTNBMP from Code / Resource ?

Postby ukoenig » Mon Feb 21, 2011 1:35 pm

Hello,

I want to show in a Preview-dialog ( from Code ) Buttons => Class BTNBMP
with defined Sizes from inside another Dialog ( from Resources ).
The Preview shows the Buttons nearly Factor * 2

Painter ( from Resource ) Button defined 100 x 50
...
...
REDEFINE BTNBMP oBtn1 ID 500 OF oWndBtnB 2007 ;
FILENAME c_path + "\Bitmaps\32Exit.bmp" ;
LEFT ;
PROMPT " &Exit" ;
FONT oTextFont ;
ACTION ( oWndBtnB:End() )
oBtn1:cTooltip := "Test-Button"
oBtn1:lTransparent := .F.
oBtn1:l2007 := .T.
oBtn1:SetColor( nTColor5 )
...
...
oBtn1:SetSize( 100, nBtnHight5, .T. )

Image

Preview ( from Code )
..
..
DEFINE DIALOG oDlg8 FROM 100, 200 TO 600, 900 OF oWnd7 PIXEL TRANSPARENT ;
..
..
@ 40, 20 BTNBMP oBtn[1] OF oDlg8 PIXEL ;
SIZE 100 , nBtnHight5 PROMPT "Test-Button &1" ;
FONT oTextFont ;
TOP ;
NOBORDER ;
FILENAME cBmpName1 ;
ACTION MsgAlert( "100 x " + ALLTRIM(STR(nBtnHight5)), "Size Button 1" )

Image

It looks like a Factor of 2 :
Image

Using a FWH-sample shows, the defined Buttonsize is not related to Dialog-size :
The middle Button ( the Hight must be 80 to 300 but is shown double-size )

@ 10, 75 BTNBMP oBtn OF oWnd ;
SIZE 100, 80 ;
PROMPT "&" + cVer FILE "..\BITMAPS\sms.bmp" 2007 ;
FONT oFont BOTTOM ;
ACTION MsgInfo( "Yes" )

Image

With Buttonbars it works
The Preview shows exactly the Hight, defined with the Painter

Image

I changed from Code to Resource to get a identical Result :
with oBtn1:SetSize( 180, nBtnHight5, .T. )

Image

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

Return to FiveWin for Harbour/xHarbour

Who is online

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