mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 23:08:05 +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;
|
||||
|
||||
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);
|
||||
var
|
||||
i: integer;
|
||||
@ -1579,8 +1563,6 @@ begin
|
||||
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
||||
if lWinControl is TCheckListBox then
|
||||
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
|
||||
if lWinControl is TCustomFloatSpinEdit then
|
||||
DestroyFloatSpinEditBuddy(Window);
|
||||
if lWinControl is TCustomComboBox then
|
||||
DisposeComboEditWindowInfo(TCustomComboBox(lWinControl));
|
||||
if WindowInfo^.Overlay<>HWND(nil) then
|
||||
@ -1676,8 +1658,6 @@ begin
|
||||
if Assigned(lWinControl) and not (lWinControl is TCustomForm) then
|
||||
EnableChildWindows(lWinControl, WParam<>0);
|
||||
|
||||
if (lWinControl is TCustomFloatSpinEdit) then
|
||||
EnableFloatSpinEditBuddy(Window, WParam<>0);
|
||||
// ugly hack to give bitbtns a nice look
|
||||
// When no theming active, the internal image needs to be
|
||||
// recreated when the enabled state is changed
|
||||
|
@ -88,16 +88,32 @@ function SpinWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||
var
|
||||
BuddyWindow: HWND;
|
||||
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);
|
||||
if Msg = WM_SETFOCUS then
|
||||
begin
|
||||
BuddyWindow := GetBuddyWindow(Window);
|
||||
Windows.SetFocus(BuddyWindow);
|
||||
// don't select text in edit, if user clicked on the up down and the edit
|
||||
// was already focused
|
||||
if HWND(WPARAM)<>BuddyWindow then ;
|
||||
// for LCL controls this is done in win32callback.inc
|
||||
Windows.SendMessage(BuddyWindow, EM_SETSEL, 0, -1);
|
||||
// after generic window proc
|
||||
case Msg of
|
||||
WM_SETFOCUS:
|
||||
begin
|
||||
BuddyWindow := GetBuddyWindow(Window);
|
||||
Windows.SetFocus(BuddyWindow);
|
||||
// don't select text in edit, if user clicked on the up down and the edit
|
||||
// was already focused
|
||||
if HWND(WPARAM)<>BuddyWindow then ;
|
||||
// for LCL controls this is done in win32callback.inc
|
||||
Windows.SendMessage(BuddyWindow, EM_SETSEL, 0, -1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user