Page 2 of 2

Posted: Fri Sep 16, 2005 12:00 am
by srod
Thanks for testing the fix, it's all beginning to shape up quite nicely now.

Posted: Fri Sep 16, 2005 11:43 am
by Jellybean
Fixed, but you might want to have a look at this if it's not intentional: When scrolling the text field out of view and then into view again using the scroll wheel it has lost focus.

Posted: Fri Sep 16, 2005 8:37 pm
by srod
Jellybean:

My intention is to reposition the edit box everytime the grid is scrolled (like a spreadsheet etc.) and so I don't really intend for the edit box to retain focus, at least not at this stage.

Regards.

Update

Posted: Thu Sep 22, 2005 12:04 am
by srod
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:
  • facility to prevent the user from resizing columns (via a simple flag)
    resizing of an egrid
    facility to colour individual cells
Hopefully, all scrolling issues have been rectified, but as the code has changed quite a lot, I am again looking for testers etc.

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!)
Having learnt a whole heap from this project already, I can now begin to see how to extend this work (custom draw) to allow various gadgets to be embedded within individual cells etc.

In the meantime, I thank everyone who can help track down the more elusive bugs.

http://www.purecoder.net/purebasic/egrid.zip

Posted: Thu Sep 22, 2005 8:11 am
by Blade
Works great, no problems at all in Win2000.
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?
:)

Posted: Thu Sep 22, 2005 9:21 am
by zikitrake
srod, My new project wants to thank you for this code. :D

Posted: Thu Sep 22, 2005 1:01 pm
by srod
Blade wrote:
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?
That's one of the things on the 'todo' list. The current scrolling mechanism is just a stop-gap solution!

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

Posted: Fri Sep 30, 2005 2:53 pm
by srod
***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:
  • 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.
Thanks again to all testers.

http://www.purecoder.net/purebasic/egrid.zip

Posted: Fri Sep 30, 2005 3:43 pm
by Trond
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.

Posted: Fri Sep 30, 2005 9:14 pm
by srod
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.
I think I've fixed this. I'm unable to test the fix though as I do not have a mousewheel!

Thanks for testing.

Posted: Sat Oct 01, 2005 3:31 pm
by Thorsten1867
It's great! I'm looking for a long time to find a usable grid. :D

It would be nice to have:
- disable Stringgadget for protected column.
- move selektion (from protected cell to the next editable cell)

Thanks for your work.

(PS: Sorry for my bad englisch)

Posted: Sun Oct 02, 2005 10:54 am
by srod
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.