1.1 Add a new cmytreeview class using Appwizard in classview of vc6.0 and inherit from ctreeview
1 void labels: onupdate (cview * psender, lparam lhint, cobject * phint) 2 {3 ctreectrl & m_tree = gettreectrl (); // set the tree style 4 m_tree.modifystyle (0, tvs_hasbuttons | tvs_linesatroot | tvs_haslines); 5 m_tree.insertitem (_ T ("China"), 0, 1, tvi_root, tvi_last); 6}
Add the listview formview editview
In maiframe,
1 bool cmainframe: oncreateclient (lpcreatestruct lpcs, ccreatecontext * pcontext) 2 {3 crect rect; 4 getclientrect (& rect); 5 // split 6 if (! M_wndsplitfirst.createstatic (this, 1, 2) // static split, one row of 2 columns 7 return false; 8 // split the first view after 1 If (! M_wndsplitfirst.createview (0, 0, runtime_class (cmytreeview1), csize (rect. width ()/5, rect. height (), pcontext) 9 {10 m_wndsplitfirst.destroywindow (); 11 return false; 12} 13 // The second split 14 if (! M_wndsplitsecon.createstatic (& m_wndsplitfirst, 2,1, ws_child | ws_visible, _ wndsplitfirst. idfromrowcol (0, 1) 15 {16 return false; 17} 18 if (! M_wndsplitsecon.createview (1, 0, runtime_class (cmylistview), csize (rect. width ()/5*4, rect. height ()/2), pcontext) 19 {20 m_wndsplitsecon.destroywindow (); 21 return false; 22} 23
M_wndsplitsecon.setrowinfo (0, rect. Height ()/2, 0 );
24 // The third split 25 if (! M_wndsplitthird.createstatic (& m_wndsplitsecon, 1, 2, ws_child | ws_visible, m_wndsplitsecon.idfromrowcol (0, 0) 26 {27 return false; 28} 29 If (! M_wndsplitthird.createview (0, 0, runtime_class (cmyformview), csize (rect. width ()/5*2, rect. height ()/2), pcontext) 30 {31 m_wndsplitsecon.destroywindow (); 32 return false; 33} 34 if (! M_wndsplitthird.createview (0, 1, runtime_class (cmyeditview), csize (rect. width ()/5*2, rect. height ()/2), pcontext) 35 {36 m_wndsplitsecon.destroywindow (); 37 return false; 38} 39 40 return true; 41}