This is all of it...
Code: Select all
#SingleInstance, Force
; -------------------------------------------------------------------------------------------------------------------
Gui, New
Gui, Font, s9 cBlue, Comic Sans MS
Gui, Add, Picture, x0 y0 h500 w800, C:\workspace\images\slat12.png
Gui, Font, s9 cBlue, Comic Sans MS
Gui, Add, Picture, x0 y0 h500 w800, C:\workspace\images\slat12.png
; -------------------------------------------------------------------------------------------------------------------
Gui, Add, Text, x25 y300 h100 w250 +BackgroundTrans cWhite, This is my Chalk Board
; -------------------------------------------------------------------------------------------------------------------
Gui, Add, ListBox, x25 y280 h51 w251 r5 vListViewFiles gGetListItem +Border, PropSites | here | there | everywhere
FileRead, Data1, C:\Users\coss-fin_services\Desktop\ahk\txt_data\prop_sites.txt
LV_Table(Data1,",",1,"Oregon Repeaters")
Gui, Show, x500 y500 h500 w800, Dashing
return
; -------------------------------------------------------------------------------------------------------------------
; FUNCTIONS
; -------------------------------------------------------------------------------------------------------------------
LV_Table(Data_Source, delimiter = ",",UseHeader = 1,Title = "") ; **** USER DEFINED FUNCTION ****
{
; default delimiter set to comma
if FileExist(Data_Source) ; if file exists use it as source
FileRead, Data_Source, %Data_Source% ; read in and store as variable
; end if
; parse the data in variable and store in object
data_obj := StrSplit(Data_Source,"`n","`r") ; parse earch row and store in object
rowHeader := StrReplace(data_obj.RemoveAt(1),Delimiter,"|",Numb_Columns) ; Remove header from Object and convert to pipe delimited
if (useHeader = 0)
{
loop, % Numb_Columns + 1
RH .= "Col_" A_Index "|"
rowHeader := RH
; Next Numb_Columns
}
; end if
dCols:= (Numb_Columns < 8) ? 400: ((Numb_Columns < 80) ? 650 : 1100) ; if cols <10 use 400; if cols <80 use 650 ; else use 1100
dRows:= (data_obj.MaxIndex() > 27) ? 26 : data_obj.MaxIndex() ; if rows >27 use 26 else use # of rows
Gui, Add, ListView, x25 y25 h250 w750 r%dRows% grid Border, % rowHeader ;%dCols% ; set headers
For Each, Row In data_obj ; add the data lines to the ListView
LV_Add("", StrSplit(Row, Delimiter)*) ; LV_Add is a variadic function
; Next Row
}
return
; -------------------------------------------------------------------------------------------------------------------
; LABELS
; -------------------------------------------------------------------------------------------------------------------
GetListItem:
Gui, Submit, NoHide
selection := ListViewFiles
MsgBox,,First, % selection
if (selection = "PropSites")
MsgBox,,Second,% selection
else if (selection = "Everywhere")
MsgBox,, Third, % selection
; end if
MsgBox,,Fourth, % selection
return
GuiClose:
ExitApp