It use a easy window with some controls can be resize no problems and all control are resized!!!!!
When the window is on initial coordinates
When the user resize the window ( it run ok id the window is maximized)
I tried to remake the same with our fwh and xharbour but I not Know How we can make it
to try I build a small test sample : 3 folder, 1 xbrowse , 3 buttons
and I tried to resize the window with the function RESIZECONTROLS(nSizeType,nWidth,nHeight,oWnd )
when I resize the window all controls are resized but it is not good !!!
Have You some prupose ?
this is the test sample :
- Code: Select all Expand view
- #include 'fivewin.ch'
#include 'xbrowse.ch'
FUNCTION MAIN()
LOCAL oWnd
Local oBtn[10]
Local oFld1
Local oFld2
Local oFld3
Local oBrw
USE CUSTOMER ALIAS CUST
DEFINE WINDOW oWnd from 1,1 to 35,104
@ 3, 4 FOLDER oFld1 PIXEL ;
ITEMS "&Billing","Shipping";
SIZE 400,100
@ 3, 500 FOLDER oFld2 PIXEL ;
ITEMS "&Invoice";
SIZE 250,100
@ 201,20 XBROWSE oBrw OF oWnd SIZE 750,200 PIXEL ;
COLUMNS "First", "State", "Age", "HireDate", "Salary" ;
ALIAS 'CUST' NOBORDER
oBrw:lRecordSelector := .f.
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
oBrw:CreateFromCode()
@ oBrw:nbottom+10, 2 BUTTON oBtn PROMPT "&Nuovo articolo" ;
SIZE 55, 20 PIXEL OF oWnd ACTION nil
@ oBrw:nbottom+10, 62 BUTTON oBtn PROMPT "&Modifica articolo" ;
SIZE 55, 20 PIXEL OF oWnd ACTION nil
@ oBrw:nbottom+10, 120 BUTTON oBtn PROMPT "&Cancella articolo" ;
SIZE 55, 20 PIXEL OF oWnd ACTION nil
@ oBrw:nbottom+60, 4 FOLDER oFld3 PIXEL ;
ITEMS "&Comments","Private comments";
SIZE 200,50
ACTIVATE WINDOW oWnd;
ON RESIZE RESIZECONTROLS(nSizeType,nWidth,nHeight,oWnd );
RETURN NIL
STATIC FUNCTION RESIZECONTROLS(nSizeType,nWidth,nHeight, oWnd )
LOCAL oCtl
LOCAL i
STATIC aWidth := {}
STATIC aHeight := {}
STATIC StartWidth , StartHeight
IF EMPTY( aWidth )
FOR EACH oCtl IN oWnd:aControls
AADD( aWidth , oCtl:nWidth() )
AADD( aHeight , oCtl:nHeight() )
NEXT
StartWidth := oWnd:nWidth()
StartHeight := oWnd:nHeight()
ENDIF
FOR EACH oCtl IN oWnd:aControls
i := Hb_EnumIndex()
oCtl:Move( oCtl:nTop, oCtl:nLeft, aWidth[i]* oWnd:nWidth()/StartWidth , aHeight[i] * oWnd:nHeight()/StartHeight , .T. )
NEXT
RETURN NIL