07-28-2020, 02:05 AM
i am trying to call a subFunction from my NOTIFY Messages. The sub.Function takes 3 parameters (a string, control ID, window ID). i call it from DlgProc with no issues but cant from Notify.
from DLGProc under messages3 i call Notify sub function like...
messages3
NMHDR* nh = +lParam
if(nh.idFrom=3) ret DT_Ret(hDlg sub.Notify(nh))
from sub.Notify i call the sub.reorder_grids("input" nh.idFrom nh.hwndFrom) ;;last line of code below
i get nothing...
from DLGProc under messages3 i call Notify sub function like...
messages3
NMHDR* nh = +lParam
if(nh.idFrom=3) ret DT_Ret(hDlg sub.Notify(nh))
from sub.Notify i call the sub.reorder_grids("input" nh.idFrom nh.hwndFrom) ;;last line of code below
i get nothing...
#sub DlgProc
function# hDlg message wParam lParam
#region WM_INITDIALOG
ICsv x._create
DlgGrid g.Init(hDlg 3)
DlgGrid g2.Init(hDlg 6)
DlgGrid g3.Init(hDlg 9)
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
#endregion
#region WM_COMMANDS
;messages2
sel wParam
,case IDOK
,case 7 ;; reorder input grid
,,sub.reorder_grids("input" 3 hDlg)
,case 8 ;; reorder subgraph grid
,,sub.reorder_grids("subgraph" 6 hDlg)
ret 1
#endregion
[hr]
#region WM_NOTIFY
;messages3
NMHDR* nh = +lParam
if(nh.idFrom=3) ret DT_Ret(hDlg sub.Notify(nh))
#endregion
ret 2
[hr]
#sub reorder_grids
function str'gtype controlId hDlg
DlgGrid g
g.Init(hDlg controlId) ;; add specific param for Grid object
,g.CellSet(c 3 sub.SC_syntx(gtype, g.CellGet(c 1), g.CellGet(c 2) ))
,g.CellSet(c 0 gtype)
[hr]
#sub Notify
function NMHDR*nh
DlgGrid g.Init(nh.hwndFrom)
GRID.QM_NMLVDATA* cd = +nh
NMLVDISPINFO* di = +nh
NMLISTVIEW* nlv = +nh
str s
sel nh.code ;;nh is NMHDR*, which is lParam of WM_NOTIFY message
,case LVN_ENDLABELEDIT
,if(nh.idFrom = 3) sub.reorder_grids("input" nh.idFrom nh.hwndFrom)