mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 10:19:35 +02:00
win32: don't perform 'is TCustomFloatSpinEdit' comparisons in code. Therefore empty application does not contains spinedit code anymore (and executable is 12Kb smaller)
git-svn-id: trunk@23624 -
This commit is contained in:
parent
46bb53cc00
commit
9d6fb42169
@ -249,7 +249,7 @@ uses
|
|||||||
Win32WSStdCtrls,
|
Win32WSStdCtrls,
|
||||||
Win32Themes,
|
Win32Themes,
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
Arrow, Calendar, Spin, CheckLst, Win32Extra, LclProc, LCLMessageGlue;
|
Arrow, Calendar, CheckLst, Win32Extra, LclProc, LCLMessageGlue;
|
||||||
|
|
||||||
type
|
type
|
||||||
TMouseDownFocusStatus = (mfNone, mfFocusSense, mfFocusChanged);
|
TMouseDownFocusStatus = (mfNone, mfFocusSense, mfFocusChanged);
|
||||||
|
@ -55,6 +55,7 @@ Type
|
|||||||
isComboEdit: boolean; // is buddy of combobox, the edit control
|
isComboEdit: boolean; // is buddy of combobox, the edit control
|
||||||
isChildEdit: boolean; // is buddy edit of a control
|
isChildEdit: boolean; // is buddy edit of a control
|
||||||
isGroupBox: boolean; // is groupbox, and does not have themed tabpage as parent
|
isGroupBox: boolean; // is groupbox, and does not have themed tabpage as parent
|
||||||
|
askBuddyCoords: boolean; // ask buddy window about position and size
|
||||||
ThemedCustomDraw: boolean;// controls needs themed drawing in wm_notify/nm_customdraw
|
ThemedCustomDraw: boolean;// controls needs themed drawing in wm_notify/nm_customdraw
|
||||||
MaxLength: integer;
|
MaxLength: integer;
|
||||||
DrawItemIndex: integer; // in case of listbox, when handling WM_DRAWITEM
|
DrawItemIndex: integer; // in case of listbox, when handling WM_DRAWITEM
|
||||||
|
@ -2251,7 +2251,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
WindowInfo := GetWin32WindowInfo(Handle);
|
WindowInfo := GetWin32WindowInfo(Handle);
|
||||||
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
|
if WindowInfo^.askBuddyCoords then
|
||||||
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
||||||
|
|
||||||
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
|
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
|
||||||
@ -2299,8 +2299,8 @@ var
|
|||||||
BuddyWP: WINDOWPLACEMENT;
|
BuddyWP: WINDOWPLACEMENT;
|
||||||
begin
|
begin
|
||||||
BuddyHandle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
BuddyHandle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
||||||
if (BuddyHandle<>HWND(nil)) and Windows.GetWindowPlacement(BuddyHandle, BuddyWP)
|
if (BuddyHandle<>HWND(nil)) and Windows.GetWindowPlacement(BuddyHandle, BuddyWP) then
|
||||||
then Width := WP.rcNormalPosition.Right - BuddyWP.rcNormalPosition.Left;
|
Width := WP.rcNormalPosition.Right - BuddyWP.rcNormalPosition.Left;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ExcludeCaption; inline;
|
procedure ExcludeCaption; inline;
|
||||||
@ -2382,7 +2382,7 @@ begin
|
|||||||
|
|
||||||
ExcludeCaption;
|
ExcludeCaption;
|
||||||
|
|
||||||
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
|
if WindowInfo^.askBuddyCoords then
|
||||||
AdjustForBuddySize;
|
AdjustForBuddySize;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -194,7 +194,8 @@ begin
|
|||||||
// init buddy
|
// init buddy
|
||||||
Params.SubClassWndProc := @SpinBuddyWindowProc;
|
Params.SubClassWndProc := @SpinBuddyWindowProc;
|
||||||
WindowCreateInitBuddy(AWinControl, Params);
|
WindowCreateInitBuddy(AWinControl, Params);
|
||||||
Params.BuddyWindowInfo^.isChildEdit := true;
|
Params.BuddyWindowInfo^.isChildEdit := True;
|
||||||
|
Params.WindowInfo^.askBuddyCoords := True;
|
||||||
// make possible LCL Wincontrol identification by Buddy handle
|
// make possible LCL Wincontrol identification by Buddy handle
|
||||||
// TODO: should move to widget specific SetProp method
|
// TODO: should move to widget specific SetProp method
|
||||||
SetProp(Params.Buddy, 'WinControl', PtrUInt(AWinControl));
|
SetProp(Params.Buddy, 'WinControl', PtrUInt(AWinControl));
|
||||||
|
Loading…
Reference in New Issue
Block a user