does somebody have made a "Layout-Manager" for FiveWin RESIZE
for each windows i have to write a function ... so i wrote a "Layout-Manager" for Xbase++
while Concept are for OOP i'm not sure if i can use that Technique with DIALOG Syntax.
after all Child on DIALOG are create i want to get Information of them as "Original" Value.
- Code: Select all Expand view
- ON INIT Layoutmanager(self)
it will init a List (Array) of Child and it's Pos / Size.
this must work recursive if a Child is Parent for other Control
- Code: Select all Expand view
- aChildGen1 := oParent:Childlist()
FOR i := 1 TO LEN(aChildGen1)
oObject := aChildGen1[i]
aChildGen2 := oObject:Childlist()
IF LEN(aChildGen2) > 0
Recursive(oObject)
ELSE
aadd(::aLayout, {oParent,oParent:nHeight,oParent:nWidth,;
oObject,oObject:nTop,oObject:nLeft,oObject:nHeight,oObject:nWidth } )
ENDIF
NEXT
under Xbase++ i can ASCAN() for a Object
i also can use o:Hwnd as workaround
- Code: Select all Expand view
- ON RESIZE Layoutmanager:Resize(self)
here "automatic" begin
- Code: Select all Expand view
- INLINE METHOD RESIZE(oIn)
nDlgObj := oIn
or
nDlgWnd ;= oIn:Hwnd
what i need is actual Size of DIALOG. this i need to calculate "Zoom-Faktor" to Original Size
now i start ASCAN() to get all Control to a Parent DIALOG
- Code: Select all Expand view
- LOCAL nPosi := 1
LOCAL nStart := 1
LOCAL nHeight := oIn:nHeight
LOCAL nWidth := oIn:nWidth
DO WHILE nPosi > 0
nPosi := ASCAN(::aLayout, {|e| e[1] = nDlgObj }, nStart )
IF nPosi > 0
::ZoomY := ::aLayout[nPosi][2] / nHeight * 100
::ZoomX := ::aLayout[nPosi][3] / nWidth * 100
oObject := ::aLayout[nPosi][4]
oObject:SetPos( {::aLayout[nPosi][5]+::ZoomX,::aLayout[nPosi][6]*::ZoomY} )
oObject:SetSize( {::aLayout[nPosi][7]+::ZoomX,::aLayout[nPosi][8]*::ZoomY} )
nStart := nPosi +1
ENDIF
ENDDO
nDlgObj:InvalidRect()
under Xbase++ it work with all "Original Windows" Control.
it fail e.g. with XbpBrowse() which "self made" with WC_STATIC (many Child ...)
---
i'm still a FiveWin Newbie so some parts of puzzle are missing like
Childlist() -> get all Child of a DIALOG or WINDOW
to test my Idea
or is hole Work obsolet while FiveWin have it but i have not found it yet