xList - Super ListIcon (Beta)

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

xList - Super ListIcon (Beta)

Post by Xombie »

So, this is one reason I haven't worked on xGrid that much lately. I needed an enhanced listicon for a work project and this is the fruit of that labor. Basically a listicon replacement. It's not a subclassed listicon but rather a completely hand drawn and managed listicon-like thing.

Please note that this is very much a beta and only currently intended for seeing how it will work. It's definitely not finished and there are quite a few features and bugs to work out. However, before you roll your eyes and think, "Great, another project he won't finish" I'll remind you that this is a project for work. I *have* to finish it :)

Code will be released when it's cleaned up more. It's a promise. Currently releasing as a library until I'm more happy with it.

Image

-------------------- Download From Here --------------------

NOTE: Please only use LONG, STRING, DOUBLE and BOOLEAN column types in this version. More will be added very, very soon (this weekend).

Features:
  • *Fast. Or at least faster than a listicon in my experience. It's really well suited for database applications because of the main (and only, currently) data loading function.

    *Multi-column sorting. Click a column to start and then hold down the control key to sort more columns. So you could sort by country and then province/state and then city, etc...

    *Column filtering. Right-click a column to get a list of unique values for that column. Select the ones you want to view and the list is filtered.

    *Footer! You can enable a footer for the list and pick different types of functions. If you look in my screenshot you'll see the footer row at the very bottom. I've told it to give me a maximum for column 6 and a non-empty string count for column 2. Footer functions can be changed simply by clicking in the column footer and choosing which function to use. They are dependent on the column type so if you click in a LONG column type you'll see functions like sum, max, min, avg and a STRING column type will (currently) let you see empty and non-empty string counts.

    *Movable columns. Right-click on a column and select the 'Move columns' option and choose where to move it. I could've done the same thing that normal listicons do but I think mine is easier.

    *The ability to hide columns. You can display only the columns you want and hide the others. There is a list control box button (the gray button in the very top-left of the list) that allows you to pick which columns to hide/show.

    *Columns are referenced by numerical ID values and are not tied to any specific order.

    *Columns are defined as specific types (long, string, boolean, double, date, etc...) and column functions are handled based on those types.

    *Extremely configurable. Currently I've only set it up for allowing you to change the grid line colors and default cell background/foreground colors but that list will grow soon. You can also change the font and colors for columns as you add them.

    *Column formats. Each different column type (long, boolean, string, date, etc...) will have it's own format type. Only one is configured currently and that's for the boolean type. You can choose to show an X or a check mark or an X without the box.
Soon-to-be-added Features
  • *Stronger configuration like setting individual cell colors and fonts and whole column colors/fonts that affect the cells within that column.

    *Cell editing so that you can make changes to the values. Click on a boolean field and it will check or uncheck.

    *The ability to save changes made from the above item. The program will call a user passed procedure to write out the information.

    *Color-If ability. So you can write simple statements for a column. Like for a LONG value column, color the cell XXXX color if the value is less than 10.

    *More types of columns - an example would be a progress bar type to display a progress bar within the column.

    *More format types. For example, currency for double values and different date formats. These only affect how the data is displayed and not the underlying data.

    *Ummm... too tired to remember what else is on my list.
An example call might be this...

Code: Select all

