hi Antonio,
i have no (working) Code yet, just begin to build Method and HB_FUNC()
---
i have from TLISTVIE.PRG
- Code: Select all Expand view
METHOD Notify( nIdCtrl, nPtrNMHDR ) CLASS TListView
local nOption
local nCode := GetNMHDRCode( nPtrNMHDR )
do case
case nCode == NM_CLICK
...
case nCode == LVN_ITEMCHANGED
...
case nCode == LVN_GETDISPINFO // add here ?
do i add LVN_GETDISPINFO here
---
Listview can use "Single" API Call
- Code: Select all Expand view
Listview_InsertItem()
for each Row or "just" assign hole Array and use Notify Event when set LVN_GETDISPINFO
this is my Xbase++ using OT4XB Syntax
- Code: Select all Expand view
// create Notify Event to send UserDef Event xbeMyLv_DISPINFO
::SetLvNotifyCB( LVN_GETDISPINFO , ;
{ | xbp, code, lp, st | st := NMLVDISPINFO():New(), st:_write_( lp, 0, - 1 ), ;
PostAppEvent(xbeMyLv_DISPINFO, st:item, st, Self ), NIL } )
- Code: Select all Expand view
INLINE METHOD SetLvNotifyCB( notify_code , b )
local k,r
local np := PCount()
if Valtype(notify_code) != "N" ; return NIL ; end
k := cPrintf("LV%08.8X.notify",notify_code)
r := delegated_eval( {|| iif( ::m_ht == NIL,, _hdict_GetProp(::m_ht,k)) } )
if np > 1
if Valtype(b) == "B"
delegated_eval( {|| iif( ::m_ht == NIL,, _hdict_SetProp(::m_ht,k,b)) } )
else
delegated_eval( {|| iif( ::m_ht == NIL,, _hdict_RemoveProp(::m_ht,k)) } )
end
end
return r
- Code: Select all Expand view
// will be activate when get WM_NOTIFY
INLINE METHOD xbp_wndproc(hWnd,nMsg,wp,lp,ctx)
...
elseif nMsg == WM_NOTIFY
if lp == 0 ; return NIL ; end // must not happen
if( PeekDWord(lp) == ::hLv ) // hLv Handle of Listview
return ::_HandleListViewNotify_( PeekDWord(lp,8) , lp )
end
return NIL
- Code: Select all Expand view
// will EVAL() Codeblock
INLINE METHOD _HandleListViewNotify_( notify_code , p ) // do not call outside GUI thread
local b := iif( ::m_ht==NIL,NIL, _hdict_getprop(::m_ht, cPrintf("LV%08.8X.notify",notify_code)) )
if Valtype(b) =="B"
return Eval(b, Self , notify_code , p )
end
return NIL