On 4/19/07, Jesus Reyes <[EMAIL PROTECTED]> wrote:

>  * Click fires twice when selecting a range (not sure why)

If it's by selection using the mouse it could be because using the
mouse will trigger one click normally and now (If I'm no wrong, in
hunk @@ -4328,7 +4330,10 @@) one additional click was introduced.

Yes, it was selection using a mouse.  I'll make the change tomorrow in
my copy and see how things go. Thanks.

>  * On loosing focus in a TStringGrid, it doesn't show the last
> selected cell. Compared to Delphi the cell's background should be
> painted with the selection color (but no focus rectangle).
>

This is one of the features of delphi grids I never liked there is no
way to disable it (or at least I didn't know how), so I didn't
implement it, however if you add option goDrawFocusSelected it should
show it as you describe.

Yes, the goDrawFocusSelected solves that problem and wonder if it
should be enabled by default.  If not, every developer can enable that
when required I guess. I just thought it looks odd loosing focus and
not have any hint as to what was selected in the grid.

IMO a Click is (or should be) caused only for a mouse action, and
having it triggered when a key is pressed or programmatically, start
to make things confusing.

There is (IMHO) a better event: OnSelection, this triggers every time
selection has moved for whatever cause, mouse, keyboad or by
programmatically moving Row or Col.

Well, seeing that Lazarus is trying to be Delphi compatible, maybe we
should keep following that.  No point in having some components follow
Delphi and others not.
As for the Click being confusing when triggered by a key press, many
other components do the same as far as I can remember. Spacebar or
Enter causes a click event on a button, spacebar on checkbox, etc..

However, if we should add click for compatibility reasons, from the
patch I can see the missing clicks are those who have to do with
selection change, then I propose to do it within MoveExtend before or

That was my first attempt. <smile> I added the call to Click in the
MoveExtend and it seem to work well, until I started monitoring the
amount of Click events being fired.  There was a lot of places where
the Click event fire up to three times with one user change.  With my
limited knowledge of the internals of TCustomGrid made it really hard
to debug, so the quicker solution for me was what I have done in the
patch.

PS:
 This is ending up being a good learning curve for me. Soon I want to
start implementing more features or improving the existing ones in the
fpGUI StringGrid.  I'm sure the knowledge I get here, will help me
later.

--
Graeme Geldenhuys

There's no place like S34° 03.168'  E018° 49.342'

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to