> Hi everyone,
>
> it seemed so simple that I feel a bit stupid with that question, but...
> I want to fill a gridview with text coming from the keyboard, as in a
> crossword.
> I think I've to deal with the keypress event and the key.text data, but
> how can I identify the cell to fill. I cannot even see any cursor on my
> grid.
> I want not to use the mouse cursor because my fingers are on the
> keyboard all the time. I wish to define the next cell with the cursor
> keys only.
>
> Could someone give me a short sample or point me on the right direction?
>
> Thanks in advance for your help
> Dominique Simonart
>

Just implement the cursor your self. Create a class named MyGridView that 
inherits GridView. 

In it, create an observer on yourself to catch the KeyPress event, and add two 
class variables (let's name them $X and $Y) to store the cursor coordinates. 

Catch the Data event too to define the background / foreground of the cell: 
Color.SelectededBackground and Color.SelectedForeground for the current cell 
(Row = $Y and Column = $X), nothing otherwise (the standard colors).

Then each time you move the cursor, update the $X and $Y variables, and 
refresh the old current cell and the new one.

If you don't want to use the Data event, you must use the MyGridView[X, Y] 
cell accessor.

Regards,

-- 
Benoît

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to