Jump to content
Sign in to follow this  
lyledg

_GUICtrlListView_InsertItem issues

Recommended Posts

lyledg

I am having some issues trying to insert data, using the new version 3.2.10.0 and code below

_GUICtrlListView_InsertItem($LISTVIEW, GUICtrlRead($APPNAMEinput) & "|" & $Inputrslt, -1);Write out the command line

It inserts all the text into the first column, (See attached pic) although I want the data spread across two columns.

This used to work on the older version of Autoit...what am I doing wrong?

EDIT: typo

post-2827-1200436413_thumb.jpg

Edited by lyledg

Share this post


Link to post
Share on other sites
GaryFrost

I am having some issues trying to insert data, using the new version 3.2.10.0 and code below

_GUICtrlListView_InsertItem($LISTVIEW, GUICtrlRead($APPNAMEinput) & "|" & $Inputrslt, -1);Write out the command line

It inserts all the text into the first column, (See attached pic) although I want the data spread across two columns.

This used to work on the older version of Autoit...what am I doing wrong?

EDIT: typo

Things change:

Remarks

You can not use this function to insert subitems. Use _GUICtrlListView_SetItemText to insert subitems.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
lyledg

Thanks Gary

But still having issues.

Command is:

_GUICtrlListView_SetItemText($Listview, 1,  GUICtrlRead($APPNAMEinp) & "|" & $Inputrslt, 1);Write out the command line

Am I right in thinking that you have to have text in the listview before you can use _GUICtrlListView_SetItemText?

Edited by lyledg

Share this post


Link to post
Share on other sites
GaryFrost

Thanks Gary

But still having issues.

Command is:

_GUICtrlListView_SetItemText($Listview, 1,  GUICtrlRead($APPNAMEinp) & "|" & $Inputrslt, 1);Write out the command line

Am I right in thinking that you have to have text in the listview before you can use _GUICtrlListView_SetItemText?

Just do an insert with no text, then use the setitemtext

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
lyledg

Thanks Gary

I will give that a go, but why was the workability of the function we had been made more difficult? Could the new function not have kept that functionality?

Share this post


Link to post
Share on other sites
GaryFrost

Thanks Gary

I will give that a go, but why was the workability of the function we had been made more difficult? Could the new function not have kept that functionality?

I merged the Standard Libraries with the AU3Libs, around 1500 or 1600 functions

I might if I get around to looking at that function again, probably just do internally what I just told you to do.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
lyledg

Ok, thanks mate...It would make things eaiser having one step instead of a few..

Cheers

Share this post


Link to post
Share on other sites
GaryFrost

Ok, thanks mate...It would make things eaiser having one step instead of a few..

Cheers

for now just write a wrapper function that does those steps


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
GaryFrost

Just looked at the code and remembered why that functionality wasn't put back in, the insert does a whole lot more than it used to.

Sets image if needed, sets param if needed, etc...

Wouldn't be worth all the trouble.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
JimZ

OK, I am a newbie to Autoit and have the same problem. I am trying to make an older script work with a newer version of Autoit. This line from the old script:

_GUICtrlListViewInsertItem($lv, -1, $data)

used to format a line in a table. I changed it to _GUICtrlListView_InsertItem($lv, $data, -1) and now I get all of the fields in column 1 of the table.

I tried replacing the InsertItem with the SetItemText and that did not work for me. I am not quite sure what you meant by do an insert with no text and then us SetItemText. Could you explain that a little more?

Thanks,

Jim Z.

Share this post


Link to post
Share on other sites
Melba23

JimZ,

Welcome to the AutoIt forum. :idea:

Have you looked at the Help file? For my version(3.3.6.1) the Remarks for this command include:

You can not use this function to insert subitems. Use _GUICtrlListView_SetItemText to insert subitems.

So it is hardly surprising that you can only enter fields in the first column - if you need to put data in the other columns you need a different command.

Perhaps if you posted your code (always a good idea :( ) we might be able to offer more help. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×