mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 09:29:10 +02:00
fix 798, spinedit control needs coordinates of buddy
git-svn-id: trunk@7332 -
This commit is contained in:
parent
8700bd0071
commit
5ad37d66be
@ -2024,8 +2024,12 @@ var
|
|||||||
LeftTop:TPoint;
|
LeftTop:TPoint;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
ParentHandle: THandle;
|
ParentHandle: THandle;
|
||||||
|
WindowInfo: PWindowInfo;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
WindowInfo := GetWindowInfo(Handle);
|
||||||
|
if (WindowInfo^.WinControl is TCustomSpinEdit) then
|
||||||
|
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
||||||
if not Windows.GetWindowRect(Handle,@R) then exit;
|
if not Windows.GetWindowRect(Handle,@R) then exit;
|
||||||
LeftTop.X:=R.Left;
|
LeftTop.X:=R.Left;
|
||||||
LeftTop.Y:=R.Top;
|
LeftTop.Y:=R.Top;
|
||||||
@ -2056,6 +2060,16 @@ var
|
|||||||
WP: WINDOWPLACEMENT;
|
WP: WINDOWPLACEMENT;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
Style, ExStyle: LongInt;
|
Style, ExStyle: LongInt;
|
||||||
|
WindowInfo: PWindowInfo;
|
||||||
|
|
||||||
|
procedure AdjustForBuddySize;
|
||||||
|
var
|
||||||
|
BuddyWidth, BuddyHeight: integer;
|
||||||
|
begin
|
||||||
|
GetWindowSize(Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0), BuddyWidth, BuddyHeight);
|
||||||
|
Inc(Width, BuddyWidth);
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
WP.length := SizeOf(WP);
|
WP.length := SizeOf(WP);
|
||||||
Result := Boolean(Windows.GetWindowPlacement(Handle, WP));
|
Result := Boolean(Windows.GetWindowPlacement(Handle, WP));
|
||||||
@ -2096,6 +2110,10 @@ begin
|
|||||||
Dec(Height, Windows.GetSystemMetrics(SM_CYSMCAPTION))
|
Dec(Height, Windows.GetSystemMetrics(SM_CYSMCAPTION))
|
||||||
else
|
else
|
||||||
Dec(Height, Windows.GetSystemMetrics(SM_CYCAPTION));
|
Dec(Height, Windows.GetSystemMetrics(SM_CYCAPTION));
|
||||||
|
|
||||||
|
WindowInfo := GetWindowInfo(Handle);
|
||||||
|
if (WindowInfo^.WinControl is TCustomSpinEdit) then
|
||||||
|
AdjustForBuddySize;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -3141,6 +3159,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.147 2005/07/08 17:58:02 micha
|
||||||
|
fix 798, spinedit control needs coordinates of buddy
|
||||||
|
|
||||||
Revision 1.146 2005/06/22 17:37:06 mattias
|
Revision 1.146 2005/06/22 17:37:06 mattias
|
||||||
implemented TMouse.SetCursorPos from Andrew
|
implemented TMouse.SetCursorPos from Andrew
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user