mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-26 20:20:47 +02:00
fix accelerator handling firing too quickly, better WM_CHAR has-been-handled heuristic
check for focusability of label.focuscontrol git-svn-id: trunk@7111 -
This commit is contained in:
parent
553b2f9e2a
commit
96e2620223
@ -185,7 +185,7 @@ begin
|
|||||||
if not FShowAccelChar then exit;
|
if not FShowAccelChar then exit;
|
||||||
if FFocusControl = nil then exit;
|
if FFocusControl = nil then exit;
|
||||||
|
|
||||||
if IsAccel(Message.CharCode, Caption) then
|
if IsAccel(Message.CharCode, Caption) and FFocusControl.CanFocus then
|
||||||
begin
|
begin
|
||||||
Result := true;
|
Result := true;
|
||||||
FFocusControl.SetFocus;
|
FFocusControl.SetFocus;
|
||||||
@ -266,6 +266,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.31 2005/04/28 10:05:29 micha
|
||||||
|
fix accelerator handling firing too quickly, better WM_CHAR has-been-handled heuristic
|
||||||
|
check for focusability of label.focuscontrol
|
||||||
|
|
||||||
Revision 1.30 2005/04/27 12:37:28 micha
|
Revision 1.30 2005/04/27 12:37:28 micha
|
||||||
implement/fix button/label shortcut accelchar handling
|
implement/fix button/label shortcut accelchar handling
|
||||||
|
|
||||||
|
@ -1371,9 +1371,12 @@ Begin
|
|||||||
WM_CHAR, WM_KEYDOWN, WM_KEYUP,
|
WM_CHAR, WM_KEYDOWN, WM_KEYUP,
|
||||||
WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP:
|
WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP:
|
||||||
begin
|
begin
|
||||||
|
PLMsg^.Result := 0;
|
||||||
case Msg of
|
case Msg of
|
||||||
WM_CHAR:
|
WM_CHAR:
|
||||||
begin
|
begin
|
||||||
|
// if want chars, then handled already
|
||||||
|
PLMsg^.Result := CallDefaultWindowProc(Window, WM_GETDLGCODE, 0, 0) and DLGC_WANTCHARS;
|
||||||
LMChar.CharCode := Word(WParam);
|
LMChar.CharCode := Word(WParam);
|
||||||
LMChar.Msg := LM_CHAR;
|
LMChar.Msg := LM_CHAR;
|
||||||
end;
|
end;
|
||||||
@ -1405,8 +1408,9 @@ Begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// we cannot tell for sure windows didn't want the key
|
// we cannot tell for sure windows didn't want the key
|
||||||
|
// for WM_CHAR check WM_GETDLGCODE/DLGC_WANTCHARS
|
||||||
// winapi too inconsistent about return value
|
// winapi too inconsistent about return value
|
||||||
PLMsg^.Result := 0;
|
if PLMsg^.Result = 0 then
|
||||||
DeliverMessage(lWinControl, PLMsg^);
|
DeliverMessage(lWinControl, PLMsg^);
|
||||||
|
|
||||||
// handle Ctrl-A for edit controls
|
// handle Ctrl-A for edit controls
|
||||||
@ -1548,6 +1552,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.202 2005/04/28 10:05:29 micha
|
||||||
|
fix accelerator handling firing too quickly, better WM_CHAR has-been-handled heuristic
|
||||||
|
check for focusability of label.focuscontrol
|
||||||
|
|
||||||
Revision 1.201 2005/04/20 14:08:38 vincents
|
Revision 1.201 2005/04/20 14:08:38 vincents
|
||||||
fixed SpinEdit.Visible and SpinEdit.Enabled
|
fixed SpinEdit.Visible and SpinEdit.Enabled
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user