Home > Software engineering >  MFC much documents, according to the selected node of the tree of nodes and draw the corresponding d
MFC much documents, according to the selected node of the tree of nodes and draw the corresponding d

Time:09-24

I now is in accordance with the system automatically generated more docs, like MFC main interface, the left is a node tree, the node to add in the above, now want to click on one of the nodes, draw the corresponding data was obtained from the doc, drawing the dialog I placed in the output panel of a TAB, now data can be passed to the draw graphic dialog, but you can't draw the line in the dialog box, drawing data can't change according to click on the node, give everyone a great god a thought

CodePudding user response:

Inside the OnPaint paintings

CodePudding 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 same

CodePudding user response:

According to void CLeftView: : OnSelchanged (NMHDR * pNMHDR, LRESULT * pResult) get tree options corresponding documents, drawing,

CodePudding user response:

The CDC: : Polyline

CodePudding 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
  • Related