hi,
i got bOnCollapse working
Code: Select all | Expand
oPanel1:bOnCollapse := { | | CheckCollapse(oPanel1,cMsg,1) }
oPanel2:bOnCollapse := { | | CheckCollapse(oPanel2,cMsg,2) }
oPanel3:bOnCollapse := { | | CheckCollapse(oPanel3,cMsg,3) }
i don´t know how but METHOD LButtonUp will be "automatic" called which include
Code: Select all | Expand
if ! Empty( ::bOnCollapse ) // new
Eval( ::bOnCollapse, Self ) // new
endif // new
so this is my Solution
Code: Select all | Expand
PROCEDURE CheckCollapse(oPanel,cMessage,nPanel)
LOCAL n, yPos := 0
LOCAL aDim
local oFonttext
DEFINE FONT oFonttext NAME "Verdana" SIZE 0, -12
IF oPanel:lCollapsed = .T.
// do nothing
ELSE
DO CASE
CASE nPanel = 1
// fix Size
oPanel:nHeight := 80
CASE nPanel = 2
aDim = GetLabelDim( oPanel:hWnd, alltrim(cMessage), oFonttext:hFont )
oPanel:nHeight := aDim[ 2 ] + (3 * (oFonttext:nHeight() +2) )
oPanel:nBodyHeight := oPanel:nHeight - oPanel:nTitleHeight
CASE nPanel = 3
// fix Size
oPanel:nHeight := 80
ENDCASE
ENDIF
// re-position
for n= 1 to Len( oExbar:aPanels )
// move Panel to new Position
oExbar:aPanels[n]:Move(yPos)
oExbar:aPanels[n]:nBodyHeight := oExbar:aPanels[n]:nHeight - oExbar:aPanels[n]:nTitleHeight
oExbar:aPanels[n]:CoorsUpdate()
oExbar:aPanels[n]:UpdateRegion()
oExbar:CheckScroll()
yPos += oExbar:aPanels[n]:nHeight + 20
next
RELEASE oFonttext
* oExbar:Refresh()
invalidateRect(oExbar:hwnd,0, .T. )
RETURN