Commit c9969019 authored by Martin Schreiber's avatar Martin Schreiber

+ dragoptionty do_nearstart,do_mousewidget.

parent 070df91e
{ MSEgui Copyright (c) 1999-2014 by Martin Schreiber
{ MSEgui Copyright (c) 1999-2018 by Martin Schreiber
See the file COPYING.MSE, included in this distribution,
for details about the copyright.
......@@ -72,7 +72,7 @@ type
// expiretime: longword;
end;
dragoptionty = (do_child,do_nocursorshape);
dragoptionty = (do_child,do_nocursorshape,do_nearstart,do_mousewidget);
dragoptionsty = set of dragoptionty;
tcustomdragcontroller = class(tlinkedpersistent,ievent)
......@@ -256,12 +256,23 @@ var
info: draginfoty;
begin
result:= nil;
window:= nil;
pt1:= translateclientpoint(pos,fintf.getwidget,nil);
window:= application.windowatpos(pt1);
if do_mousewidget in foptions then begin
result:= application.mousewidget;
if result <> nil then begin
window:= result.window;
end;
end
else begin
window:= application.windowatpos(pt1);
if window <> nil then begin
result:= window.owner.widgetatpos(translatewidgetpoint(pt1,nil,window.owner),
[ws_visible,ws_enabled]);
end;
end;
if window <> nil then begin
sysdndpending:= false;
result:= window.owner.widgetatpos(translatewidgetpoint(pt1,nil,window.owner),
[ws_visible,ws_enabled]);
if (flastwidget <> result) then begin
if (flastwidget <> nil) then begin
initdraginfo(info,dek_leavewidget,
......
......@@ -64,7 +64,6 @@ type
coloptions1ty = set of coloption1ty;
const
gridautosizetag = 86375927;
deprecatedcoloptions = [{co_rowfont,co_rowcolor,co_zebracolor,
co_rowcoloractive}];
invisiblecoloptions = [{ord(co_rowfont),ord(co_rowcolor),ord(co_zebracolor),
......@@ -89,10 +88,12 @@ const
defaultgridskinoptions = [osk_framebuttononly];
sortglyphwidth = 11;
defaultwheelscrollheight = 0;
dragmindist = 4;
rowstatefoldleveltag = 0;
rowstateissumtag = 1;
rowstatefoldhiddentag = 2;
gridautosizetag = 3;
type
optiongridty = (og_colsizing,og_colmoving,og_keycolmoving,
......@@ -16524,12 +16525,20 @@ function tcustomgrid.getdragrect(const apos: pointty): rectty;
var
cell1: gridcoordty;
begin
cell1:= cellatpos(apos);
if isdatacell(cell1) then begin
result:= cellrect(cell1);
if do_nearstart in fdragcontroller.options then begin
result.x:= apos.x - dragmindist;
result.y:= apos.y - dragmindist;
result.cx:= 2 * dragmindist;
result.cy:= 2 * dragmindist;
end
else begin
result:= inherited getdragrect(apos);
cell1:= cellatpos(apos);
if isdatacell(cell1) then begin
result:= cellrect(cell1);
end
else begin
result:= inherited getdragrect(apos);
end;
end;
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment