Possible to calc. Right/Bottom Btn-Pos on diff. Dlg-Sizes ?

Re: Possible to calc. Right/Bottom Btn-Pos on diff. Dlg-Sizes ?

Postby James Bott » Tue Aug 17, 2010 6:46 pm

Uwe,

It is not clear to me (from your last message) if my sample code was the solution to your problem?

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

Re: Possible to calc. Right/Bottom Btn-Pos on diff. Dlg-Sizes ?

Postby ukoenig » Tue Aug 17, 2010 6:57 pm

James,

Yes the < MOVE > - Solution works.
The same Button-position < defined in Background-Preview > inside a Window,
I needed in the Dialog-Preview from Folder-Page,
but I had to change the Button-Size ( was different in Windows ).
The Position : < @ D_HEIGHT - 150, D_WIDTH - 210 > was the same.

The Button used with a Window :
@ D_HEIGHT - 150, D_WIDTH - 210 BTNBMP oBtn1 SIZE 170, 90 OF oWnd1 2007 ;
// ON INIT :
oBtn1:move(oWnd1:nHeight - 150, oWnd1:nWidth - 210, , , .F. ), ;

The same Button used with a Dialog :
@ D_HEIGHT - 150, D_WIDTH - 210 BTNBMP oBtn1 SIZE 90, 45 OF oDlg1 2007 ;
// ON INIT :
oBtn1:Move( oDlg1:nHeight - 150 , oDlg1:nWidth - 210, , , .F. ), F_DESIGN1( oDlg1, oBtn1 ) ) ;

The Preview as Dialog with same Button :

@ D_HEIGHT - 150, D_WIDTH - 210 BTNBMP oBtn1 SIZE 90, 45 OF oDlg1 2007 ;
FILENAME c_path + "\System\Exit.bmp" ;
RIGHT ;
PROMPT " T = " + LTRIM(STR(F_Top)) + " " + CRLF + ; // The Button-Text shows the Folder-Position / Size
" L = " + LTRIM(STR(F_Left)) + " " + CRLF + ;
" H = " + LTRIM(STR(F_Height)) + " " + CRLF + ;
" W = " + LTRIM(STR(F_Width )) + " " ;
FONT oButtFont ;
ACTION ( oDlg1:End() )
oBtn1:nLayout := 2
oBtn1:SetColor( 0)
oBtn1:cTooltip := { "Preview of" + CRLF + ;
"Folder-Design","Folder", 1, CLR_BLACK, 14089979 }

ACTIVATE DIALOG oDlg1 ;
ON INIT ( DRAW_BACK2( oDlg1, hDC, W_IMAGE, W_BRUSH ), ;
oBtn1:Move( oDlg1:nHeight - 150 , oDlg1:nWidth - 210, , , .F. ), F_DESIGN1( oDlg1, oBtn1 ) ) ;
ON PAINT ( DRAW_BACK1( oDlg1, hDC ) )

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: Possible to calc. Right/Bottom Btn-Pos on diff. Dlg-Sizes ?

Postby stefano » Wed May 25, 2011 6:27 am

have you tried this:
#Include "Fivewin.ch"

//-----------------------------------------------------------------------
Function Prova()

Private oBut1

DEFINE FONT oFONT1 NAME "Ms Sans Serif" SIZE 0, -12 BOLD

Define DIALOG oDlg TITLE "prova" ;
FROM 0, 0 to 397, 586 PIXEL COLOR 0, 15790320

ACTIVATE DIALOG oDlg CENTERED ON INIT Ini_oDlg(oDlg:nHeight, oDlg:nWidth)

Return NIL

//----------------------------------------------------------------------------
Function Ini_oDlg(h1,w1)

@ h1-60, 460 BUTTON oBut1 Prompt "Prova" SIZE 100, 40 PIXEL;
OF oForm2 ACTION oDlg:End() FONT oFont1

Return NIL

Saluti
Stefano
FWH 14.11 + xHarbour + bcc582
stefano
 
Posts: 80
Joined: Tue Mar 25, 2008 9:03 pm
Location: ITALIA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], SantaCroya and 69 guests