Object Inspector: Simplify and shorten a little. Add a ToDo in TObjectInspectorDlg.KeyDown.

git-svn-id: trunk@57490 -
This commit is contained in:
juha 2018-03-09 22:30:44 +00:00
parent fe0da63af0
commit 7cc99ef58e

View File

@ -4407,13 +4407,16 @@ begin
ButtonWidth := Scale96ToForm(23); ButtonWidth := Scale96ToForm(23);
Anchors := [akTop, akLeft, akRight]; Anchors := [akTop, akLeft, akRight];
BorderSpacing.Left := 5; BorderSpacing.Left := 5;
TabOrder := 0;
OnAfterFilter := @PropFilterEditAfterFilter; OnAfterFilter := @PropFilterEditAfterFilter;
OnResize := @PropFilterEditResize; OnResize := @PropFilterEditResize;
end; end;
TIDEImages.AssignImage(PropFilterEdit.Glyph, 'btnfiltercancel'); TIDEImages.AssignImage(PropFilterEdit.Glyph, 'btnfiltercancel');
CreateNoteBook; CreateNoteBook;
// TabOrder has no effect. TAB key is handled by TObjectInspectorDlg.KeyDown().
CompFilterEdit.TabOrder := 0;
ComponentTree.TabOrder := 1;
PropFilterEdit.TabOrder := 2;
end; end;
destructor TObjectInspectorDlg.Destroy; destructor TObjectInspectorDlg.Destroy;
@ -4964,34 +4967,27 @@ begin
Handled := false; Handled := false;
//CTRL-[Shift]-TAB will select next or previous notebook tab //CTRL-[Shift]-TAB will select next or previous notebook tab
if Key=VK_TAB then if (Key=VK_TAB) and (ssCtrl in Shift) then
begin
if Shift = [ssCtrl] then
begin begin
Handled := true; Handled := true;
if ssShift in Shift then
ShowNextPage(-1)
else
ShowNextPage(1); ShowNextPage(1);
end else if Shift = [ssCtrl, ssShift] then
begin
Handled := true;
ShowNextPage(-1);
end;
end; end;
//Allow combobox navigation while it has focus //Allow combobox navigation while it has focus
if not Handled
then Handled := AvailPersistentComboBox.Focused;
if not Handled then if not Handled then
begin Handled := AvailPersistentComboBox.Focused;
//CTRL-ArrowDown will dropdown the component combobox //CTRL-ArrowDown will dropdown the component combobox
if (Key=VK_DOWN) and (ssCtrl in Shift) then if (not Handled) and (Key=VK_DOWN) and (ssCtrl in Shift) then
begin begin
Handled := true; Handled := true;
if AvailPersistentComboBox.Canfocus if AvailPersistentComboBox.Canfocus then
then AvailPersistentComboBox.SetFocus; AvailPersistentComboBox.SetFocus;
AvailPersistentComboBox.DroppedDown := true; AvailPersistentComboBox.DroppedDown := true;
end; end;
end;
if not Handled then if not Handled then
begin begin
@ -5544,9 +5540,12 @@ procedure TObjectInspectorDlg.KeyDown(var Key: Word; Shift: TShiftState);
var var
CurGrid: TOICustomPropertyGrid; CurGrid: TOICustomPropertyGrid;
begin begin
CurGrid:=GetActivePropertyGrid; // ToDo: Allow TAB key to FilterEdit, TreeView and Grid. Now the Grid gets seleted always.
DebugLn(['TObjectInspectorDlg.KeyDown: Key=', Key, ', ActiveControl=', ActiveControl]);
//Do not disturb the combobox navigation while it has focus //Do not disturb the combobox navigation while it has focus
if not AvailPersistentComboBox.DroppedDown then begin if not AvailPersistentComboBox.DroppedDown then begin
CurGrid:=GetActivePropertyGrid;
if CurGrid<>nil then begin if CurGrid<>nil then begin
CurGrid.HandleStandardKeys(Key,Shift); CurGrid.HandleStandardKeys(Key,Shift);
if Key=VK_UNKNOWN then exit; if Key=VK_UNKNOWN then exit;