User Module: EasyGrid
Posted: Thu Oct 20, 2016 7:11 am
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
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