Page 1 of 1

Listview.GetEntry

Posted: Sun Apr 01, 2018 1:32 pm
by djrikki
ListViews by their nature can have any number of Columns, this number can even be dynamic depending on the application, it's not always a fixed amount.

At times it would beneficial to me if were possible to Return values as a table instead of individual column$ variables.

Re: Listview.GetEntry

Posted: Mon Apr 02, 2018 9:48 pm
by airsoftsoftwair
Right, that is a good idea. I'll add a Pack() function which does the same as Unpack() but in reverse.

Re: Listview.GetEntry

Posted: Mon Apr 02, 2018 11:27 pm
by djrikki
That would be great, they are difficult to work at the moment.

Re: Listview.GetEntry

Posted: Wed Apr 11, 2018 8:45 pm
by djrikki
Equally it would be useful for Insert data into ListTrees as well.

So here is the scenario, ListView on the left, Column Titles... with Add/Remove buttons underneath to allow user to add rows of data.

The ListView on the right needs to react by adding and removing columns depending on the number of rows in the left-hand list view.

Furthermore the ListView on the right has buttons below for Adding and Removing rows of data.

So yeah very complicated, here's my ancient code that I need to refactor and figure out how I am going to make this work.

I wrote this over a year ago and I see here I that I have fixed the number of column titles to a maximum of 5; but hey I don't want restriction!

Code: Select all

	    If GetType(obj.rows[c][4]) <> #NIL
	        For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2],obj.rows[c][3],obj.rows[c][4])

	    ElseIf GetType(obj.rows[c][3]) <> #NIL
	        For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2],obj.rows[c][3])

	    ElseIf GetType(obj.rows[c][2]) <> #NIL
	        For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1],obj.rows[c][2])   

           ElseIf GetType(obj.rows[c][1]) <> #NIL
	        For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0], obj.rows[c][1])  

           ElseIf GetType(obj.rows[c][0]) <> #NIL
	        For Local c = 0 to ListItems(obj.rows)-1 Do mui.DoMethod(group .. "-columndata","insert","bottom",obj.rows[c][0])

	    EndIf
It doesn't look like I will be able add columns to the ListView on the right either so will have to do the initchange, exitchange on the entire object and re-populate any entries in the table as there is no AddColumn, RemoveColumn methods... going to get messy.

Re: Listview.GetEntry

Posted: Wed Apr 11, 2018 10:48 pm
by djrikki
"Equally it would be useful for Insert data into ListTrees as well."

I meant "ListViews" of course.

Re: Listview.GetEntry

Posted: Mon Apr 16, 2018 5:33 pm
by airsoftsoftwair

Code: Select all

- New: Added Pack() function; this will conveniently pack all of its parameter into a table and return
  it to you; it is the counterpart to Unpack()