Jump to content

UniStringGrid Onmousedown


Lchris

Recommended Posts

Hello,

I have just downloaded the trial and started experimenting things.

The product looks impressive, but I have some newbie questions.

like vcl Unistringgrid has an event MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

where it returns X,Y coordinates of the mouse, ok..

But with the vcl I can do TCustomDrawGrid.MouseToCell(X, Y: Integer; var ACol, ARow: Longint);

to retrieve the grid Col a Row from the X, Y coordinates.

I did not find such a MouseToCell method for UniStringGrid ... how do I retrive the col & row inside OnMouseDown without it ?

Thanks

Chris

PS: I have to ask this because our VCL application is very old and does not use the DB... components at all.

It works well, but only relies on Tedit, Tcombobox, TlistBox, Tstringrid, poupulated manually.

This is probably a "non RAD" or "anti RAD" configuration you never encountered, and because you probably focused on DB... components 

I have to make sure it will work for us.

have a good day 

Link to comment
Share on other sites

Hi Sherzod,

I will test more this evening, after my daily taks.

I understand using the correct event that returns the Col/Row in first place is more efficient than asking the client for the Col/Row and waiting the answer.

Even in windows VCL Onmouseevent + mousetocell is inefficient, but allows compatibility of the OnmouseDown event across differend kind of inherited components.

 

But wth OnMouseDown you can filter the mouse Button and test the Shift state. OnCellSelect does not have this information. So OnMouseDown is still interresting.

I also noticed that events do not fire in the same order :

In VCL TStringGrid events fire in this order : SelectCell, MouseDown, MouseUp

In Unigui TUniStringGrid events fire in the order : MouseDown, MouseUp, SelectCell

I was testing this because I hoped that perhaps unlike Windows api you allready have both informations at first call, then you could bufferize them to provide the value later without having to recall the web client (obviously at mousedown X,Y and Col,Row are linked and keep the same until mouseup).

 

Link to comment
Share on other sites

  • 11 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...