Mr Fraxzi
is neccesary modify TRBTN Class
isn't difficult
add new data
DATA bOnPopup
Change METHOD LButtonUp( nRow, nCol ) CLASS TRBtn
METHOD LButtonUp( nRow, nCol ) CLASS TRBtn
local oWnd
local lClick := IsOverWnd( ::hWnd, nRow, nCol )
local lAction := !empty( ::bAction )
if ::lDrag .or. ! Empty( ::oDragCursor )
return Super:LButtonUp( nRow, nCol )
endif
if ::bLButtonUp != nil
Eval( ::bLButtonUp, nRow, nCol)
endif
::lBtnUp = .t.
if ! ::lWorking
if ::lCaptured
::lCaptured = .f.
ReleaseCapture()
if ! ::lPressed
if ::lBtnDown
::lPressed = .t.
::Refresh()
endif
else
if ! ::lBtnDown
::lPressed = .f.
::Refresh()
endif
endif
if lClick
if ::oPopup != nil
do case
case ::nTypeButton == TYPE_SPLITPOPUP
if nRow >= ::nPopupMargin .or. ! lAction
if ::bOnPopup != nil
Eval( ::bOnPopup, nRow, nCol, Self )
else
oWnd := ::oWnd
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nHeight, 0, Self, .F. )
oWnd:oPopup = nil
::Refresh()
endif
else
::click()
endif
case ::nTypeButton == TYPE_POPUP
if nCol >= ::nPopupMargin .or. !lAction
if ::bOnPopup != nil
Eval( ::bOnPopup, nRow, nCol, Self )
else
oWnd := ::oWnd
oWnd:NcMouseMove() // close the tooltip
oWnd:oPopup = ::oPopup
::oPopup:Activate( ::nHeight, 0, Self, .F. )
oWnd:oPopup = nil
::Refresh()
endif
else
::click()
endif
otherwise
::Click()
endcase
else
do case
case ::nTypeButton == TYPE_SPLITPOPUP
if nRow >= ::nPopupMargin .or. !lAction
if ::bOnPopup != nil
Eval( ::bOnPopup, nRow, nCol, Self )
else
MsgInfo( "Non defined popup menu", "Class TRBtn" )
endif
else
::click()
endif
case ::nTypeButton == TYPE_POPUP
if nCol >= ::nPopupMargin .or. !lAction
if ::bOnPopup != nil
Eval( ::bOnPopup, nRow, nCol, Self )
else
MsgInfo( "Non defined popup menu", "Class TRBtn" )
endif
else
::Click()
endif
otherwise
::Click()
endcase
endif
endif
endif
endif
return 0