You've already forked lazarus-ccr
callite: Fix click selecting incorrect day if mouse is moved during the timer interval.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6544 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -199,7 +199,7 @@ type
|
|||||||
procedure GotoMonth(AMonth: word);
|
procedure GotoMonth(AMonth: word);
|
||||||
procedure GotoToday;
|
procedure GotoToday;
|
||||||
procedure GotoYear(AYear: word);
|
procedure GotoYear(AYear: word);
|
||||||
procedure LeftClick(Shift: TShiftState);
|
procedure LeftClick(APoint: TPoint; Shift: TShiftState);
|
||||||
procedure RightClick;
|
procedure RightClick;
|
||||||
public
|
public
|
||||||
constructor Create(ACanvas: TCanvas);
|
constructor Create(ACanvas: TCanvas);
|
||||||
@ -1192,16 +1192,15 @@ begin
|
|||||||
FOwner.Date := d;
|
FOwner.Date := d;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCalDrawer.LeftClick(Shift: TShiftState);
|
procedure TCalDrawer.LeftClick(APoint: TPoint; Shift: TShiftState);
|
||||||
var
|
var
|
||||||
p, ppopup: TPoint;
|
ppopup: TPoint;
|
||||||
cell: TSize;
|
cell: TSize;
|
||||||
Rm, Ry: TRect;
|
Rm, Ry: TRect;
|
||||||
sm: TCalSelMode;
|
sm: TCalSelMode;
|
||||||
begin
|
begin
|
||||||
sm := FOwner.SelMode(Shift);
|
sm := FOwner.SelMode(Shift);
|
||||||
p := FOwner.ScreenToClient(Mouse.CursorPos);
|
cell := GetCellAt(APoint);
|
||||||
cell := GetCellAt(p);
|
|
||||||
case cell.cy of
|
case cell.cy of
|
||||||
TopRow:
|
TopRow:
|
||||||
case cell.cx of
|
case cell.cx of
|
||||||
@ -1210,12 +1209,12 @@ begin
|
|||||||
3..5:
|
3..5:
|
||||||
begin
|
begin
|
||||||
GetMonthYearRects(Rm{%H-}, Ry{%H-});
|
GetMonthYearRects(Rm{%H-}, Ry{%H-});
|
||||||
if PtInRect(Rm, p) then begin
|
if PtInRect(Rm, APoint) then begin
|
||||||
FOwner.PopulateMonthPopupMenu;
|
FOwner.PopulateMonthPopupMenu;
|
||||||
ppopup := FOwner.ClientToScreen(Point(Rm.Left, Rm.Bottom));
|
ppopup := FOwner.ClientToScreen(Point(Rm.Left, Rm.Bottom));
|
||||||
FOwner.FPopupMenu.PopUp(ppopup.x, ppopup.y);
|
FOwner.FPopupMenu.PopUp(ppopup.x, ppopup.y);
|
||||||
end;
|
end;
|
||||||
if PtInRect(Ry, p) then begin
|
if PtInRect(Ry, APoint) then begin
|
||||||
FOwner.PopulateYearPopupMenu;
|
FOwner.PopulateYearPopupMenu;
|
||||||
ppopup := FOwner.ClientToScreen(Point(Ry.Left, Ry.Bottom));
|
ppopup := FOwner.ClientToScreen(Point(Ry.Left, Ry.Bottom));
|
||||||
FOwner.FPopupMenu.Popup(ppopup.x, ppopup.y);
|
FOwner.FPopupMenu.Popup(ppopup.x, ppopup.y);
|
||||||
@ -1432,7 +1431,7 @@ begin
|
|||||||
FDblClickTimer.Enabled := false;
|
FDblClickTimer.Enabled := false;
|
||||||
inherited;
|
inherited;
|
||||||
case FClickButton of
|
case FClickButton of
|
||||||
mbLeft : FCalDrawer.LeftClick(FClickShift + [ssDouble]);
|
mbLeft : FCalDrawer.LeftClick(FClickPoint, FClickShift + [ssDouble]);
|
||||||
mbRight : ;
|
mbRight : ;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1485,7 +1484,7 @@ end;
|
|||||||
procedure TCalendarLite.InternalClick;
|
procedure TCalendarLite.InternalClick;
|
||||||
begin
|
begin
|
||||||
case FClickButton of
|
case FClickButton of
|
||||||
mbLeft : FCalDrawer.LeftClick(FClickShift);
|
mbLeft : FCalDrawer.LeftClick(FClickPoint, FClickShift);
|
||||||
mbRight : FCalDrawer.RightClick;
|
mbRight : FCalDrawer.RightClick;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user