mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 07:41:12 +02:00
win32: update spinedit text on focus change (bug #0013046)
git-svn-id: trunk@18446 -
This commit is contained in:
parent
cf4f433100
commit
d3ed4629f9
@ -71,6 +71,8 @@ type
|
||||
end;
|
||||
|
||||
|
||||
procedure UpdateFloatSpinEditControl(const Handle: HWND;
|
||||
const AFloatSpinEdit: TCustomFloatSpinEdit);
|
||||
procedure UpdateFloatSpinEditText(const ASpinEdit: TCustomFloatSpinEdit;
|
||||
const ANewValue: Double);
|
||||
|
||||
@ -103,6 +105,21 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function SpinBuddyWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||
LParam: Windows.LParam): LResult; stdcall;
|
||||
var
|
||||
AWindowInfo: PWindowInfo;
|
||||
begin
|
||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||
if Msg = WM_KILLFOCUS then
|
||||
begin
|
||||
AWindowInfo := GetWindowInfo(Window);
|
||||
if AWindowInfo^.AWinControl is TCustomFloatSpinEdit then
|
||||
UpdateFloatSpinEditControl(AWindowInfo^.AWinControl.Handle,
|
||||
TCustomFloatSpinEdit(AWindowInfo^.AWinControl));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure UpdateFloatSpinEditControl(const Handle: HWND;
|
||||
const AFloatSpinEdit: TCustomFloatSpinEdit);
|
||||
var
|
||||
@ -161,7 +178,7 @@ begin
|
||||
FinishCreateWindow(AWinControl, Params, true);
|
||||
UpdateFloatSpinEditControl(Params.Window, TCustomFloatSpinEdit(AWinControl));
|
||||
// init buddy
|
||||
Params.SubClassWndProc := @WindowProc;
|
||||
Params.SubClassWndProc := @SpinBuddyWindowProc;
|
||||
WindowCreateInitBuddy(AWinControl, Params);
|
||||
Params.BuddyWindowInfo^.isChildEdit := true;
|
||||
// make possible LCL Wincontrol identification by Buddy handle
|
||||
|
Loading…
Reference in New Issue
Block a user