KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Design of ListView Sorting
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Jun 03, 2003 5:11 pm    Post subject: Design of ListView Sorting Reply with quote

ok, whats up with kixforms right now ...

I fixed the ListView sorting issue. The ListView now sorts null (empty) string items in proper sort order.

Have been giving the sorting much thought. Been working with Chris quite a bit on that over the last few days. The big "catch" (if you want to call it that) is to be able to specify a sort order on a per column basis. Because user can click on any given column, and the sorting has to be automatic, therefore, defined ahead of time.

We dismissed the dotnet method of sorting - translated to Kixtart - would be very, very clumbsy and slow. We looked at the ListView ActiveX control (vb) way of sorting, but that didn't provide for the automatic sorting through column header click.

So this is what I have so far:

1) Add a forth parameter to the ListView.Columns.Add method as follows:

$Column = $ListView.Columns.Add( Text, Width, Alignment, SortType )

where SortType is:

0 = String
1 = Numeric

and going forward:

2 = Float
3 = Date

etc, etc ... Dates introduce other issues, but we can get to that later. Also be able to specify the SortType through property, example:

$Column.SortType = Number

and be able to change the sorting on the fly, etc. Also to add a new Method to the ListView as follows:

$ListView.Sort( Column, SortOrder, SortType )

where:

Column = The column to sort
SortOrder = 0 = Ascending, 1=Descending
SortType = <type> that will override predefined column setting

anyways, this is where things are leading now, if anyone has any comments good, bad but not indifferent, please post here.

-Shawn
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Tue Jun 03, 2003 5:28 pm    Post subject: Reply with quote

hmmm, guess one could also Sort directly out of the Columns collection, syntatically instead of this:

$ListView.Sort( Column, SortOrder, SortType )

it coulc be this:

$ListView.Columns(1).Sort(SortOrder, SortType)

-Shawn
Back to top
View user's profile Send private message
Sealeopard
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 436
Location: Boston, MA

PostPosted: Tue Jun 03, 2003 6:42 pm    Post subject: Reply with quote

Interesting. The extension to this would be that KiXtart itself would now be able to sort arrays by creating a KIXforms form with a single listview item. One could put a little UDF wrapper around this that feeds the array (n-dimensional even) into the ListView, applies approrpiate sorting and then returns the sorted array.
_________________
Jens

'There are two kinds of vessels, submarines and targets.'
Back to top
View user's profile Send private message Send e-mail MSN Messenger
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Tue Jun 03, 2003 11:43 pm    Post subject: Reply with quote

Cool! When can we see something to play with. This would definately make some of the people using my programs happy.
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jun 04, 2003 1:04 am    Post subject: Reply with quote

Kelly, are you refering to the sorting fix, or the ability to sort by type (or are you refering to both) ?
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Wed Jun 04, 2003 3:13 am    Post subject: Reply with quote

Both.
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Wed Jun 04, 2003 2:41 pm    Post subject: Reply with quote

Nice Smile

Perhaps a third sorting order; randomize? Can't think of any good use right at this second, but perhaps it's something to think of for the extended future?

Another thing, when the column sorting is issued, would be multiple column sorting perhaps? Ie; sort first after column X, then column Y?

Personally though, directly editable listview objects comes first Mr. Green
Back to top
View user's profile Send private message MSN Messenger
Chris S.
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 05 Mar 2003
Posts: 241

PostPosted: Wed Jun 04, 2003 3:29 pm    Post subject: Reply with quote

What are you trying to do, turn KiXforms into Excel-lite? Laughing Wink
Back to top
View user's profile Send private message MSN Messenger
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Wed Jun 04, 2003 8:50 pm    Post subject: Reply with quote

Chris S. wrote:
What are you trying to do, turn KiXforms into Excel-lite? Laughing Wink

Yupp Mr. Green

hehe... nah, it's just very handy when you for example use KiXforms as a 'bridge' and for example the ListView object to present collected data for further processing. For example to insert it into a db etc (regarding editability). The other two things was just... more or useless stuff I guess Very Happy
Back to top
View user's profile Send private message MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Jun 04, 2003 9:25 pm    Post subject: Reply with quote

nah - not useless at all - the multicolumn sorting should actually "take care of itself", from what I'm seeing so far, if you sort one column, then sort another, then another in succession - you get the effect of a multi-column sort (just not done all at once)

Kixforms looking like Excel ? I can think of worse things to look like - and when I get around to coding the ListView GRID mode - it will look pretty much like Excel (ok, Excel-lite)
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Wed Jun 04, 2003 11:02 pm    Post subject: Reply with quote

When are mouse events for ListView coming?
_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
masken
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 14 Mar 2003
Posts: 202
Location: Gothenburg, Sweden

PostPosted: Thu Jun 05, 2003 8:19 am    Post subject: Reply with quote

krabourn wrote:
When are mouse events for ListView coming?

they're already there; .OnClick and .OnDoubleClick. Or were you thinking of something else?

Looking forward to the GRID mode shawn! Smile
Back to top
View user's profile Send private message MSN Messenger
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Thu Jun 05, 2003 5:31 pm    Post subject: Reply with quote

I think Shawn know what I mean.

I want all the mouse events.

I want to be able to say right click on a cell and popup a menu and take action on that cell contents, because I would know the row and column index.

I wrote this real fast so I hope it makes sense.

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jun 05, 2003 5:55 pm    Post subject: Reply with quote

ja - i think (correct me if im wrong) but all we really need is to have listview support OnMouseDown, MouseButton, MouseX and MouseY ... and your happening.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jun 05, 2003 8:21 pm    Post subject: Reply with quote

Chris, got your email. You made that look easy. Got another problem though. Looks as if large dirs over 2GB blow either the ListView numeric sort or the Kixtart limit for longs. I think maybe its a combinationof both. Internally, i'm using an signed integer. Might have to switch to float. Now wondering how the FSO Size property returns its data. As long, float or string.

-Shawn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group