florisch Posted November 25, 2008 Share Posted November 25, 2008 Its been long . . . Problem: $iIndex = _GUICtrlListViewInsertItem($ListView, $Itemtext)oÝ÷ Ú¬jz-êÛz¯«¶§ØZvV¬·'¬b²z-¦,¹^j|¦¢·¢)ìz»Zr©ë^®¶Üx^©ÝJæȵé¬Ó~µé{b±«-®)àÂ+aªê-ªê-±êZ«h®ÆÞ·Ëצ±+צ±Ú'¢Ø¶ÇÂ+aB¶¹KËUìÇ«´^+ljYbØ^~*ìµÊ%ºiÈ«Þr^Âêì"wè®fß®¯j¸¨ºÊeiǬjwh¢}©e¶jÖ¢²Ø^æ§"צël{®×"z+uêí¢W½é¨²Ú¶¡×¥G¢·¬!û¦nWjº.Ö§vfzØb±«¢+Ù1½°ÀÌØí%ѵQáÐôMÑÉ¥¹MÁ±¥Ð ÀÌØí%ѵÑáаÅÕ½ÐíðÅÕ½Ðì¤)1½°ÀÌØíI½ÝlÅumU ½Õ¹ ÀÌØí%ѵQáÐ¥t)½ÈÀÌØí¤ôÀѼU ½Õ¹ ÀÌØí%ѵQáФ´È($ÀÌØíI½ÝlÁulÀÌØí¥tôÀÌØí%ѵQáÑlÀÌØí¤¬Åt)9áÐìÀÌØí¤)}U% Ñɱ1¥ÍÑY¥Ý}ÉÉä ÀÌØí1¥ÍÑY¥Ü°ÀÌØíI½Ü¤ Does anybody know something more elegant? (Apart from refactoring the complete code.) Link to comment Share on other sites More sharing options...
ReFran Posted November 25, 2008 Share Posted November 25, 2008 (edited) Does anybody know something more elegant? (Apart from refactoring the complete code.) I've had the problem by updating an old Script. I changed it to: $nItem = $vFilename &"|" &"*" &"|" &$AcPg &"|"&$BM &"|" & $vFileDate &"|" & $aFiles[1] if _GUICtrlListView_GetSelectedCount($listview) = 0 then GUICtrlCreateListViewItem($nItem, $ListView) Else LVInsertItem($nItem) endif ... Func LVInsertItem($nItem) $Index = _GUICtrlListView_GetNextItem($Listview) _GUICtrlListView_InsertItem($Listview,$nItem, $Index + 1) _GUICtrlListView_SetItemText($Listview, $Index + 1,$nItem,-1) endfunc HTH, Reinhard Edited November 25, 2008 by ReFran Link to comment Share on other sites More sharing options...
florisch Posted November 26, 2008 Author Share Posted November 26, 2008 Ha! Thats what I was looking for. _GUICtrlListView_SetItemText($Listview, $Index + 1,$nItem,[b]-1[/b])With "-1" for Subitem index this sets the complete row. Found it in the Help too, too blind to see it earlier.Thanks for the help, Reinhard.The other way round is working fine since I found out that _GUICtrlListViewGetItemText is better replaced by _GUICtrlListView_GetItemTextString than _GUICtrlListView_GetItemText Link to comment Share on other sites More sharing options...
ReFran Posted November 26, 2008 Share Posted November 26, 2008 Ha! Thats what I was looking for.Fine that I could help.You may have a look at this thread to get some more hints:http://www.autoitscript.com/forum/index.ph...=70902&st=0Finally I translated only 2 bigger scripts - but with intensive using of listviews (old standard UDF) and treeviews (old Au3lib) possibilities (move up/down, insert at, sort, find/replace, edit, .....).For the listview part I noted:;; not correct translated;_GUICtrlListView_InsertItem($listview, $m_ItemNew, $i_to+1);_GUICtrlListView_SetItemText($listview, $i_to+1, $m_ItemNew, -1);_GUICtrlListView_DeleteItem(GUICtrlGetHandle($listview), $i_to)I think the sorting routines I also changed manual.Good luck, Reinhard Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now