mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 06:38:22 +02:00
114 lines
3.5 KiB
PHP
114 lines
3.5 KiB
PHP
{$MainUnit customdrawnwscontrols.pp}
|
|
|
|
class function TCDWSWinControl.GetText(const AWinControl: TWinControl; var AText: String): Boolean;
|
|
begin
|
|
AText := '';
|
|
Result := false;
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.SetBorderStyle(const AWinControl: TWinControl; const ABorderStyle: TBorderStyle);
|
|
begin
|
|
RecreateWnd(AWinControl);
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.SetChildZPosition(
|
|
const AWinControl, AChild: TWinControl; const AOldPos, ANewPos: Integer;
|
|
const AChildren: TFPList);
|
|
begin
|
|
if not WSCheckHandleAllocated(AWincontrol, 'SetChildZPosition')
|
|
then Exit;
|
|
if not WSCheckHandleAllocated(AChild, 'SetChildZPosition (child)')
|
|
then Exit;
|
|
|
|
{ if ANewPos = 0 // bottom
|
|
then AfterWnd := HWND_BOTTOM
|
|
else if ANewPos >= AChildren.Count - 1
|
|
then AfterWnd := HWND_TOP
|
|
else begin
|
|
// Search for the first child above us with a handle
|
|
// the child list is reversed form the windows order.
|
|
// So the first window is the top window and is the last child
|
|
// if we don't find a allocated handle then we are effectively not moved
|
|
AfterWnd := 0;
|
|
if AOldPos > ANewPos
|
|
then StopPos := AOldPos // The child is moved to the bottom, oldpos is on top of it
|
|
else StopPos := AChildren.Count - 1; // the child is moved to the top
|
|
|
|
for n := ANewPos + 1 to StopPos do
|
|
begin
|
|
Child := TWinControl(AChildren[n]);
|
|
if Child.HandleAllocated
|
|
then begin
|
|
AfterWnd := Child.Handle;
|
|
Break;
|
|
end;
|
|
end;
|
|
|
|
if AfterWnd = 0 then Exit; // nothing to do
|
|
end;
|
|
Windows.SetWindowPos(AChild.Handle, AfterWnd, 0, 0, 0, 0,
|
|
SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOOWNERZORDER or
|
|
SWP_NOSIZE or SWP_NOSENDCHANGING);}
|
|
end;
|
|
|
|
{------------------------------------------------------------------------------
|
|
Method: SetBounds
|
|
Params: AWinControl - the object which invoked this function
|
|
ALeft, ATop, AWidth, AHeight - new dimensions for the control
|
|
Pre: AWinControl.HandleAllocated
|
|
Returns: Nothing
|
|
|
|
Resize a window
|
|
------------------------------------------------------------------------------}
|
|
class procedure TCDWSWinControl.SetBounds(const AWinControl: TWinControl;
|
|
const ALeft, ATop, AWidth, AHeight: Integer);
|
|
begin
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.SetColor(const AWinControl: TWinControl);
|
|
begin
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.SetFont(const AWinControl: TWinControl; const AFont: TFont);
|
|
begin
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.SetText(const AWinControl: TWinControl; const AText: string);
|
|
begin
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.ConstraintsChange(const AWinControl: TWinControl);
|
|
begin
|
|
end;
|
|
|
|
class function TCDWSWinControl.CreateHandle(const AWinControl: TWinControl;
|
|
const AParams: TCreateParams): HWND;
|
|
var
|
|
lCDWinControl: TCDWinControl;
|
|
begin
|
|
lCDWinControl := TCDWinControl.Create;
|
|
lCDWinControl.WinControl := AWinControl;
|
|
lCDWinControl.Region := TLazRegionWithChilds.Create;
|
|
lCDWinControl.Region.UserData := AWinControl;
|
|
lCDWinControl.Region.SetAsSimpleRectRegion(Bounds(AWinControl.Left, AWinControl.Top, AParams.Width, AParams.Height));
|
|
|
|
Result := HWND(lCDWinControl);
|
|
|
|
TCDWSCustomForm.BackendAddCDWinControlToForm(TCustomForm(AWinControl.Parent), lCDWinControl);
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.DestroyHandle(const AWinControl: TWinControl);
|
|
begin
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.Invalidate(const AWinControl: TWinControl);
|
|
begin
|
|
// lpRect = nil updates entire client area of window
|
|
//InvalidateRect(AWinControl.Handle, nil, true);
|
|
end;
|
|
|
|
class procedure TCDWSWinControl.ShowHide(const AWinControl: TWinControl);
|
|
begin
|
|
end;
|
|
|