User Module: EasyGrid

Share your advanced PureBasic knowledge/code with the community.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

User Module: EasyGrid

Post by collectordave »

Hi All,

Apologies to anyone who saw my first attempt at a grid. After codeing that I found i needed two grids on one form while another was active on another form so recoded. This latest attempt allows you to have multiple grids on one window with another grid on another window. No pointers or difficult bits inside, I need to learn more about them first. The code can be downloaded here:- https://www.dropbox.com/s/v6t2mxd48tbvu ... d.zip?dl=0

Some explanation.

This prog defines the grid required in two parts. The first is a grid definition and the second is a two dimensional array of the data to display, only string data at the moment.

The first act is to define the data to be displayed, in the code you will see some procedures like "LoadGrid1Data()". These do as they say load the data to display into the array. replace these with your own load procedures.

The second act is to tell the module that you want a grid. You will see lines like this "cvsGrid1 = EasyGrid::New(10,40,500,300,ArraySize(Grid1data(),1),ArraySize(Grid1data(),2))" this displays the grid on your window and the module keeps track of it.

The last act is to display the grid like this EasyGrid::Drawgrid(cvsGrid1, Grid1Data()). This displays the grid with the data passed in the array.

You can have either a scrollable grid by adding scrollbars or a fixed grid, your choice. Columns can also be Autoresized or not depending on your choice. Each row and column can, if autoresize is not selected have their individual heights and widths changed.

Hopefully the code is fairly selfexplanatory if not please contact me and I will try to explain.

If anyone sees any potencial problems with this or can offer code or advice to improve it please post here, once included I will update the dropbox link.

Kind Regards

collectordave
Last edited by collectordave on Wed Oct 26, 2016 7:53 am, edited 2 times in total.
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: User Module: EasyGrid

Post by collectordave »

Just noticed this one http://www.purebasic.fr/english/viewtop ... lit=MyGrid Mygrid by said a lot more proffesional looking with lots more features.

If anyone knows of more grid links please post here.

collectordave
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
collectordave
Addict
Addict
Posts: 1310
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: User Module: EasyGrid

Post by collectordave »

First post updated with new code etc.

collectordave
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply