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:
paul 2010-02-04 03:09:32 +00:00
parent 46bb53cc00
commit 9d6fb42169
4 changed files with 8 additions and 6 deletions

View File

@ -249,7 +249,7 @@ uses
Win32WSStdCtrls,
Win32Themes,
////////////////////////////////////////////////////
Arrow, Calendar, Spin, CheckLst, Win32Extra, LclProc, LCLMessageGlue;
Arrow, Calendar, CheckLst, Win32Extra, LclProc, LCLMessageGlue;
type
TMouseDownFocusStatus = (mfNone, mfFocusSense, mfFocusChanged);

View File

@ -55,6 +55,7 @@ Type
isComboEdit: boolean; // is buddy of combobox, the edit control
isChildEdit: boolean; // is buddy edit of a control
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
MaxLength: integer;
DrawItemIndex: integer; // in case of listbox, when handling WM_DRAWITEM

View File

@ -2251,7 +2251,7 @@ var
begin
Result := False;
WindowInfo := GetWin32WindowInfo(Handle);
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
if WindowInfo^.askBuddyCoords then
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
if IsIconic(Handle) and GetWindowPlacement(Handle, @WindowPlacement) then
@ -2299,8 +2299,8 @@ var
BuddyWP: WINDOWPLACEMENT;
begin
BuddyHandle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
if (BuddyHandle<>HWND(nil)) and Windows.GetWindowPlacement(BuddyHandle, BuddyWP)
then Width := WP.rcNormalPosition.Right - BuddyWP.rcNormalPosition.Left;
if (BuddyHandle<>HWND(nil)) and Windows.GetWindowPlacement(BuddyHandle, BuddyWP) then
Width := WP.rcNormalPosition.Right - BuddyWP.rcNormalPosition.Left;
end;
procedure ExcludeCaption; inline;
@ -2382,7 +2382,7 @@ begin
ExcludeCaption;
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
if WindowInfo^.askBuddyCoords then
AdjustForBuddySize;
end;

View File

@ -194,7 +194,8 @@ begin
// init buddy
Params.SubClassWndProc := @SpinBuddyWindowProc;
WindowCreateInitBuddy(AWinControl, Params);
Params.BuddyWindowInfo^.isChildEdit := true;
Params.BuddyWindowInfo^.isChildEdit := True;
Params.WindowInfo^.askBuddyCoords := True;
// make possible LCL Wincontrol identification by Buddy handle
// TODO: should move to widget specific SetProp method
SetProp(Params.Buddy, 'WinControl', PtrUInt(AWinControl));