MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...

git-svn-id: trunk@3265 -
This commit is contained in:
lazarus 2002-08-30 12:32:25 +00:00
parent e78acde725
commit 9caac69e35
13 changed files with 163 additions and 136 deletions

View File

@ -58,7 +58,7 @@ interface
{ $DEFINE ShowNodeCache}
{ $DEFINE ShowBaseTypeCache}
{ $DEFINE ShowCacheDependencies}
{$DEFINE ShowCollect}
{ $DEFINE ShowCollect}
uses

View File

@ -163,7 +163,6 @@ type
FOldHeight: integer;
FCustomForm: TCustomForm;
FCanvas: TCanvas;
FGrabbers: array[TGrabIndex] of TGrabber;
FGrabberSize: integer;
FGrabberColor: TColor;
@ -293,7 +292,7 @@ type
property RubberbandActive: boolean read FRubberbandActive write FRubberbandActive;
procedure DrawRubberband(DC: TDesignerDeviceContext);
procedure SelectWithRubberBand(ACustomForm:TCustomForm; ExclusiveOr: boolean);
procedure Sort(SortProc: TSelectionSortCompare);
property Visible:boolean read FVisible write SetVisible;
function OnlyNonVisualComponentsSelected: boolean;
@ -464,7 +463,6 @@ begin
FGrabbers[g].Cursor:=GRAB_CURSOR[g];
end;
FCustomForm:=nil;
FCanvas:=TCanvas.Create;
FActiveGrabber:=nil;
FUpdateLock:=0;
FChangedDuringLock:=false;
@ -479,7 +477,6 @@ begin
Clear;
FControls.Free;
for g:=Low(TGrabIndex) to High(TGrabIndex) do FGrabbers[g].Free;
FCanvas.Free;
inherited Destroy;
end;
@ -1287,7 +1284,8 @@ var OldBrushColor:TColor;
Diff: TPoint;
// OldFormHandle: HDC;
begin
if (Count=0) or (FCustomForm=nil) or Items[0].IsTopLvl then exit;
if (Count=0) or (FCustomForm=nil)
or IsSelected(FCustomForm) then exit;
Diff:=DC.FormOrigin;
{
@ -1296,23 +1294,19 @@ writeln('[DrawGrabbers] Form=',FormOrigin.X,',',FormOrigin.Y
,' Grabber1=',FGrabbers[0].Left,',',FGrabbers[0].Top
,' Selection=',FLeft,',',FTop);
}
// OldFormHandle:=FCustomForm.Canvas.Handle;
DC.Save;
FCanvas.Handle:=DC.DC;
with FCanvas do begin
with DC.Canvas do begin
OldBrushColor:=Brush.Color;
Brush.Color:=FGrabberColor;
for g:=Low(TGrabIndex) to High(TGrabIndex) do
FillRect(Rect(
Diff.X+FGrabbers[g].Left
,Diff.Y+FGrabbers[g].Top
,Diff.X+FGrabbers[g].Left+FGrabbers[g].Width
,Diff.Y+FGrabbers[g].Top+FGrabbers[g].Height
FGrabbers[g].Left-Diff.X
,FGrabbers[g].Top-Diff.Y
,FGrabbers[g].Left-Diff.X+FGrabbers[g].Width
,FGrabbers[g].Top-Diff.Y+FGrabbers[g].Height
));
Brush.Color:=OldbrushColor;
end;
FCanvas.Handle:=0;
// FCustomForm.Canvas.Handle:=OldFormHandle;
end;
procedure TControlSelection.DrawMarkerAt(ACanvas: TCanvas;
@ -1331,30 +1325,25 @@ begin
end;
end;
procedure TControlSelection.DrawMarker(AComponent:TComponent;
procedure TControlSelection.DrawMarker(AComponent: TComponent;
DC: TDesignerDeviceContext);
var
ALeft,ATop:integer;
AControlOrigin,DCOrigin:TPoint;
AControl: TControl;
CompLeft, CompTop, CompWidth, CompHeight: integer;
CompOrigin, DCOrigin: TPoint;
begin
if (Count<2) or (FCustomForm=nil) or (AComponent is TCustomForm)
if (Count<2)
or (FCustomForm=nil)
or (AComponent.Owner<>DC.Form)
or (AComponent is TCustomForm)
or (not IsSelected(AComponent)) then exit;
if AComponent is TControl then begin
AControl:=TControl(AComponent);
AControlOrigin:=AControl.Parent.ClientOrigin;
end else begin
if (not (AComponent.Owner is TCustomForm)) then exit;
AControlOrigin:=TCustomForm(AComponent.Owner).ClientOrigin;
end;
Inc(AControlOrigin.X,GetComponentLeft(AControl));
Inc(AControlOrigin.Y,GetComponentTop(AControl));
DCOrigin:=DC.DCorigin;
ALeft:=AControlOrigin.X-DCOrigin.X;
ATop:=AControlOrigin.Y-DCOrigin.Y;
GetComponentBounds(AComponent,CompLeft,CompTop,CompWidth,CompHeight);
CompOrigin:=GetParentFormRelativeParentClientOrigin(AComponent);
DCOrigin:=DC.FormOrigin;
CompLeft:=CompLeft+CompOrigin.X-DCOrigin.X;
CompTop:=CompTop+CompOrigin.Y-DCOrigin.Y;
DC.Save;
FCanvas.Handle:=DC.DC;
{
writeln('DrawMarker A ',FCustomForm.Name
,' Control=',AControl.Name,',',AControlOrigin.X,',',AControlOrigin.Y
@ -1362,8 +1351,7 @@ writeln('DrawMarker A ',FCustomForm.Name
,' DC=',Hexstr(FCustomForm.Canvas.Handle,8),' ',HexStr(Cardinal(Pointer(FCustomForm)),8)
);
}
DrawMarkerAt(FCanvas,ALeft,ATop,AControl.Width,AControl.Height);
FCanvas.Handle:=0;
DrawMarkerAt(DC.Canvas,CompLeft,CompTop,CompWidth,CompHeight);
end;
procedure TControlSelection.DrawRubberband(DC: TDesignerDeviceContext);
@ -1375,19 +1363,18 @@ var Diff: TPoint;
procedure InvertPixel(x,y:integer);
//var c:TColor;
begin
//c:=FCanvas.Pixels[x,y];
//c:=DC.Canvas.Pixels[x,y];
//c:=c xor $ffffff;
//FCanvas.Pixels[x,y]:=c;
FCanvas.MoveTo(Diff.X+x,Diff.Y+y);
FCanvas.LineTo(Diff.X+x+1,Diff.Y+y);
//DC.Canvas.Pixels[x,y]:=c;
DC.Canvas.MoveTo(x-Diff.X,y-Diff.Y);
DC.Canvas.LineTo(x-Diff.X+1,y-Diff.Y);
end;
var OldPenColor: TColor;
begin
if FCanvas=nil then exit;
if x1>x2 then begin i:=x1; x1:=x2; x2:=i; end;
if y1>y2 then begin i:=y1; y1:=y2; y2:=i; end;
with FCanvas do begin
with DC.Canvas do begin
OldPenColor:=Brush.Color;
Pen.Color:=clBlack;
i:=x1+1;
@ -1409,12 +1396,10 @@ var Diff: TPoint;
// DrawRubberband
begin
if (FCustomForm=nil) then exit;
Diff:=Dc.FormOrigin;
Diff:=DC.FormOrigin;
DC.Save;
FCanvas.Handle:=DC.DC;
with FRubberBandBounds do
DrawInvertFrameRect(Left,Top,Right,Bottom);
FCanvas.Handle:=0;
end;
procedure TControlSelection.SelectWithRubberBand(ACustomForm:TCustomForm;
@ -1782,9 +1767,20 @@ begin
end;
procedure TControlSelection.DrawGuideLines(DC: TDesignerDeviceContext);
var
DCOrigin: TPoint;
procedure DrawLine(ARect: TRect; AColor: TColor);
begin
with DC.Canvas do begin
Pen.Color:=AColor;
MoveTo(ARect.Left-DCOrigin.X,ARect.Top-DCOrigin.Y);
LineTo(ARect.Right-DCOrigin.X,ARect.Bottom-DCOrigin.Y);
end;
end;
var
OldPenColor:TColor;
Diff: TPoint;
LeftGuideLineExists, RightGuideLineExists,
TopGuideLineExists, BottomGuideLineExists: boolean;
LeftGuideLine, RightGuideLine, TopGuideLine, BottomGuideLine: TRect;
@ -1798,38 +1794,22 @@ begin
and (not TopGuideLineExists) and (not BottomGuideLineExists)
then exit;
Diff:=DC.FormOrigin;
DC.Save;
FCanvas.Handle:=DC.DC;
with FCanvas do begin
OldPenColor:=Pen.Color;
// draw bottom guideline
if BottomGuideLineExists then begin
Pen.Color:=EnvironmentOptions.GuideLineColorRightBottom;
MoveTo(BottomGuideLine.Left+Diff.X,BottomGuideLine.Top+Diff.Y);
LineTo(BottomGuideLine.Right+Diff.X,BottomGuideLine.Bottom+Diff.Y);
end;
// draw top guideline
if TopGuideLineExists then begin
Pen.Color:=EnvironmentOptions.GuideLineColorLeftTop;
MoveTo(TopGuideLine.Left+Diff.X,TopGuideLine.Top+Diff.Y);
LineTo(TopGuideLine.Right+Diff.X,TopGuideLine.Bottom+Diff.Y);
end;
// draw right guideline
if RightGuideLineExists then begin
Pen.Color:=EnvironmentOptions.GuideLineColorRightBottom;
MoveTo(RightGuideLine.Left+Diff.X,RightGuideLine.Top+Diff.Y);
LineTo(RightGuideLine.Right+Diff.X,RightGuideLine.Bottom+Diff.Y);
end;
// draw left guideline
if LeftGuideLineExists then begin
Pen.Color:=EnvironmentOptions.GuideLineColorLeftTop;
MoveTo(LeftGuideLine.Left+Diff.X,LeftGuideLine.Top+Diff.Y);
LineTo(LeftGuideLine.Right+Diff.X,LeftGuideLine.Bottom+Diff.Y);
end;
Pen.Color:=OldPenColor;
end;
FCanvas.Handle:=0;
DCOrigin:=DC.FormOrigin;
OldPenColor:=DC.Canvas.Pen.Color;
// draw bottom guideline
if BottomGuideLineExists then
DrawLine(BottomGuideLine,EnvironmentOptions.GuideLineColorRightBottom);
// draw top guideline
if TopGuideLineExists then
DrawLine(TopGuideLine,EnvironmentOptions.GuideLineColorLeftTop);
// draw right guideline
if RightGuideLineExists then
DrawLine(RightGuideLine,EnvironmentOptions.GuideLineColorRightBottom);
// draw left guideline
if LeftGuideLineExists then
DrawLine(LeftGuideLine,EnvironmentOptions.GuideLineColorLeftTop);
DC.Canvas.Pen.Color:=OldPenColor;
end;
procedure TControlSelection.Sort(SortProc: TSelectionSortCompare);

View File

@ -33,7 +33,7 @@ unit DesignerProcs;
interface
uses
Classes, SysUtils, LCLLinux, Forms, Controls, LCLType;
Classes, SysUtils, LCLLinux, Forms, Controls, LCLType, Graphics;
type
TDesignerDCFlag = (ddcDCOriginValid, ddcFormOriginValid,
@ -42,6 +42,7 @@ type
TDesignerDeviceContext = class
private
FCanvas: TCanvas;
FDC: HDC;
FDCOrigin: TPoint; // DC origin on desktop
FFlags: TDesignerDCFlags;
@ -53,14 +54,20 @@ type
function GetFormClientOrigin: TPoint;
function GetFormOrigin: TPoint;
public
constructor Create;
destructor Destroy; override;
procedure SetDC(AForm: TCustomForm; aDC: HDC);
procedure Clear;
procedure Save;
procedure Restore;
property Canvas: TCanvas read FCanvas;
property DC: HDC read FDC;
property FormOrigin: TPoint read GetFormOrigin;// DC origin relative to designer Form
property DCOrigin: TPoint read GetDCOrigin;
property FormClientOrigin: TPoint read GetFormClientOrigin;
property Form: TCustomForm read FForm;
property FormOrigin: TPoint
read GetFormOrigin;// DC origin relative to designer Form
property DCOrigin: TPoint read GetDCOrigin; // DC origin on Desktop
property FormClientOrigin: TPoint
read GetFormClientOrigin;// Form Client Origin on desktop
end;
const
@ -265,6 +272,18 @@ begin
Result:=FFormOrigin;
end;
constructor TDesignerDeviceContext.Create;
begin
inherited Create;
FCanvas:=TCanvas.Create;
end;
destructor TDesignerDeviceContext.Destroy;
begin
FCanvas.Free;
inherited Destroy;
end;
procedure TDesignerDeviceContext.SetDC(AForm: TCustomForm; aDC: HDC);
begin
Clear;
@ -281,8 +300,10 @@ end;
procedure TDesignerDeviceContext.Save;
begin
if FSavedDC=0 then
if FSavedDC=0 then begin
FSavedDC:=SaveDC(DC);
FCanvas.Handle:=FDC;
end;
end;
procedure TDesignerDeviceContext.Restore;
@ -290,6 +311,7 @@ begin
if FSavedDC<>0 then begin
RestoreDC(DC,FSavedDC);
FSavedDC:=0;
FCanvas.Handle:=0;
end;
end;

View File

@ -101,10 +101,10 @@ type
// form editor
FShowGrid: boolean;
FGridColor: TColor;
FSnapToGrid: boolean;
FGridSizeX: integer;
FGridSizeY: integer;
FGridColor: TColor;
FShowGuideLines: boolean;
FSnapToGuideLines: boolean;
FGuideLineColorLeftTop: TColor;

View File

@ -16,7 +16,7 @@
Constructor TBevel.Create(AOwner:TComponent);
Begin
Inherited Create(AOwner);
ControlStyle:=ControlStyle-[csSetCaption];
ControlStyle:=ControlStyle-[csSetCaption,csOpaque];
FStyle:=bsLowered;
FShape:=bsBox;
@ -63,7 +63,8 @@ End;
Procedure TBevel.Paint;
Var
Colora, Colorb:TColor;
Colora, Colorb: TColor;
ALeft, ATop: integer;
Begin
Case Style Of
bsRaised:
@ -79,75 +80,78 @@ Begin
End;
Canvas.Pen.Width:=1;
ALeft:=0;
ATop:=0;
Case Shape Of
bsBox:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 1);
LineTo(Left, Top);
LineTo(Left + Width - 2, Top);
MoveTo(ALeft, ATop + Height - 1);
LineTo(ALeft, ATop);
LineTo(ALeft + Width - 1, ATop);
Pen.Color:=Colorb;
LineTo(Left + Width - 2, Top + Height - 1);
LIneTo(Left , Top + Height - 1);
LineTo(ALeft + Width - 1, ATop + Height - 1);
LineTo(ALeft , ATop + Height - 1);
End;
bsFrame:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 1);
LineTo(Left, Top);
LineTo(Left + Width - 1, Top);
MoveTo(Left + Width - 2, Top + 1);
LineTo(Left + Width - 2, Top + Height - 2);
LineTo(Left + 1, Top + Height - 2);
MoveTo(ALeft, ATop + Height - 1);
LineTo(ALeft, ATop);
LineTo(ALeft + Width - 1, ATop);
MoveTo(ALeft + Width - 2, ATop + 1);
LineTo(ALeft + Width - 2, ATop + Height - 2);
LineTo(ALeft + 1, ATop + Height - 2);
Pen.Color:=Colorb;
MoveTo(Left + 1, Top + Height - 2);
LineTo(Left + 1, Top + 1);
LineTo(Left + Width - 2, Top + 1);
MoveTo(Left + Width - 1, Top);
LineTo(Left + Width - 1, Top + Height - 1);
LineTo(Left, Top + Height - 1);
MoveTo(ALeft + 1, ATop + Height - 2);
LineTo(ALeft + 1, ATop + 1);
LineTo(ALeft + Width - 2, ATop + 1);
MoveTo(ALeft + Width - 1, ATop);
LineTo(ALeft + Width - 1, ATop + Height - 1);
LineTo(ALeft, ATop + Height - 1);
End;
bsTopLine:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top);
LineTo(Left + Width - 1, Top);
MoveTo(ALeft, ATop);
LineTo(ALeft + Width - 1, ATop);
Pen.Color:=Colorb;
MoveTo(Left, Top + 1);
LineTo(Left + Width - 1, Top + 1);
MoveTo(ALeft, ATop + 1);
LineTo(ALeft + Width - 1, ATop + 1);
End;
bsBottomLine:
With Canvas Do
Begin
Pen.Color:=Colorb;
MoveTo(Left, Top + Height - 1);
LineTo(Left + Width - 1, Top + Height - 1);
MoveTo(ALeft, ATop + Height - 1);
LineTo(ALeft + Width - 1, ATop + Height - 1);
Pen.Color:=Colora;
MoveTo(Left, Top + Height - 2);
LineTo(Left + Width - 1, Top + Height - 2);
MoveTo(ALeft, ATop + Height - 2);
LineTo(ALeft + Width - 1, ATop + Height - 2);
End;
bsLeftLine:
With Canvas Do
Begin
Pen.Color:=Colora;
MoveTo(Left, Top);
LineTo(Left, Top + Height - 1);
MoveTo(ALeft, ATop);
LineTo(ALeft, ATop + Height - 1);
Pen.Color:=Colorb;
MoveTo(Left + 1, Top);
LineTo(Left + 1, Top + Height - 1);
MoveTo(ALeft + 1, ATop);
LineTo(ALeft + 1, ATop + Height - 1);
End;
bsRightLine:
With Canvas Do
Begin
Pen.Color:=Colorb;
MoveTo(Left + Width - 1, Top);
LineTo(Left + Width - 1, Top + Height - 1);
MoveTo(ALeft + Width - 1, ATop);
LineTo(ALeft + Width - 1, ATop + Height - 1);
Pen.Color:=Colora;
MoveTo(Left + Width - 2, Top);
LineTo(Left + Width - 2, Top + Height);
MoveTo(ALeft + Width - 2, ATop);
LineTo(ALeft + Width - 2, ATop + Height);
End;
End;
End;
@ -245,6 +249,9 @@ End;
{
$Log$
Revision 1.7 2002/08/30 12:32:20 lazarus
MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...
Revision 1.6 2002/06/04 15:17:22 lazarus
MG: improved TFont for XLFD font names

View File

@ -34,6 +34,7 @@ end;
constructor TButtonControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle:=ControlStyle-[csDoubleClicks,csTripleClicks,csAcceptsControls];
end;
// included by stdctrls.pp

View File

@ -23,7 +23,7 @@
{------------------------------------------------------------------------------}
{ TCustomForm ClientWndProc }
{------------------------------------------------------------------------------}
Procedure TCustomForm.ClientWndProc(var MEssage: TLMessage);
Procedure TCustomForm.ClientWndProc(var Message: TLMessage);
procedure Default;
begin
@ -719,8 +719,8 @@ Begin
FFormState := [];
FMenu := nil;
ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
csSetCaption, csDoubleClicks];
ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse,
csClickEvents, csSetCaption, csDoubleClicks];
Left := 0;
Top := 0;
Width := 320;
@ -1025,6 +1025,9 @@ end;
{ =============================================================================
$Log$
Revision 1.52 2002/08/30 12:32:20 lazarus
MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...
Revision 1.51 2002/08/24 12:54:59 lazarus
MG: fixed mouse capturing, OI edit focus

View File

@ -33,8 +33,9 @@ constructor TCustomPanel.Create (AOwner : TComponent);
begin
inherited Create (AOwner);
FCompStyle:= csPanel;
ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
csSetCaption, csOpaque, csDoubleClicks, csReplicatable, csNoFocus];
ControlStyle := ControlStyle + [csAcceptsControls, csCaptureMouse,
csClickEvents, csSetCaption, csOpaque, csDoubleClicks, csReplicatable,
csNoFocus];
FBevelOuter := bvRaised;
FBevelInner := bvNone;
FBevelWidth := 1;

View File

@ -60,7 +60,8 @@ constructor TCustomRadioGroup.Create (AOwner : TComponent);
begin
inherited Create (AOwner);
FCreatingWnd := false;
ControlStyle := [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks];
ControlStyle := ControlStyle + [csCaptureMouse, csClickEvents, csSetCaption,
csDoubleClicks];
FItems := TStringList.Create;
TStringList(FItems).OnChanging := @ItemsChanged;
TStringList(FItems).OnChange := @ItemsChanged;
@ -336,6 +337,9 @@ end;
{
$Log$
Revision 1.13 2002/08/30 12:32:20 lazarus
MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...
Revision 1.12 2002/08/17 15:45:32 lazarus
MG: removed ClientRectBugfix defines

View File

@ -30,7 +30,9 @@ begin
Height := GetSystemMetrics(SM_CYHSCROLL);
SetBounds(0,0,width,height);
TabStop := True;
ControlStyle := [csFramed, csDoubleClicks, csOpaque];
ControlStyle := ControlStyle + [csFramed, csDoubleClicks, csOpaque]
- [csAcceptsControls, csDoubleClicks,
csCaptureMouse, csSetCaption];
FKind := sbHorizontal;
FPosition := 0;
FMin := 0;

View File

@ -23,7 +23,7 @@
TTreeView for LCL
ToDo:
- move nodes
- Multiselection
- custom draw
- Drag&Drop
- Editing
@ -3673,13 +3673,13 @@ begin
with Canvas do begin
// draw nodes
Node:=TopItem;
//write('[TCustomTreeView.DoPaint] A Node=',HexStr(Cardinal(Node),8));
//if Node<>nil then writeln(' Node.Text=',Node.Text) else writeln('');
//write('[TCustomTreeView.DoPaint] A Node=',HexStr(Cardinal(Node),8));
//if Node<>nil then writeln(' Node.Text=',Node.Text) else writeln('');
while Node<>nil do begin
DoPaintNode(Node);
Node:=Node.GetNextVisible;
//write('[TCustomTreeView.DoPaint] B Node=',HexStr(Cardinal(Node),8));
//if Node<>nil then writeln(' Node.Text=',Node.Text) else writeln('');
//write('[TCustomTreeView.DoPaint] B Node=',HexStr(Cardinal(Node),8));
//if Node<>nil then writeln(' Node.Text=',Node.Text) else writeln('');
end;
// draw unused space below nodes
SpaceRect:=Rect(BorderWidth,BorderWidth,
@ -3688,11 +3688,11 @@ begin
Node:=BottomItem;
if Node<>nil then
SpaceRect.Top:=Node.Top+Node.Height-FScrolledTop+BorderWidth;
//if Node<>nil then writeln('BottomItem=',BottomItem.text) else writeln('NO BOTTOMITEM!!!!!!!!!');
// TWinControl(Parent).InvalidateRect(Self,SpaceRect,true);
//if Node<>nil then writeln('BottomItem=',BottomItem.text) else writeln('NO BOTTOMITEM!!!!!!!!!');
// TWinControl(Parent).InvalidateRect(Self,SpaceRect,true);
if (FBackgroundColor<>clNone) and (SpaceRect.Top<SpaceRect.Bottom) then
begin
//writeln(' SpaceRect=',SpaceRect.Left,',',SpaceRect.Top,',',SpaceRect.Right,',',SpaceRect.Bottom);
//writeln(' SpaceRect=',SpaceRect.Left,',',SpaceRect.Top,',',SpaceRect.Right,',',SpaceRect.Bottom);
Brush.Color:=FBackgroundColor;
FillRect(SpaceRect);
end;
@ -3730,7 +3730,7 @@ var NodeRect: TRect;
Blue:=AColor and $ff;
if Red+Green+Blue>$180 then
Result:=clBlack;
//writeln('[TCustomTreeView.DoPaintNode.InvertColor] Result=',Result,' ',Red,',',Green,',',Blue);
//writeln('[TCustomTreeView.DoPaintNode.InvertColor] Result=',Result,' ',Red,',',Green,',',Blue);
end;
function DrawTreeLines(CurNode: TTreeNode): integer;

View File

@ -2057,12 +2057,13 @@ End;
Sets the window origin of the device context by using the specified coordinates.
------------------------------------------------------------------------------}
Function TWin32Object.SetWindowOrgEx(DC: HDC; NewX, NewY: Integer; Var Point: TPoint): Boolean;
Function TWin32Object.SetWindowOrgEx(DC: HDC; NewX, NewY: Integer;
Var OldPoint: TPoint): Boolean;
Begin
//writeln('[TWin32Object.SetWindowOrgEx] ', NewX, ' ', NewY);
// ToDo: move origin
Result := Windows.SetWindowOrgEx(DC, NewX, NewY, @Point);
Result := Windows.SetWindowOrgEx(DC, NewX, NewY, @OldPoint);
End;
{------------------------------------------------------------------------------
@ -2289,6 +2290,9 @@ end;
{ =============================================================================
$Log$
Revision 1.17 2002/08/30 12:32:25 lazarus
MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...
Revision 1.16 2002/08/29 16:22:02 lazarus
Make CreatePixmapIndirect work for Win32. Work done by Markus Luedin.

View File

@ -151,7 +151,7 @@ Function SetTextCharacterExtra(_HDC: HDC; NCharExtra: Integer): Integer; Overrid
Function SetTextColor(DC: HDC; Color: TColorRef): TColorRef; Override;
Function SetTimer(HWnd: HWND; NIDEvent, uElapse: Integer; LPTimerFunc: TFNTimerProc): Integer; Override;
Function SetWindowLong(Handle: HWND; Idx: Integer; NewLong: LongInt): LongInt; Override;
Function SetWindowOrgEx(DC: HDC; NewX, NewY: Integer; Var Point: TPoint): Boolean; Override;
Function SetWindowOrgEx(DC: HDC; NewX, NewY: Integer; Var OldPoint: TPoint): Boolean; Override;
Function SetWindowPos(HWnd: HWND; HWndInsertAfter: HWND; X, Y, CX, CY: Integer; UFlags: UINT): Boolean; Override;
Function ShowCaret(HWnd: HWND): Boolean; Override;
Function ShowScrollBar(Handle: HWND; WBar: Integer; BShow: Boolean): Boolean; Override;
@ -172,6 +172,9 @@ Procedure DeleteCriticalSection(var CritSection: TCriticalSection); Override;
{ =============================================================================
$Log$
Revision 1.13 2002/08/30 12:32:25 lazarus
MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ...
Revision 1.12 2002/08/28 09:40:52 lazarus
MG: reduced paint messages and DC getting/releasing