From: Jos v.d.V. <jo...@us...> - 2010-06-02 20:25:40
|
Update of /cvsroot/win32forth/win32forth/src/lib In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv6482/src/lib Modified Files: treeview.f Log Message: Jos: Moved tvitem into tvins. That avoids a MOVE when an item is inserted into the treeview. Notes: 1) In case of problems it can be rolled back when needed. 2) tvitem can not be a constant Index: treeview.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/lib/treeview.f,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** treeview.f 29 Nov 2009 22:17:22 -0000 1.14 --- treeview.f 2 Jun 2010 20:25:31 -0000 1.15 *************** *** 5,9 **** \ On creation needs a sensible StartSize: ( default set to size of parent ) \ Class control does not have the definition "null-check" which is in ! \ class Window and hence Child-Window. (( TreeView.F A rudimentary TreeView class by Michael Hillerström --- 5,9 ---- \ On creation needs a sensible StartSize: ( default set to size of parent ) \ Class control does not have the definition "null-check" which is in ! \ class Window and hence Child-Window. (( TreeView.F A rudimentary TreeView class by Michael Hillerström *************** *** 100,105 **** ;RecordSize: /nmhdr ! Record: tvitem ! int mask int hItem int state --- 100,105 ---- ;RecordSize: /nmhdr ! (( Record: tvitem \ Has been moved to tvins to avoid ! int mask \ a MOVE for each item that has been inserted. int hItem int state *************** *** 111,115 **** int cChildren int lParam ! ;RecordSize: /tvitem Record: tvins --- 111,115 ---- int cChildren int lParam ! ;RecordSize: /tvitem )) Record: tvins *************** *** 117,123 **** int hInsertAfter \ TV_ITEM item ! /tvitem bytes item ;RecordSize: /tvins \ Record: tvdi \ NMHDR hdr --- 117,137 ---- int hInsertAfter \ TV_ITEM item ! \ /tvitem bytes item ! int mask ! int hItem ! int state ! int stateMask ! int pszText ! int cchTextMax ! int iImage ! int iSelectedImage ! int cChildren ! int lParam ;RecordSize: /tvins + : tvitem ( - adr ) tvins 2 cells+ ; + + /tvins 2 cells- constant /tvitem + \ Record: tvdi \ NMHDR hdr *************** *** 180,185 **** nmtv /nmtv 2dup erase move ; ! : tvitem->tvins ( -- ) ! tvitem item /tvitem move ; --- 194,199 ---- nmtv /nmtv 2dup erase move ; ! : tvitem->tvins ( -- ) ; immediate \ Does nothing now ! \ tvitem item /tvitem move ; *************** *** 257,261 **** :M GetPrevious: ( hItem -- hItem ) TVGN_PREVIOUS GetNextItem: self ;M :M GetLastVisible: ( hItem -- hItem ) TVGN_LASTVISIBLE GetNextItem: self ;M ! :M GetFirstVisible: ( hItem -- hItem ) TVGN_FIRSTVISIBLE GetNextItem: self ;M int maxwidth --- 271,275 ---- :M GetPrevious: ( hItem -- hItem ) TVGN_PREVIOUS GetNextItem: self ;M :M GetLastVisible: ( hItem -- hItem ) TVGN_LASTVISIBLE GetNextItem: self ;M ! :M GetFirstVisible: ( hItem -- hItem ) TVGN_FIRSTVISIBLE GetNextItem: self ;M int maxwidth *************** *** 363,367 **** TVIF_TEXT TVIF_CHILDREN or to mask ! tvitem->tvins tvins 0 TVM_INSERTITEMA hWnd Call SendMessage to hPrev --- 377,381 ---- TVIF_TEXT TVIF_CHILDREN or to mask ! \ tvitem->tvins tvins 0 TVM_INSERTITEMA hWnd Call SendMessage to hPrev |