mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-25 22:19:21 +02:00
win32: move few spinedit handlers from generic windowproc to spinedit windowproc
git-svn-id: trunk@23616 -
This commit is contained in:
parent
bf426e5704
commit
83ea351c48
@ -605,22 +605,6 @@ var
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DestroyFloatSpinEditBuddy(SpinEditHandle: HWND);
|
|
||||||
var
|
|
||||||
Buddy: HWND;
|
|
||||||
begin
|
|
||||||
Buddy := SendMessage(SpinEditHandle, UDM_GETBUDDY, 0, 0);
|
|
||||||
DestroyWindow(Buddy);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure EnableFloatSpinEditBuddy(SpinEditHandle: HWND; Enable: boolean);
|
|
||||||
var
|
|
||||||
Buddy: HWND;
|
|
||||||
begin
|
|
||||||
Buddy := SendMessage(SpinEditHandle, UDM_GETBUDDY, 0, 0);
|
|
||||||
Windows.EnableWindow(Buddy, Enable);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure EnableChildWindows(WinControl: TWinControl; Enable: boolean);
|
procedure EnableChildWindows(WinControl: TWinControl; Enable: boolean);
|
||||||
var
|
var
|
||||||
i: integer;
|
i: integer;
|
||||||
@ -1579,8 +1563,6 @@ begin
|
|||||||
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
||||||
if lWinControl is TCheckListBox then
|
if lWinControl is TCheckListBox then
|
||||||
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
|
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
|
||||||
if lWinControl is TCustomFloatSpinEdit then
|
|
||||||
DestroyFloatSpinEditBuddy(Window);
|
|
||||||
if lWinControl is TCustomComboBox then
|
if lWinControl is TCustomComboBox then
|
||||||
DisposeComboEditWindowInfo(TCustomComboBox(lWinControl));
|
DisposeComboEditWindowInfo(TCustomComboBox(lWinControl));
|
||||||
if WindowInfo^.Overlay<>HWND(nil) then
|
if WindowInfo^.Overlay<>HWND(nil) then
|
||||||
@ -1676,8 +1658,6 @@ begin
|
|||||||
if Assigned(lWinControl) and not (lWinControl is TCustomForm) then
|
if Assigned(lWinControl) and not (lWinControl is TCustomForm) then
|
||||||
EnableChildWindows(lWinControl, WParam<>0);
|
EnableChildWindows(lWinControl, WParam<>0);
|
||||||
|
|
||||||
if (lWinControl is TCustomFloatSpinEdit) then
|
|
||||||
EnableFloatSpinEditBuddy(Window, WParam<>0);
|
|
||||||
// ugly hack to give bitbtns a nice look
|
// ugly hack to give bitbtns a nice look
|
||||||
// When no theming active, the internal image needs to be
|
// When no theming active, the internal image needs to be
|
||||||
// recreated when the enabled state is changed
|
// recreated when the enabled state is changed
|
||||||
|
@ -88,8 +88,23 @@ function SpinWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
|||||||
var
|
var
|
||||||
BuddyWindow: HWND;
|
BuddyWindow: HWND;
|
||||||
begin
|
begin
|
||||||
|
// before generic window proc
|
||||||
|
case Msg of
|
||||||
|
WM_DESTROY:
|
||||||
|
begin
|
||||||
|
BuddyWindow := GetBuddyWindow(Window);
|
||||||
|
DestroyWindow(BuddyWindow);
|
||||||
|
end;
|
||||||
|
WM_ENABLE:
|
||||||
|
begin
|
||||||
|
BuddyWindow := GetBuddyWindow(Window);
|
||||||
|
Windows.EnableWindow(BuddyWindow, WParam <> 0);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
if Msg = WM_SETFOCUS then
|
// after generic window proc
|
||||||
|
case Msg of
|
||||||
|
WM_SETFOCUS:
|
||||||
begin
|
begin
|
||||||
BuddyWindow := GetBuddyWindow(Window);
|
BuddyWindow := GetBuddyWindow(Window);
|
||||||
Windows.SetFocus(BuddyWindow);
|
Windows.SetFocus(BuddyWindow);
|
||||||
@ -99,6 +114,7 @@ begin
|
|||||||
// for LCL controls this is done in win32callback.inc
|
// for LCL controls this is done in win32callback.inc
|
||||||
Windows.SendMessage(BuddyWindow, EM_SETSEL, 0, -1);
|
Windows.SendMessage(BuddyWindow, EM_SETSEL, 0, -1);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function SpinBuddyWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
function SpinBuddyWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||||
|
Loading…
Reference in New Issue
Block a user