i have some Control in WINDOW and want to "Resize" it
- Code: Select all Expand view RUN
- STATIC oWnd
DEFINE WINDOW oWnd FROM 0, 0 TO 600, 800 + 16 PIXEL TITLE "TVIP" ICON "A1MAIN" MENU BuildMenu()
...
ACTIVATE WINDOW oWnd CENTERED ON RESIZE DoReSize( oWnd, oBrw )
Question : do i have to "arrange" each Child Control or is there a "LayoutManager"
under Xbase++ i got
- Code: Select all Expand view RUN
- :Childlist() -> Array of Child-Control of WINDOW
under HMG / Extended Version i have
- Code: Select all Expand view RUN
- PROCEDURE DoGetLayout(cForm)
LOCAL aControl := GetControls( cForm )
LOCAL i, iMax := LEN(aControl)
FOR i := 1 TO iMax
// {ControlType, ControlName}
aItem := aControl[i]
cType := aItem[1]
cName := aItem[2]
...
AADD(aLayOutE,{ cType, cName, nRow,nCol, nWidth, nHeight,cFont } )
NEXT
RETURN
and use Array to Resize
- Code: Select all Expand view RUN
- PROCEDURE DoReSize(cForm)
LOCAL aOriginal := {800,600}
LOCAL nWidth := GetProperty( cForm ,"WIDTH")
LOCAL nHeight := GetProperty( cForm ,"HEIGHT")
LOCAL i, iMax := LEN(aLayOutE)
LOCAL xFactor, yFactor
LOCAL cType, cName, nRow,nCol ,nWide, nHigh,cFont, nFont
xFactor := nWidth / aOriginal[1]
yFactor := nHeight / aOriginal[2]
FOR i := 1 TO iMax
cType := aLayOutE[i][1]
cName := aLayOutE[i][2]
nRow := aLayOutE[i][3]
nCol := aLayOutE[i][4]
nWide := aLayOutE[i][5]
nHigh := aLayOutE[i][6]
cFont := aLayOutE[i][7]
nFont := aLayOutE[i][8]
SetProperty( cForm, cName ,"ROW",nRow*yFactor)
SetProperty( cForm, cName ,"COL",nCol*xFactor)
SetProperty( cForm, cName ,"WIDTH" ,nWide*xFactor )
SetProperty( cForm, cName ,"HEIGHT",nHigh*yFactor)
SetProperty( cForm, cName ,"FONTSIZE",nFont*yFactor)
NEXT
RETURN
---
i found :SetSize() but no :SetPos()
what shell i use
- Code: Select all Expand view RUN
- SetWindowPos( oObj:hWnd, HWND_TOP, X, Y, Width, Height )
- Code: Select all Expand view RUN
- SetBounds( X, Y, Width, Height )
---
- Code: Select all Expand view RUN
- PROCEDURE DoReSize()
// "Original" Rect, need "Update"
...
nTop := oWnd:nTop
nLeft := oWnd:nLeft
nBottom := oWnd:nBottom
nRight := oWnd:nRight
give me {0,0,600,800 }
but i have use CENTER
when using
- Code: Select all Expand view RUN
- oWnd:CoorsUpdate()
before i got "real" Coordinate
Request : when MENU is "activate" is it possible to "include" :CoorsUpdate()
---
so i still search for a \SAMPLE which show how to "Resize" under FiveWin