mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-05 15:20:38 +02:00
win32: add more checks in UpdateUIState (maybe fixes bug #0014014)
git-svn-id: trunk@20686 -
This commit is contained in:
parent
faba3df333
commit
67b08ac58d
@ -1658,7 +1658,7 @@ begin
|
||||
end;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function GetParentForm(Control:TControl): TCustomForm;
|
||||
function GetParentForm(Control: TControl): TCustomForm;
|
||||
begin
|
||||
while Control.Parent <> nil do
|
||||
Control := Control.Parent;
|
||||
|
@ -1169,19 +1169,31 @@ var
|
||||
// This piece of code is taken from ThemeMgr.pas of Mike Lischke
|
||||
// Beginning with Windows 2000 the UI in an application may hide focus rectangles and accelerator key indication.
|
||||
// We have to take care to show them if the user starts navigating using the keyboard.
|
||||
|
||||
function FindParentForm: TCustomForm; inline;
|
||||
begin
|
||||
if lWinControl <> nil then
|
||||
Result := GetParentForm(lWinControl)
|
||||
else
|
||||
if Application <> nil then
|
||||
Result := Application.MainForm
|
||||
else
|
||||
Result := nil;
|
||||
end;
|
||||
|
||||
var
|
||||
ParentForm: TCustomForm;
|
||||
begin
|
||||
case CharCode of
|
||||
VK_LEFT..VK_DOWN, VK_TAB:
|
||||
begin
|
||||
ParentForm := GetParentForm(lWinControl);
|
||||
ParentForm := FindParentForm;
|
||||
if ParentForm <> nil then
|
||||
SendMessage(ParentForm.Handle, WM_CHANGEUISTATE, MakeLong(UIS_CLEAR, UISF_HIDEFOCUS), 0);
|
||||
end;
|
||||
VK_MENU:
|
||||
begin
|
||||
ParentForm := GetParentForm(lWinControl);
|
||||
ParentForm := FindParentForm;
|
||||
if ParentForm <> nil then
|
||||
SendMessage(ParentForm.Handle, WM_CHANGEUISTATE, MakeLong(UIS_CLEAR, UISF_HIDEACCEL), 0);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user