mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 10:59:25 +02:00
win32: removed ComCtrls from win32proc. Replacing explicit TCustomTabControl check for a call to the added WindowInfo.ClientOffsetProc
git-svn-id: trunk@51191 -
This commit is contained in:
parent
5913d5f2b1
commit
7fb25de778
@ -266,6 +266,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TabControlClientOffset(const AWinControl: TWinControl;
|
||||||
|
var ORect: Rect);
|
||||||
|
var
|
||||||
|
ARect: TRect;
|
||||||
|
begin
|
||||||
|
// Can't use complete client rect in win32 interface, top part contains the tabs
|
||||||
|
Windows.GetClientRect(AWinControl.Handle, @ARect);
|
||||||
|
ORect := ARect;
|
||||||
|
Windows.SendMessage(AWinControl.Handle, TCM_AdjustRect, 0, LPARAM(@ORect));
|
||||||
|
Dec(ORect.Right, ARect.Right);
|
||||||
|
Dec(ORect.Bottom, ARect.Bottom);
|
||||||
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomTabControl.CreateHandle(const AWinControl: TWinControl;
|
class function TWin32WSCustomTabControl.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): HWND;
|
const AParams: TCreateParams): HWND;
|
||||||
const
|
const
|
||||||
@ -306,6 +319,7 @@ begin
|
|||||||
// to improve speed and possible paint anomalities
|
// to improve speed and possible paint anomalities
|
||||||
Params.WindowInfo^.ParentMsgHandler := @TabControlParentMsgHandler;
|
Params.WindowInfo^.ParentMsgHandler := @TabControlParentMsgHandler;
|
||||||
Params.WindowInfo^.needParentPaint := false;
|
Params.WindowInfo^.needParentPaint := false;
|
||||||
|
Params.WindowInfo^.ClientOffsetProc := @TabControlClientOffset;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -40,6 +40,8 @@ Type
|
|||||||
Msg: UInt; WParam: Windows.WParam; const DrawIS: TDrawItemStruct;
|
Msg: UInt; WParam: Windows.WParam; const DrawIS: TDrawItemStruct;
|
||||||
var ItemMsg: Integer; var DrawListItem: Boolean);
|
var ItemMsg: Integer; var DrawListItem: Boolean);
|
||||||
|
|
||||||
|
TGetClientOffsetProc = procedure (const AWinControl: TWinControl; var Rect: TRect);
|
||||||
|
|
||||||
PWin32WindowInfo = ^TWin32WindowInfo;
|
PWin32WindowInfo = ^TWin32WindowInfo;
|
||||||
TWin32WindowInfo = record
|
TWin32WindowInfo = record
|
||||||
Overlay: HWND; // overlay, transparent window on top, used by designer
|
Overlay: HWND; // overlay, transparent window on top, used by designer
|
||||||
@ -67,6 +69,7 @@ Type
|
|||||||
ThemedCustomDraw: boolean;// controls needs themed drawing in wm_notify/nm_customdraw
|
ThemedCustomDraw: boolean;// controls needs themed drawing in wm_notify/nm_customdraw
|
||||||
IMEComposed: Boolean;
|
IMEComposed: Boolean;
|
||||||
DrawItemHandler: TDrawItemHandlerProc;
|
DrawItemHandler: TDrawItemHandlerProc;
|
||||||
|
ClientOffsetProc: TGetClientOffsetProc; // used by GetLCLClientBoundsOffset
|
||||||
case integer of
|
case integer of
|
||||||
0: (spinValue: Double);
|
0: (spinValue: Double);
|
||||||
1: (
|
1: (
|
||||||
@ -171,7 +174,7 @@ var
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLStrConsts, Dialogs, StdCtrls, ExtCtrls, ComCtrls,
|
LCLStrConsts, Dialogs, StdCtrls, ExtCtrls,
|
||||||
LCLIntf; //remove this unit when GetWindowSize is moved to TWSWinControl
|
LCLIntf; //remove this unit when GetWindowSize is moved to TWSWinControl
|
||||||
|
|
||||||
{$IFOPT C-}
|
{$IFOPT C-}
|
||||||
@ -678,6 +681,7 @@ var
|
|||||||
Handle: HWND;
|
Handle: HWND;
|
||||||
TheWinControl: TWinControl absolute Sender;
|
TheWinControl: TWinControl absolute Sender;
|
||||||
ARect: TRect;
|
ARect: TRect;
|
||||||
|
Win32Info: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if not (Sender is TWinControl) then exit;
|
if not (Sender is TWinControl) then exit;
|
||||||
@ -725,14 +729,10 @@ begin
|
|||||||
ORect.Right := -2;
|
ORect.Right := -2;
|
||||||
ORect.Bottom := -2;
|
ORect.Bottom := -2;
|
||||||
end else
|
end else
|
||||||
if TheWinControl is TCustomTabControl then
|
|
||||||
begin
|
begin
|
||||||
// Can't use complete client rect in win32 interface, top part contains the tabs
|
Win32Info:=GetWin32WindowInfo(Handle);
|
||||||
Windows.GetClientRect(Handle, @ARect);
|
if Assigned(Win32Info^.ClientOffsetProc) then
|
||||||
ORect := ARect;
|
Win32Info^.ClientOffsetProc(TheWinControl, ORect);
|
||||||
Windows.SendMessage(Handle, TCM_AdjustRect, 0, LPARAM(@ORect));
|
|
||||||
Dec(ORect.Right, ARect.Right);
|
|
||||||
Dec(ORect.Bottom, ARect.Bottom);
|
|
||||||
end;
|
end;
|
||||||
{
|
{
|
||||||
if (GetWindowLong(Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE) <> 0 then
|
if (GetWindowLong(Handle, GWL_EXSTYLE) and WS_EX_CLIENTEDGE) <> 0 then
|
||||||
|
Loading…
Reference in New Issue
Block a user