FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnBmp from resource, how to resize at runtime ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
BtnBmp from resource, how to resize at runtime ?
Posted: Tue May 05, 2009 06: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 :-)
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.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: BtnBmp from resource, how to resize at runtime ?
Posted: Tue May 05, 2009 07:36 PM

Did you try oBtn:Move() method?

EMG

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: BtnBmp from resource, how to resize at runtime ?
Posted: Wed May 06, 2009 08: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 :-)
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.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: BtnBmp from resource, how to resize at runtime ?
Posted: Thu May 07, 2009 02:07 AM

Uwe,

You may also use:

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

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion