randallc Posted July 14, 2006 Share Posted July 14, 2006 Hi, I have 2 problems with the list view at the moment, and I can post code if it is not already known?... 1. After Insert column, a full item will not be accepted by the listview. 2. Insert item only seems to work for subitems, not full items. As I say, if these are not known behaviour or not clear, I can post examples from help file. Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted July 15, 2006 Share Posted July 15, 2006 Hi,I have 2 problems with the list view at the moment, and I can post code if it is not already known?...1. After Insert column, a full item will not be accepted by the listview.2. Insert item only seems to work for subitems, not full items.As I say, if these are not known behaviour or not clear, I can post examples from help file.Best, Randall Examples of what your talking about would be helpfull. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 (edited) OK, Here is the column one first; I have modified the helpfile example to add 2 rows after each insert; but there is a fail error with the second one each time Randallc Edited July 15, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 Here is the item text; Perhaps I have the syntax wrong?... [The helpfile example only sets the text for first column, not whole row..] Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted July 15, 2006 Share Posted July 15, 2006 (edited) If you use the InsertColumn autoit still only reconizes the original # of columns you'll have to either do an new item with the origianl # of columns then set the last column to the data or expandcollapse popup#include <GuiConstants.au3> #include <GuiListView.au3> opt('MustDeclareVars', 1) Dim $listview, $Btn_InsertCol, $Btn_Exit, $msg, $Input_col, $Status GUICreate("ListView Insert Column", 392, 322) $listview = GUICtrlCreateListView("col1|col2|col3", 40, 30, 310, 149) GUICtrlCreateListViewItem("line1|data1|more1", $listview) GUICtrlCreateListViewItem("line2|data2|more2", $listview) GUICtrlCreateListViewItem("line3|data3|more3", $listview) GUICtrlCreateListViewItem("line4|data4|more4", $listview) GUICtrlCreateListViewItem("line5|data5|more5", $listview) GUICtrlCreateLabel("Enter Column # to Insert:", 90, 190, 130, 20) $Input_col = GUICtrlCreateInput("", 220, 190, 80, 20, $ES_NUMBER) GUICtrlSetLimit($Input_col, 1) $Btn_InsertCol = GUICtrlCreateButton("Insert Column", 150, 230, 90, 40) $Btn_Exit = GUICtrlCreateButton("Exit", 300, 260, 70, 30) $Status = GUICtrlCreateLabel("Remember columns are zero-indexed", 0, 302, 392, 20, BitOR($SS_SUNKEN, $SS_CENTER)) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Or $msg = $Btn_Exit ExitLoop Case $msg = $Btn_InsertCol If (StringLen(GUICtrlRead($Input_col)) > 0) Then If (_GUICtrlListViewInsertColumn ($listview, Int(GUICtrlRead($Input_col)), "test", 0, 40)) Then GUICtrlSetData($Status, 'Insert column: ' & GUICtrlRead($Input_col) & ' Successful') Else GUICtrlSetData($Status, 'Failed to Insert column : ' & GUICtrlRead($Input_col)) EndIf If (_GUICtrlListViewInsertItem($listview,-1,"lineINS|dataINS|moreINS") <> $LV_ERR) Then GUICtrlSetData($Status, 'Add row: ' & GUICtrlRead($Input_col) & ' Successful') Else GUICtrlSetData($Status, 'Failed to Insert row: ' & GUICtrlRead($Input_col)) EndIf If (_GUICtrlListViewInsertItem($listview,-1,"lineINS|dataINS|moreINS|more2INS") <> $LV_ERR) Then GUICtrlSetData($Status, 'Add row: ' & GUICtrlRead($Input_col) & ' Successful') Else GUICtrlSetData($Status, 'Failed to Insert row: ' & GUICtrlRead($Input_col)) EndIf Else GUICtrlSetData($Status, 'Must enter a column to insert') EndIf EndSelect WEnd Exit Edited July 15, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 (edited) Hi,I have 2 problems with the list view at the moment, and I can post code if it is not already known?...1. After Insert column, a full item will not be accepted by the listview.2. Insert item only seems to work for subitems, not full items.As I say, if these are not known behaviour or not clear, I can post examples from help file.Best, Randall 1. After Insert column, a full item will not be accepted by the listview.So can this be included in the helpfile; "GUICreateListViewItem" does not wortk, and the work-around?2. Insert item only seems to work for subitems, not full items.Did you see the example I gave as requested on this thread Gary?Best, Randallc Edited July 15, 2006 by randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted July 15, 2006 Share Posted July 15, 2006 The workaround is in my previous post, try the code, change the index for the insert, you'll see it works. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Zedna Posted July 15, 2006 Share Posted July 15, 2006 (edited) Here is the item text; Perhaps I have the syntax wrong?... [The helpfile example only sets the text for first column, not whole row..] Randall I din't look deep into but do you know difference between GUICtrlSetData and _GUICtrlListViewSetItemText? Edited July 15, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 No I don't; do you? Randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Zedna Posted July 15, 2006 Share Posted July 15, 2006 (edited) No I don't; do you?RandallcYes I do.By GUICtrlSetData you can set text for whole rowand by _GUICtrlListViewSetItemText you can set text only for particular column in row.for GUICtrlSetData you need remember item_id (returned from GUICtrlCreateListViewItem)For set text to whole row by _GUICtrlListViewSetItemText you need to parse your text by StringSplitand call _GUICtrlListViewSetItemText for every column (from that array returned by StringSplit)That's all. Edited July 15, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 Hi,If that is so..and it appears to be, then the helpfile is misleading?_GUICtrlListViewSetItemText --------------------------------------------------------------------------------Changes the text of a list-view item or subitem.So it says you can "Change the text of a list-view item ", not only individual subitems one at a time?..Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
GaryFrost Posted July 15, 2006 Share Posted July 15, 2006 Hi,If that is so..and it appears to be, then the helpfile is misleading?So it says you can "Change the text of a list-view item ", not only individual subitems one at a time?..Best, Randallitem = col 0, subitems = col > 0 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Zedna Posted July 15, 2006 Share Posted July 15, 2006 (edited) Hi,If that is so..and it appears to be, then the helpfile is misleading?So it says you can "Change the text of a list-view item ", not only individual subitems one at a time?..Best, RandallTerm ListView item means first column, that's terminology is correct by me.listview item row = listview item (first column) + listview subitems (second and above columns)EDIT: gafrost was quicker Edited July 15, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
GaryFrost Posted July 15, 2006 Share Posted July 15, 2006 see http://msdn.microsoft.com/library/en-us/sh...setitemtext.asp for any more questions about how the _GUICtrlListViewSetItemText function works. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
randallc Posted July 15, 2006 Author Share Posted July 15, 2006 All in the terminology! Perhaps that could be expanded at least in the HelpFile?... Thanks for your help. Best, randallc ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW 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