Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

I need help to get my listview script functioning


  • Please log in to reply
3 replies to this topic
PMForkin
  • Members
  • 21 posts
  • Last active: Feb 26 2014 10:10 AM
  • Joined: 11 Dec 2012
#SingleInstance
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
Gui, Add, ListView, r23 w400, Row Key|Column 1|Column 2|Column 3|Column 4
; Generated using SmartGUI Creator for SciTE
; Create the ListView with five columns,for table texts:
Gui, Show, w425 h368, Untitled GUI
return
; the ListView will be used to display tabulated data
; the data to be entered into the above columns is a csv file
; its content is the following
; TRKey|Column 1|Column 2|Column 3|Column 4
; aaa |The boy |The boy |[nom m s] |Der Junge
; aab |has |is |[v m 3ps] |ist
; aac |gone |alone |[adv] |allein
; aad |to school |to school |[pr dat f s] |zur Schule
; aae |alone. |gone. |[v pp] |gegangen.
;
; It begins with a row key which is used to prevent sorting
; I cannot seem to fimd the corrct way to link the data to the columns
; I have found no documentation to explain how to do what I need

GuiClose:
ExitApp

edit: next time please use code tags! tlm

Please help me to solve problem. Thank you PMForkin



Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008

LV_ADD?


Any code that I post will be for AHK Basic.
I'm not always right, but I still try to help.

hd0202
  • Members
  • 709 posts
  • Last active: Feb 14 2016 08:05 PM
  • Joined: 13 Aug 2006

According to the example in HELP

; Create the ListView with two columns, Name and Size:

Gui, Add, ListView, r20 w700 gMyListView, Name|Size (KB)

; Gather a list of file names from a folder and put them into the ListView:

Loop, %A_MyDocuments%\*.*

    LV_Add("", A_LoopFileName, A_LoopFileSizeKB)

LV_ModifyCol() ; Auto-size each column to fit its contents.

LV_ModifyCol(2, "Integer") ; For sorting purposes, indicate that column 2 is an integer.

read the csv file (FileRead),

parse it into records (Loop, Parse, ...),

  split the records into columns (StringSplit)

  and add them to the listview (LV_Add)

at end modify columns to fit its contents (LV_ModifyCol)

 

If you need further help show us your script with your questions

 

Hubert



Psychofergo
  • Members
  • 23 posts
  • Last active: Jan 10 2015 04:41 PM
  • Joined: 09 Dec 2013

Also you can eliminate the first field by including +NoSort into the options of the ListView.
 

From help file:

 

 
NoSort: Turns off the automatic sorting that occurs when the user clicks a column header. However, the header will still behave visually like a button (unless NoSortHdr has been specified). In addition, the g-label will still receive the ColClick notification, to which it can respond with a custom sort or other action.