AutoIt Forums: add multiple lines to GUICtrlCreateListView in one statement - AutoIt Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

add multiple lines to GUICtrlCreateListView in one statement

#1 User is online   ShadowElf 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 31
  • Joined: 27-October 09

Posted 02 November 2009 - 07:47 AM

it is possible to add multiple lines to GUICtrlCreateListView in one statement
my actual script
[ code='text' ]    ( Popup )
$test=GUICtrlCreateListView ("Test|ab", 10,10,185,50 ) GUICtrlCreateListViewItem("xxx|yyy", $test) GUICtrlCreateListViewItem("sdf|sdf", $test) GUICtrlCreateListViewItem("asd|asdd", $test)  


I want
[ code='text' ]    ( Popup )
$test=GUICtrlCreateListView ("Test|ab", 10,10,185,50 ) GUICtrlCreateListViewItem("xxx|yyy &&& new line asdasd|aasd &&&& new line asdasd|dsaff", $test)  


it is possible?

(my list is very large and i want to optimize)
0

#2 User is offline   Yashied 

  • Happy in Moscow
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 1,435
  • Joined: 01-November 08
  • Gender:Male
  • Location:The dark spiral galaxy

Posted 02 November 2009 - 07:59 AM

You can create an array.

[ autoIt ]    ( Popup )
Dim $Data[3] = ["xxx|yyy", "sdf|sdf", "asd|asdd"] $test = GUICtrlCreateListView("Test|ab", 10, 10, 185, 50) For $i = 0 To UBound($Data) - 1     GUICtrlCreateListViewItem($Data[$i], $test) Next

This post has been edited by Yashied: 02 November 2009 - 07:59 AM

0

#3 User is online   ShadowElf 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 31
  • Joined: 27-October 09

Posted 02 November 2009 - 08:04 AM

I have create an array, but it takes too much time to add all lines (some cases 3000 lines)
For optimize I want to delete entire control list and remake with all lines inside

in GUICtrlCreateList i can put all lines when i create control
0

#4 User is online   Authenticity 

  • Mass Spammer!
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 2,378
  • Joined: 22-January 09
  • Gender:Male

Posted 02 November 2009 - 01:40 PM

What is taking long? Typing in the array elements or adding them to the control?

If the later:
[ autoIt ]    ( Popup )
#include <WindowsConstants.au3> ;... $test = GUICtrlCreateListView("Test|ab", 10, 10, 185, 50) GUICtrlSendMsg($test, $WM_SETREDRAW, 0, 0) For $i = 0 To UBound($Data) - 1     ; Add a lot of items Next GUICtrlSendMsg($test, $WM_SETREDRAW, 1, 0)


may be a bit faster.

If the former, I have no idea how to make it faster. :)
0

#5 User is offline   Yashied 

  • Happy in Moscow
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 1,435
  • Joined: 01-November 08
  • Gender:Male
  • Location:The dark spiral galaxy

Posted 02 November 2009 - 01:55 PM

Or use _GUICtrlListView_Add...
0

#6 User is online   ShadowElf 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 31
  • Joined: 27-October 09

Posted 02 November 2009 - 03:28 PM

View PostYashied, on 02 November 2009 - 02:55 PM, said:

Or use _GUICtrlListView_Add...

It is faster? Because it doesn't support multiple line add at the same time
0

#7 User is online   GEOSoft 

  • Mr. Nice Guy [ NOT!]
  • Icon
  • Group: AutoIt MVPs(MVP)
  • Posts: 6,486
  • Joined: 08-December 03
  • Gender:Male
  • Location:Nanaimo, BC, Canada

Posted 02 November 2009 - 04:43 PM

If you have the array then you can just use _GUICtrlListView_AddArray()
Probably what you want to speed up is the array creation process itself.
0

#8 User is online   ShadowElf 

  • Member
  • Pip
  • Group: Full Members
  • Posts: 31
  • Joined: 27-October 09

Posted 03 November 2009 - 03:53 PM

thx all
_GUICtrlListView_AddArray() is the fastest way
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users