mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-25 01:28:22 +02:00
ide: improve object inspector combobox from Marius (#0010518)
git-svn-id: trunk@16976 -
This commit is contained in:
parent
b79bb5fee2
commit
d15a65ac56
@ -848,6 +848,9 @@ begin
|
|||||||
ValueComboBox:=TComboBox.Create(Self);
|
ValueComboBox:=TComboBox.Create(Self);
|
||||||
with ValueComboBox do begin
|
with ValueComboBox do begin
|
||||||
Name:='ValueComboBox';
|
Name:='ValueComboBox';
|
||||||
|
Sorted:=true;
|
||||||
|
AutoSelect:=true;
|
||||||
|
AutoComplete:=true;
|
||||||
Visible:=false;
|
Visible:=false;
|
||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
AutoSize:=false;
|
AutoSize:=false;
|
||||||
@ -2008,6 +2011,8 @@ procedure TOICustomPropertyGrid.HandleStandardKeys(var Key: Word;
|
|||||||
TCustomCombobox(FCurrentEdit).DroppedDown;
|
TCustomCombobox(FCurrentEdit).DroppedDown;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
const
|
||||||
|
Page=20;
|
||||||
var
|
var
|
||||||
Handled: Boolean;
|
Handled: Boolean;
|
||||||
begin
|
begin
|
||||||
@ -2022,9 +2027,21 @@ begin
|
|||||||
SetItemIndexAndFocus(ItemIndex - 1);
|
SetItemIndexAndFocus(ItemIndex - 1);
|
||||||
|
|
||||||
VK_DOWN:
|
VK_DOWN:
|
||||||
if (ItemIndex < FRows.Count - 1) then
|
if (ItemIndex < FRows.Count - 1) then
|
||||||
SetItemIndexAndFocus(ItemIndex + 1);
|
SetItemIndexAndFocus(ItemIndex + 1);
|
||||||
|
|
||||||
|
VK_PRIOR:
|
||||||
|
if (ItemIndex > Page)
|
||||||
|
then SetItemIndexAndFocus(ItemIndex - Page)
|
||||||
|
else if (FRows.Count > 0)
|
||||||
|
then SetItemIndexAndFocus(0);
|
||||||
|
|
||||||
|
VK_NEXT:
|
||||||
|
if (ItemIndex < FRows.Count - Page)
|
||||||
|
then SetItemIndexAndFocus(ItemIndex + Page)
|
||||||
|
else if (FRows.Count > 0)
|
||||||
|
then SetItemIndexAndFocus(FRows.Count - 1);
|
||||||
|
|
||||||
VK_TAB:
|
VK_TAB:
|
||||||
DoTabKey;
|
DoTabKey;
|
||||||
|
|
||||||
@ -3483,6 +3500,10 @@ begin
|
|||||||
|
|
||||||
// combobox at top (filled with available persistents)
|
// combobox at top (filled with available persistents)
|
||||||
with AvailPersistentComboBox do begin
|
with AvailPersistentComboBox do begin
|
||||||
|
Sorted:=true;
|
||||||
|
AutoSelect:=true;
|
||||||
|
AutoComplete:=true;
|
||||||
|
DropDownCount := 12;
|
||||||
Visible:=not FShowComponentTree;
|
Visible:=not FShowComponentTree;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3835,17 +3856,36 @@ procedure TObjectInspectorDlg.OnGridKeyDown(Sender: TObject; var Key: Word;
|
|||||||
var
|
var
|
||||||
Handled: Boolean;
|
Handled: Boolean;
|
||||||
begin
|
begin
|
||||||
Handled := False;
|
Handled := false;
|
||||||
if Key = VK_TAB then
|
|
||||||
|
//CTRL-[Shift]-TAB will select next or previous notebook tab
|
||||||
|
if Key=VK_TAB then
|
||||||
begin
|
begin
|
||||||
Handled := True;
|
|
||||||
if Shift = [ssCtrl] then
|
if Shift = [ssCtrl] then
|
||||||
ShowNextPage(1)
|
begin
|
||||||
else
|
Handled := true;
|
||||||
if Shift = [ssCtrl, ssShift] then
|
ShowNextPage(1);
|
||||||
ShowNextPage(-1)
|
end else if Shift = [ssCtrl, ssShift] then
|
||||||
else
|
begin
|
||||||
Handled := False;
|
Handled := true;
|
||||||
|
ShowNextPage(-1);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
//Allow combobox navigation while it has focus
|
||||||
|
if not Handled
|
||||||
|
then Handled := AvailPersistentComboBox.Focused;
|
||||||
|
|
||||||
|
if not Handled then
|
||||||
|
begin
|
||||||
|
//CTRL-ArrowDown will dropdown the component combobox
|
||||||
|
if (Key=VK_DOWN) and (ssCtrl in Shift) then
|
||||||
|
begin
|
||||||
|
Handled := true;
|
||||||
|
if AvailPersistentComboBox.Canfocus
|
||||||
|
then AvailPersistentComboBox.SetFocus;
|
||||||
|
AvailPersistentComboBox.DroppedDown := true;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not Handled then
|
if not Handled then
|
||||||
@ -4365,9 +4405,12 @@ var
|
|||||||
CurGrid: TOICustomPropertyGrid;
|
CurGrid: TOICustomPropertyGrid;
|
||||||
begin
|
begin
|
||||||
CurGrid:=GetActivePropertyGrid;
|
CurGrid:=GetActivePropertyGrid;
|
||||||
if CurGrid<>nil then begin
|
//Do not disturb the combobox navigation while it has focus
|
||||||
CurGrid.HandleStandardKeys(Key,Shift);
|
if not AvailPersistentComboBox.DroppedDown then begin
|
||||||
if Key=VK_UNKNOWN then exit;
|
if CurGrid<>nil then begin
|
||||||
|
CurGrid.HandleStandardKeys(Key,Shift);
|
||||||
|
if Key=VK_UNKNOWN then exit;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
inherited KeyDown(Key, Shift);
|
inherited KeyDown(Key, Shift);
|
||||||
if (Key<>VK_UNKNOWN) and Assigned(OnRemainingKeyDown) then
|
if (Key<>VK_UNKNOWN) and Assigned(OnRemainingKeyDown) then
|
||||||
|
Loading…
Reference in New Issue
Block a user