Debian Codegraph @

tools/castle-editor/code/designobjectinspector.pas

raw
1 {
2 Copyright 2022-2022 Michalis Kamburelis.
3
4 This file is part of "Castle Game Engine".
5
6 "Castle Game Engine" is free software; see the file COPYING.txt,
7 included in this distribution, for details about the copyright.
8
9 "Castle Game Engine" is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13 ----------------------------------------------------------------------------
14 }
15
16 { Customized object inspector control.
17 The basis is just LCL TOIPropertyGrid. }
18 unit DesignObjectInspector;
19
20 interface
21
22 uses Classes, ObjectInspector, LCLType;
23
24 type
25 { Customized (for CGE editor) object inspector control. }
26 TCastleObjectInspector = class(TOIPropertyGrid)
27 protected
28 procedure HandleStandardKeys(var Key: Word; Shift: TShiftState); override;
29 end;
30
31 implementation
32
33 procedure TCastleObjectInspector.HandleStandardKeys(var Key: Word; Shift: TShiftState);
34 var
35 InitialKey: Word;
36 begin
37 InitialKey := Key;
38 inherited;
39 { inherited handles VK_ESCAPE and sets Key to VK_UNKNOWN.
40 We restore it, to allow FormProject to process VK_ESCAPE as menu shortcut
41 to focus TCastleControl. }
42 if InitialKey = VK_ESCAPE then
43 Key := InitialKey;
44 end;
45
46 end.