mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:19:19 +02:00
IDE: componentlist, use VK_RETURN to set current list instead of VK_DOWN which raises av under win32. issue #19590
git-svn-id: trunk@31385 -
This commit is contained in:
parent
443af0046a
commit
f544059e42
@ -87,6 +87,7 @@ type
|
|||||||
FComponentList: TFPList;
|
FComponentList: TFPList;
|
||||||
procedure FindAllLazarusComponents;
|
procedure FindAllLazarusComponents;
|
||||||
procedure AddSelectedComponent(AComponent: TRegisteredComponent);
|
procedure AddSelectedComponent(AComponent: TRegisteredComponent);
|
||||||
|
procedure SetFocusToDataList;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -328,17 +329,65 @@ begin
|
|||||||
ListboxComponentsDblClick(Sender);
|
ListboxComponentsDblClick(Sender);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TComponentListForm.SetFocusToDataList;
|
||||||
|
var
|
||||||
|
S: String;
|
||||||
|
i: Integer;
|
||||||
|
Node: TTreeNode;
|
||||||
|
begin
|
||||||
|
S := PatternEdit.Text;
|
||||||
|
case PageControl.PageIndex of
|
||||||
|
0:
|
||||||
|
begin
|
||||||
|
ListBoxComponents.SetFocus;
|
||||||
|
if ListBoxComponents.Items.Count > 0 then
|
||||||
|
begin
|
||||||
|
i := ListBoxComponents.Items.IndexOf(S);
|
||||||
|
if i < 0 then
|
||||||
|
i := 0;
|
||||||
|
ListBoxComponents.ItemIndex := i;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
1:
|
||||||
|
begin
|
||||||
|
TreePallette.SetFocus;
|
||||||
|
with TreePallette do
|
||||||
|
begin
|
||||||
|
if Items.Count > 0 then
|
||||||
|
begin
|
||||||
|
Node := Items.FindNodeWithText(S);
|
||||||
|
if Node <> nil then
|
||||||
|
Selected := Node
|
||||||
|
else
|
||||||
|
Selected := Items[0];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
2:
|
||||||
|
begin
|
||||||
|
TreeInheritance.SetFocus;
|
||||||
|
with TreeInheritance do
|
||||||
|
begin
|
||||||
|
if Items.Count > 0 then
|
||||||
|
begin
|
||||||
|
Node := Items.FindNodeWithText(S);
|
||||||
|
if Node <> nil then
|
||||||
|
Selected := Node
|
||||||
|
else
|
||||||
|
Selected := Items[0];
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TComponentListForm.PatternEditKeyDown(Sender: TObject; var Key: Word;
|
procedure TComponentListForm.PatternEditKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if Key = VK_Down then
|
if Key = VK_RETURN then
|
||||||
begin
|
begin
|
||||||
Key := 0;
|
Key := 0;
|
||||||
case PageControl.PageIndex of
|
SetFocusToDataList;
|
||||||
0: ListBoxComponents.SetFocus;
|
|
||||||
1: TreePallette.SetFocus;
|
|
||||||
2: TreeInheritance.SetFocus;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user