mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 02:50:14 +02:00
LazReport, previous step for proper drawing in designer: isolating focusrect
git-svn-id: trunk@40524 -
This commit is contained in:
parent
8cb6307e5c
commit
a0e36fb682
@ -171,6 +171,9 @@ type
|
||||
procedure CMMouseLeave(var {%H-}Message: TLMessage); message CM_MOUSELEAVE;
|
||||
procedure DClick(Sender: TObject);
|
||||
procedure MoveResize(Kx,Ky:Integer; UseFrames,AResize: boolean);
|
||||
|
||||
procedure NPDrawFocusRect;
|
||||
procedure NPEraseFocusRect;
|
||||
protected
|
||||
procedure Paint; override;
|
||||
procedure WMEraseBkgnd(var {%H-}Message: TLMEraseBkgnd); message LM_ERASEBKGND;
|
||||
@ -1280,8 +1283,8 @@ begin
|
||||
end;
|
||||
|
||||
if (Button = mbRight) and Down and RFlag then
|
||||
DrawFocusRect(OldRect);
|
||||
|
||||
NPEraseFocusRect;
|
||||
|
||||
RFlag := False;
|
||||
DrawPage(dmSelection);
|
||||
Down := True;
|
||||
@ -1293,7 +1296,7 @@ begin
|
||||
RFlag := True;
|
||||
if Cursor = crCross then
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
NPEraseFocusRect;
|
||||
RoundCoord(x, y);
|
||||
OldRect1 := OldRect;
|
||||
end;
|
||||
@ -1505,9 +1508,10 @@ begin
|
||||
DebugLnEnter('Inserting a New Object INIT');
|
||||
{$ENDIF}
|
||||
Mode := mdSelect;
|
||||
DrawFocusRect(OldRect);
|
||||
if (OldRect.Left = OldRect.Right) and (OldRect.Top = OldRect.Bottom) then
|
||||
OldRect := OldRect1;
|
||||
OldRect := OldRect1
|
||||
else
|
||||
NPEraseFocusRect;
|
||||
NormalizeRect(OldRect);
|
||||
RFlag := False;
|
||||
ObjectInserted := True;
|
||||
@ -1670,7 +1674,7 @@ begin
|
||||
FDesigner.OB7.Down := True
|
||||
end
|
||||
else
|
||||
DrawFocusRect(OldRect);
|
||||
NPDrawFocusRect;
|
||||
|
||||
{$IFDEF DebugLR}
|
||||
DebugLnExit('Inserting a New Object DONE');
|
||||
@ -1712,7 +1716,7 @@ begin
|
||||
// calculating which objects contains in frame (if user select it with mouse+Ctrl key)
|
||||
if RFlag then
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
NPEraseFocusRect;
|
||||
RFlag := False;
|
||||
NormalizeRect(OldRect);
|
||||
for i := 0 to Objects.Count - 1 do
|
||||
@ -1870,7 +1874,7 @@ begin
|
||||
// if not FDesigner.OB3.Down then
|
||||
FDesigner.GetDefaultSize(kx, ky);
|
||||
OldRect := Rect(x, y, x + kx, y + ky);
|
||||
DrawFocusRect(OldRect);
|
||||
NPDrawFocusRect;
|
||||
end;
|
||||
Cursor := crCross;
|
||||
end;
|
||||
@ -1897,7 +1901,7 @@ begin
|
||||
if not FDesigner.OB3.Down then
|
||||
FDesigner.GetDefaultSize(kx, ky);
|
||||
OldRect := Rect(x, y, x + kx, y + ky);
|
||||
DrawFocusRect(OldRect);
|
||||
NPDrawFocusRect;
|
||||
end;
|
||||
Cursor := crCross;
|
||||
end;
|
||||
@ -1909,10 +1913,10 @@ begin
|
||||
|
||||
if (Mode = mdInsert) and not Down then
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
NPEraseFocusRect;
|
||||
RoundCoord(x, y);
|
||||
OffsetRect(OldRect, x - OldRect.Left, y - OldRect.Top);
|
||||
DrawFocusRect(OldRect);
|
||||
NPDrawFocusRect;
|
||||
ShowSizes := True;
|
||||
FDesigner.UpdateStatus;
|
||||
ShowSizes := False;
|
||||
@ -1942,11 +1946,11 @@ begin
|
||||
//selecting a lot of objects
|
||||
if Down and RFlag then
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
NPEraseFocusRect;
|
||||
if Cursor = crCross then
|
||||
RoundCoord(x, y);
|
||||
OldRect := Rect(OldRect.Left, OldRect.Top, x, y);
|
||||
DrawFocusRect(OldRect);
|
||||
NPDrawFocusRect;
|
||||
ShowSizes := True;
|
||||
if Cursor = crCross then
|
||||
FDesigner.UpdateStatus;
|
||||
@ -2343,11 +2347,21 @@ begin
|
||||
{$IFDEF LCLCarbon}Invalidate;{$endif}
|
||||
end;
|
||||
|
||||
procedure TfrDesignerPage.NPDrawFocusRect;
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
end;
|
||||
|
||||
procedure TfrDesignerPage.NPEraseFocusRect;
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
end;
|
||||
|
||||
procedure TfrDesignerPage.CMMouseLeave(var Message: TLMessage);
|
||||
begin
|
||||
if (Mode = mdInsert) and not Down then
|
||||
begin
|
||||
DrawFocusRect(OldRect);
|
||||
NPEraseFocusRect;
|
||||
OffsetRect(OldRect, -10000, -10000);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user