CodePudding user response:
Inside the OnPaint paintingsCodePudding user response:
OnSelchanged
////
Void CLeftView: : OnSelchanged (NMHDR * pNMHDR, LRESULT * pResult)
{
PNMHDR NM_TREEVIEW * pNMTreeView=(NM_TREEVIEW *);
//TODO: Add your the control notification handler code here
CMainFrame * pMain=(CMainFrame *) AfxGetMainWnd ();
//get LeftTree
CTreeCtrl& LeftTree=this - & gt; GetTreeCtrl ();
TVITEM * pNew=NULL;
//
Char tvinamenew [MAX_PATH];
PNew=& amp; (pNMTreeView - & gt; ItemNew);
CodePudding user response:
I now is to use the OnPaint, but inside the OnPaint I don't know how to change the drawing data, different nodes per click data obtained is not the sameCodePudding user response:
According to void CLeftView: : OnSelchanged (NMHDR * pNMHDR, LRESULT * pResult) get tree options corresponding documents, drawing,CodePudding user response:
The CDC: : PolylineCodePudding user response:
Too long without MFC! But still remember thinking!1, response control onSelchange such as news, or simply respond to keyboard, mouse messages, to get the current options,
2, can use sendMessage to drawing window, user messages, like WM_USER_UPDATE custom message, at the same time to obtain the address of the data or method by LPARAM message function parameters, WPARAM passed
3, the response message in the drawing window, pay equal attention to drawing window (what function? Forgot! Since in the Qt, will be no longer MFC)
4, drawing in the OnPaint