HoldSettings.s_xList_Settings
xListSetStandardSettings(@HoldSettings)
HoldSettings\ColorGrid = #Red
xListGadget(#ListMain, 0, 0, WindowWidth(#WindowMain), WindowHeight(#WindowMain) - 20 - 5, @HoldSettings)
I've included a simple example in the zip file to show how it works. Currently there is only one way to load data and that is shown in the example.

The following are the current user functions...
  • ProcedureDLL xListSetStandardSettings(*Settings.s_xList_Settings)

    ProcedureDLL.l xListGetCellValue(Gadget.l, Row.l, ColumnID.l, *Memory.l)

    ProcedureDLL xListRenameColumn(Gadget.l, ColumnID.l, Named.s)

    ProcedureDLL.l xListGadgetWidth(Gadget.l)

    ProcedureDLL.l xListGadgetHeight(Gadget.l)

    ProcedureDLL.l xListGetColumnCount(Gadget.l, OnlyVisible.l)

    ProcedureDLL.l xListGetRowCount(Gadget.l)

    ProcedureDLL xListClearRows(Gadget.l)

    ProcedureDLL xListHideColumn(Gadget.l, ColumnID.l, Hide.l)

    ProcedureDLL xListSetDoNotDraw(Gadget.l, DoNotDraw.l)

    ProcedureDLL xListSetHideHeader(Gadget.l, Hide.l)

    ProcedureDLL xListSetHideGrid(Gadget.l, Hide.l)

    ProcedureDLL xListAddColumn(Gadget.l, *Column.s_xList_Add_Column, *Font.s_xList_Font, *Colors.s_xList_Columns_Colors)

    ProcedureDLL xListEnableFooter(Gadget.l, ColumnID.l, Function.l)

    ProcedureDLL xListDisableFooter(Gadget.l, ColumnID.l)

    ProcedureDLL xListPrepareRows(Gadget.l, CountRows.l, CallbackDataRequester.l)
Remember, this is definitely a beta and I'm feverishly adding new features and fixing/cleaning code. Quite a few basic functions that should be there are not yet in because this is built (at the moment) for my work project and so is tailored for that. For example, I don't have a function to add single lines items yet. My work project is a database client and doesn't really need it so it's lower on my priority list.

Give it a spin and see what you think.
Last edited by Xombie on Sun Aug 03, 2008 3:15 am, edited 1 time in total.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Brilliant!

Can't wait to get home and try this!
maw

Post by maw »

This looks really promising!! Thank you!
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Another one of your great inventions. Really nice. :D
Proud registered Purebasic user.
Because programming should be fun.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Thanks, fellas. I'd be interested to hear what y'all think about it and how it performs. I've updated the code for some bug fixes and enabled some long and double formats. Also allowed for removing filters on individual columns. Mostly this was cleaning up some bad logic bugs.

In the following screenshot column 1 is right aligned and set to the #xList_ColumnFormat_Long_Thousands format. Column 3 is also right aligned and set to #xList_ColumnFormat_Double_Currency format. Column 6 uses the thousands format but is left aligned.

The basic values are still longs and doubles so sorting and other information is preserved. Only when the text is drawn is it formated.

Image

More features to be added soon.
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Updated for bug fixes and some new features.

The date type is in and currently has #xList_ColumnFormat_Date_YYYYMMDD and #xList_ColumnFormat_Date_MMDDYYYY formats.

There is an event filter that is triggered after a filter is applied. Also a mouse over event that is triggered when the mouse is over a cell within the list.

I added a simple way to save/retrieve user settings via an INI file. I will modify this in the future but just needed something immediately. I probably should've just removed it from the public version.

You can now rename columns, export to Excel (with puredisphelper), refresh the list display on demand and get at the memory location where the columns (and rows) are actually stored. That helps for faster checking of values.

Slowly working on configurable changes. You can change the selection color simply with the ColorSelection setting...

Code: Select all

      Define.s_xList_Settings HoldSettings
      xListSetStandardSettings(@HoldSettings)
      HoldSettings\ColorSelection = RGB(255, 120, 120)
      HoldSettings\EventMouseOverCell = @OnMouseOver() 
      HoldSettings\Named = "xList Test"
      xListGadget(#ListMain, 1, 0, WindowWidth(0), WindowHeight(0) - 20 - 5, @HoldSettings)
Lastly, when you identify a column row as Null (during the initial data pull) it will not display anything in the list for that item. This is regardless of whether it's a numeric and text field.

There are still some bugs to be worked out (footer issues, for one) but I'm working on them as I get to them.

http://www.seijin.net/xList/xList.zip
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I have a question and please understand - I'm not looking for compliments or pity and I'm not whining or trying to massage my ego. I'm just really curious.

Why isn't this more popular? I'm using it at work and it's been a great tool for handling large amounts of data, filtering, sorting and so much more all in one package. I figured it'd be useful for quite a few people.

So, like I said - I'm not a 13 year-old kid crying about how nobody plays with me. I'm honestly intrigued as to why this hasn't been picked up for use by anyone. Is it missing some crucial feature or...?
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Post by ozzie »

I'm interested, but do you have a version I can try that doesn't require me to have PureDispHelper installed?
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

Xombie wrote:Why isn't this more popular? I'm using it at work and it's been a great tool for handling large amounts of data, filtering, sorting and so much more all in one package. I figured it'd be useful for quite a few people.
I tried to compile it, but got an IMA at the line HoldSettings\Named = "xList Test".
If others try with same result, this and the missing help (and probably other files like an ini?) in your .zip might prevent from trying/using.
e.g.; where do I have to move the file "Xlist"?
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

1st .. this is a great piece of Software.... continue your work regardless of the feedback... it will be honored later ... believe me!

and I have some suggestions:

you can select a row by clicking in the "rowheader" but cannot select a column .. it's sorted instead: May you could move the sorting (asc/desc) into the contextmenu of the columnheader and let the user select a column by clicking on it's header?

if you need translations (into german) .... ask me :wink: it would be nice to have a selectable language...

and at least a question ... when will it become editable??
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

I've updated a little bit with a better filter.

http://www.seijin.net/xList/xList.zip

Image

Where you can see that it allows you to filter by simple ranges rather than just picking an item. It needs some work but is at least functional. It'll work for dates, longs and doubles. If you pick a date you will get dategadgets. If you pick long or double you'll get string gadgets. I will add in something for strings that allow you to choose "contains" or possibly even regular expressions. Not sure. This one has a bug in displaying current range filters but it's an easy fix.

@ozzie - I've removed the puredisphelper part. That was for exporting to Excel which I use at work. Errr... I just realized I left in the menu to export to Excel. I'll remove that for the next release soon.

@harff182 - I've also removed the part where it was allowing to save information to an ini file. I'll think of a better solution for that later. You put the xList file in your Purebasic \PureLibraries\UserLibraries directory. Mine is "C:\Program Files\PureBasic420\PureLibraries\UserLibraries" You will have to restart your editor for it to load it.

There are bug fixes in and you can use mouse wheel scroll now.

@walker - thank you. I was beginning to worry a little bit. Honestly, it's mostly for me but I really did figure it was a nice library for people.

For selecting the column - this is a listicon like thing and not a grid. What would you like it to do once you select a column? Maybe it's something I can build in another way. Sorting is important to it's main part - especially how it allows you to sort by multiple columns with the control key. But depending on what is needed, it could be built a different way.

It is already a little editable but not much so I'm not providing examples on that. At work I have it so you click on a checkbox to have it do something. I'm still working out the best way to make this user friendly. The code base allows it and I have a good idea on how to do it but just need to implement it.
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

Xombie wrote:I've updated a little bit with a better filter.
But it seems, you put in the wrong example - or it's to early :lol: , as I don't find any code for your 'filter'.
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

Sorry - right click on a column header. Either a numeric or date column and you should see it. It's automatically available for any column that is designated as RowType #Long, #Double or #Date.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

the reason for selecting a whole row/column is mostly to format the content (color, justification etc.) in the same way or delete the content (if this will be possible in the future?)... anyway .. it was just a thought...

EDIT.. the download contains the previous version? I can't see the improved filter...
Xombie
Addict
Addict
Posts: 898
Joined: Thu Jul 01, 2004 2:51 am
Location: Tacoma, WA
Contact:

Post by Xombie »

@walker - all of that should be possible with a menu option easy enough. Do you think that'd work well for your purposes? They would just be added to the current column menu.

I just checked the download and it should contain the updated version. The size is 36,331 bytes and size on disk is reported as 36,864. Created August 23rd, 5:07 pm Pacific Standard.

It's: http://www.seijin.net/xList/xList.zip

If you're using Test2.pb you should be able to right-click on column 1 to see an example of the filter. Or column 6.
Post Reply