mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 04:19:09 +02:00
improve memo/edit keystroke "handled" property, which is, message result
add ability to continue processing shortcut events (fixes issue #1308) git-svn-id: trunk@8062 -
This commit is contained in:
parent
4983bbc0af
commit
68d4ba68c5
@ -11976,7 +11976,11 @@ begin
|
||||
if (CurFocusControl<>nil) then begin
|
||||
CurFocusControl:=GetParentForm(CurFocusControl);
|
||||
if (CurFocusControl<>MainIDEBar) and (CurFocusControl<>SourceNotebook) then
|
||||
begin
|
||||
// continue processing shortcut, not handled yet
|
||||
MainIDEBar.mnuMainMenu.ShortcutHandled := false;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
DoCommand(EditorCommand);
|
||||
end;
|
||||
|
@ -336,7 +336,8 @@ procedure TCustomEdit.WMChar(var Message: TLMChar);
|
||||
begin
|
||||
// all normal characters are handled by the Edit
|
||||
//debugln('TCustomEdit.WMChar ',DbgSName(Self),' ',dbgs(Message.CharCode));
|
||||
if Message.CharCode in [ord('A')..ord('Z'),ord('a')..ord('z')] then
|
||||
if (KeyDataToShiftState(Message.KeyData) * [ssCtrl, ssAlt] = [])
|
||||
and (Message.CharCode in [ord('A')..ord('Z'),ord('a')..ord('z')]) then
|
||||
// eat normal keys, so they don't trigger accelerators
|
||||
Message.Result := 1
|
||||
else
|
||||
|
@ -211,12 +211,6 @@ begin
|
||||
inherited ControlKeyDown(Key, Shift);
|
||||
end;
|
||||
|
||||
procedure TCustomMemo.WMChar(var Message: TLMChar);
|
||||
begin
|
||||
// all normal characters are handled by the memo
|
||||
Message.Result := 1;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomMemo.SetWordWrap
|
||||
Params:
|
||||
|
@ -152,9 +152,11 @@ begin
|
||||
Result := Item <> nil;
|
||||
if Result then
|
||||
begin
|
||||
FShortcutHandled := true;
|
||||
Item.InitiateActions;
|
||||
Item.Click;
|
||||
end;
|
||||
Result := FShortcutHandled;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -272,6 +272,7 @@ type
|
||||
FItems: TMenuItem;
|
||||
FOnChange: TMenuChangeEvent;
|
||||
FParent: TComponent;
|
||||
FShortcutHandled: boolean;
|
||||
procedure SetImages(const AValue: TCustomImageList);
|
||||
procedure SetParent(const AValue: TComponent);
|
||||
procedure ImageListChange(Sender: TObject);
|
||||
@ -299,6 +300,7 @@ type
|
||||
public
|
||||
property Handle: HMenu read GetHandle;
|
||||
property Parent: TComponent read FParent write SetParent;
|
||||
property ShortcutHandled: boolean read FShortcutHandled write FShortcutHandled;
|
||||
published
|
||||
property Items: TMenuItem read FItems;
|
||||
property Images: TCustomImageList read FImages write SetImages;
|
||||
|
@ -672,7 +672,6 @@ type
|
||||
procedure Loaded; override;
|
||||
function WordWrapIsStored: boolean; virtual;
|
||||
procedure ControlKeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
procedure WMChar(var Message: TLMChar); message LM_CHAR;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
Loading…
Reference in New Issue
Block a user