Como podria poner los chekbox en el Treview
Publicado: Vie Abr 17, 2009 8:31 pm
La verdad, me interesa sobre manera resolver este asunto, una ayudita, solo
diganme como
poner los chekbox en el Treview
CLASS TTreeView FROM XTreeView
METHOD WMLButtonDown(wParam, lParam)
ENDCLASS
METHOD WMLButtonDown(wParam, lParam ) CLASS TTreeview
LOCAL R, aState, X, I
LOCAL aRect := {}
LOCAL cxLeft, cxEsp, cxbtnSize, cxCant, cdPostPaint
LOCAL oItem, nLeft, nRight, nTop
LOCAL nX := LOWORD( lParam )
LOCAL nY := HIWORD( lParam )
cxEsp := 56
cxBtnSize := 15
IF ( oItem := ::HitTest( nX, nY ) ) != Nil
IF ::SetFocus()
oItem:Select()
ENDIF
ENDIF
cxCant := LEN(oItem:aItems)
AADD(aRect,::GetItemRect(oItem:nIndex))
IF !LEN(aRect) > 0
RETURN .F.
ELSE
cxLeft := aRect[1,1]
nTop := aRect[1,2]
nLeft := ::nWidth - cxLeft // ::nLeft+265 // nWidth - cxLeft
ENDIF
nTop := aRect[1,2]
FOR i:= 0 To cxCant - 1
X := ::nWidth - cxLeft + cxEsp
nLeft := X + (I * cxbtnSize)
IF oItem:IsExpanded
AState := 1
ELSE
AState := 0
ENDIF
TCheckBox():Create(::oParent, nLeft , nTop, 15, 20) //Como podria
poner los chekbox en el Treview
*WITH OBJECT TCheckBox():Create(::oparent,nTop, nLeft, nWidth,n
Height)
* :nTop := nTop
* :nLeft := nLeft
* :nWidth := 15
* :nHeight := 20
*:Create()
*END
NEXT
RETURN Super:WMLButtonDown()
diganme como
poner los chekbox en el Treview
CLASS TTreeView FROM XTreeView
METHOD WMLButtonDown(wParam, lParam)
ENDCLASS
METHOD WMLButtonDown(wParam, lParam ) CLASS TTreeview
LOCAL R, aState, X, I
LOCAL aRect := {}
LOCAL cxLeft, cxEsp, cxbtnSize, cxCant, cdPostPaint
LOCAL oItem, nLeft, nRight, nTop
LOCAL nX := LOWORD( lParam )
LOCAL nY := HIWORD( lParam )
cxEsp := 56
cxBtnSize := 15
IF ( oItem := ::HitTest( nX, nY ) ) != Nil
IF ::SetFocus()
oItem:Select()
ENDIF
ENDIF
cxCant := LEN(oItem:aItems)
AADD(aRect,::GetItemRect(oItem:nIndex))
IF !LEN(aRect) > 0
RETURN .F.
ELSE
cxLeft := aRect[1,1]
nTop := aRect[1,2]
nLeft := ::nWidth - cxLeft // ::nLeft+265 // nWidth - cxLeft
ENDIF
nTop := aRect[1,2]
FOR i:= 0 To cxCant - 1
X := ::nWidth - cxLeft + cxEsp
nLeft := X + (I * cxbtnSize)
IF oItem:IsExpanded
AState := 1
ELSE
AState := 0
ENDIF
TCheckBox():Create(::oParent, nLeft , nTop, 15, 20) //Como podria
poner los chekbox en el Treview
*WITH OBJECT TCheckBox():Create(::oparent,nTop, nLeft, nWidth,n
Height)
* :nTop := nTop
* :nLeft := nLeft
* :nWidth := 15
* :nHeight := 20
*:Create()
*END
NEXT
RETURN Super:WMLButtonDown()