BtnBmp from resource, how to resize at runtime ?

BtnBmp from resource, how to resize at runtime ?

Postby ukoenig » Tue May 05, 2009 6:07 pm

Hello,

I have a small problem :
I need a User-Resize of BTNPMP from resources and a Preview with the new Size.
Is it possible ?
I tested oBtn:nHeight := NewHvalue and oBtn:nWidth := NewWvalue
but it doesn't work.
For the new ButtonTools, I want to make it possible, that the User can create his own Buttons
with a Preview from Source and Resources.

REDEFINE BTNBMP oBtn1 ID 100 OF oDlg3 ;
NOBORDER ;
FILENAME "./project/palm.bmp" ;
PROMPT "Button 1" ;
FONT oFont1 ;
RIGHT
oBtn1:lTransparent = .t.
oBtn1:cTooltip := "Button1"

That doesn't work !!!
---------------------------
obtn1:nHeight := nNewheight // User defined
oBtn1:nWidth := nNewWidth

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: BtnBmp from resource, how to resize at runtime ?

Postby ukoenig » Wed May 06, 2009 8:27 pm

Enrico,

thank You very much.
oBtn1:Move does the resizing I need ( same like with Dlg3 ).
The Move-method keeps the Top / Left position of the Resource with : oBtn1:nTop, oBtn1:nLeft
That is exactly, how I want to do it.

ACTIVATE DIALOG oDlg3 CENTERED NOWAIT ;
ON INIT ( oDlg3:Move( 80, 470, 440, 310, .f. ), oBtn1:Move( oBtn1:nTop, oBtn1:nLeft, 70, 40, .f. ) )

To show a Button with the same size from Source and Resource.
Is it possible, to calculate the different values maybe with a factor ( 2.16 ) ?

Resource :
STATIC nButtonW := 140
STATIC nButtonH := 86

Source :
@ 8, 5 BTNBMP oBtn1 OF oDlg1 ;
SIZE 65, 40

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: BtnBmp from resource, how to resize at runtime ?

Postby Antonio Linares » Thu May 07, 2009 2:07 am

Uwe,

You may also use:

oControl:SetSize( nWidth, nHeight [, lRepaint ] )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42073
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 55 guests