A basic grid control (major revision)
Update
Update:
the work is coming along nicely, but a lot of the internals have changed. In particular, Egrids now have their own containers in order to avoid the user having to use a windows callback function just to utilise an 'egrid' gadget.
Have added:
I think things will move quickly now, particularly with the following 'todo' list:
In the meantime, I thank everyone who can help track down the more elusive bugs.
http://www.purecoder.net/purebasic/egrid.zip
the work is coming along nicely, but a lot of the internals have changed. In particular, Egrids now have their own containers in order to avoid the user having to use a windows callback function just to utilise an 'egrid' gadget.
Have added:
- facility to prevent the user from resizing columns (via a simple flag)
resizing of an egrid
facility to colour individual cells
I think things will move quickly now, particularly with the following 'todo' list:
- Colour the string gadget being used to edit cells to match the underlying cell (easy)
allow the header row to be resized (not so easy)
scrolling through cells using direction and tab keys etc.
At present, the entire egrid scrolls but the focus remains with the cell
currently being edited (easyish!)
Click and drag multiple cell selection and associated operations (fiddly!)
In the meantime, I thank everyone who can help track down the more elusive bugs.
http://www.purecoder.net/purebasic/egrid.zip
I may look like a mule, but I'm not a complete ass.
Blade wrote:
Thanks.
***Minor update***
The string gadget used to edit cells is now painted to match the text and background colours of the underlying cell exactly.
http://www.purecoder.net/purebasic/egrid.zip
That's one of the things on the 'todo' list. The current scrolling mechanism is just a stop-gap solution!Is it possible to use arrows keys to move the selected cel?
Pressing return to move to the next one, with editing cursor already activated?
Thanks.
***Minor update***
The string gadget used to edit cells is now painted to match the text and background colours of the underlying cell exactly.
http://www.purecoder.net/purebasic/egrid.zip
I may look like a mule, but I'm not a complete ass.
***Major revision - now version 1.1***
Work is nearly complete now on this first version of an editable grid control. However, I've had to re-write a major chunk of the code because of a problem with Windows and so am again putting this out for bug-spotting purposes.
Previous versions required the user to create a ‘cell map’ in order to colour the cells of an egrid. This is no longer required because of the facility to include a user defined callback procedure.
Such callbacks are optional and allow the developer to validate changes made to individual cells (changes can be refused), to write only the changed cells back to a database etc. and also allows for the colouring of individual cells.
This paves the way for the creation of ‘virtual’ egrids later on.
Have also added:
http://www.purecoder.net/purebasic/egrid.zip
Work is nearly complete now on this first version of an editable grid control. However, I've had to re-write a major chunk of the code because of a problem with Windows and so am again putting this out for bug-spotting purposes.
Previous versions required the user to create a ‘cell map’ in order to colour the cells of an egrid. This is no longer required because of the facility to include a user defined callback procedure.
Such callbacks are optional and allow the developer to validate changes made to individual cells (changes can be refused), to write only the changed cells back to a database etc. and also allows for the colouring of individual cells.
This paves the way for the creation of ‘virtual’ egrids later on.
Have also added:
- header control no longer displays the resizing cursor if the underlying egrid has the resizecolumnsflag set to #egrid_ResizeColumnsFalse.
- bug fixed. Prohibiting the resizing of columns did not work on Windows 98 etc.
- Added egrid_SetHeaderFont(#Gadget, fontID) command which allows the font to be changed within the header row (which is automatically resized).
- Added egrid_SetHeaderHeight(#Gadget, fontID) command which allows the height of the header row to be changed.
- Added functions egrid_NumberOfRows(#Gadget) and egrid_NumberOfColumns(#Gadget).
- the edit control (string gadget) now displays text with the same text colour and background colour as the underlying cell etc.
http://www.purecoder.net/purebasic/egrid.zip
Last edited by srod on Fri Sep 30, 2005 10:09 pm, edited 1 time in total.
I may look like a mule, but I'm not a complete ass.
I think I've fixed this. I'm unable to test the fix though as I do not have a mousewheel!Trond wrote:Very very nice but you have to click TWO times in a row on the same cell to change which control is affected by the scrollwheel.
Thanks for testing.
I may look like a mule, but I'm not a complete ass.
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Thanks Thorsten.
I'm working on moving between cells with the cursor keys right now and then it will be click-and-drag type multiple cell selection. I like your idea, although my example program shows one way of using the CellCallback function to protect a column. I think I'll add to this mechanism to give the user complete control over the string gadget and thus the developer will be able to prevent the user even clicking in a protected column.
Regards.
I'm working on moving between cells with the cursor keys right now and then it will be click-and-drag type multiple cell selection. I like your idea, although my example program shows one way of using the CellCallback function to protect a column. I think I'll add to this mechanism to give the user complete control over the string gadget and thus the developer will be able to prevent the user even clicking in a protected column.
Regards.
I may look like a mule, but I'm not a complete ass.