View Issue Details

IDProjectCategoryView StatusLast Update
0034390LazarusLCLpublic2018-12-02 02:17
ReporterNewGuestAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformALLOSWindows 8.1 x64 SL RussianOS Version
Product VersionProduct Build 
Target Version2.0Fixed in Version2.1 (SVN) 
Summary0034390: MouseMoveEvent in DBGrid
DescriptionIn DBGrid, if you click and click on a previously selected row, the OnMouseMove event will not occur.
TagsNo tags attached.
Fixed in Revision59713
LazTarget2.0
Widgetset
Attached Files

Activities

NewGuest

2018-11-28 11:06

reporter   ~0112243

Last edited: 2018-11-28 11:07

View 2 revisions

Tell me when the fix is planned?

Thank's.

Jesus Reyes

2018-11-29 06:16

developer   ~0112253

That depends on if we agree there is a bug, from your description I'm not sure. Is the dbgrid attached to dataset? is the dataset active?, do you re-click on the same column?, is the option rowselect active?, ....

There are many things you don't describe and if there is a bug, I don't want to guess what the bug is.

Attach a sample project and describe better what you think is the bug.

NewGuest

2018-11-29 15:28

reporter   ~0112254

Last edited: 2018-11-29 15:33

View 2 revisions

The idea is to create a drag and drop effect using the drap & prop method. The only problem is that if you click the active cell, the drag event does not occur.
I can give an example of a project in the DataExpress program (it is developed in Lasarus. Author: Pavel Dubokin). This is the constructor inside which the DBGrid properties and methods are ported.
The program itself is located here: http://mydataexpress.ru/skachat.php
An example of the project was given here: https://base.mydataxpress.ru/download.php?fdb=DND_ROWS
The same question was asked to the author of DataExpress on the program's forum: http://forum.mydataexpress.ru/viewtopic.php?f=44&t=2443&p=21964


Example code (Pascal Script):

var MBPressed:boolean;
Msg:string;

procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if Self.State <> dsEdit then Self.Edit;
if MBPressed then
begin
Self.Forms['Форма 4'].Grid.Cursor:=crMultiDrag;
   if msg <> 'move' then
    begin
   msg:='move';
   debug(msg)
   end;
end;
end;

procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  MBPressed:=true
  msg:='mouse button down';
  debug('------- start --------')
  debug(msg)
end;

procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if MBPressed then
  begin
  msg:='mouse button up';
  debug(msg)
  debug('------- end --------'+0000013#10)
  MBPressed:=false;
  end;
end;

procedure Form_Create;
begin
  Self.Forms['Форма 4'].Grid.OnMouseMove:=@MouseMove;
  Self.Forms['Форма 4'].Grid.OnMouseDown:=@MouseDown;
  Self.Forms['Форма 4'].Grid.OnMouseUp:=@MouseUp;
end;

NewGuest

2018-11-29 15:46

reporter   ~0112255

Additionally made a screencast:
https://youtu.be/iX9Q4kfDolE

Jesus Reyes

2018-12-02 02:17

developer   ~0112310

Please test.

Issue History

Date Modified Username Field Change
2018-10-05 09:25 NewGuest New Issue
2018-10-05 12:59 Marco van de Voort Project FPC => Lazarus
2018-10-07 07:25 Jesus Reyes Assigned To => Jesus Reyes
2018-10-07 07:25 Jesus Reyes Status new => assigned
2018-11-28 11:06 NewGuest Note Added: 0112243
2018-11-28 11:07 NewGuest Note Edited: 0112243 View Revisions
2018-11-29 06:16 Jesus Reyes Note Added: 0112253
2018-11-29 15:28 NewGuest Note Added: 0112254
2018-11-29 15:33 NewGuest Note Edited: 0112254 View Revisions
2018-11-29 15:46 NewGuest Note Added: 0112255
2018-12-02 02:17 Jesus Reyes Fixed in Revision => 59713
2018-12-02 02:17 Jesus Reyes LazTarget => 2.0
2018-12-02 02:17 Jesus Reyes Note Added: 0112310
2018-12-02 02:17 Jesus Reyes Status assigned => resolved
2018-12-02 02:17 Jesus Reyes Fixed in Version => 2.1 (SVN)
2018-12-02 02:17 Jesus Reyes Resolution open => fixed
2018-12-02 02:17 Jesus Reyes Target Version => 2.0