mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-12 23:39:24 +01:00
Codetools: Use TextHint in Cody Identifiers dialog. Issue #28196, patch from Alexey Torgashin.
git-svn-id: trunk@49205 -
This commit is contained in:
parent
fd613aa8a9
commit
149f86dea2
@ -1,22 +1,22 @@
|
|||||||
object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
||||||
Left = 250
|
Left = 250
|
||||||
Height = 324
|
Height = 404
|
||||||
Top = 250
|
Top = 250
|
||||||
Width = 552
|
Width = 555
|
||||||
ActiveControl = FilterEdit
|
ActiveControl = FilterEdit
|
||||||
Caption = 'CodyIdentifiersDlg'
|
Caption = 'CodyIdentifiersDlg'
|
||||||
ClientHeight = 324
|
ClientHeight = 404
|
||||||
ClientWidth = 552
|
ClientWidth = 555
|
||||||
OnClose = FormClose
|
OnClose = FormClose
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
OnDestroy = FormDestroy
|
OnDestroy = FormDestroy
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.5'
|
||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 36
|
Height = 34
|
||||||
Top = 282
|
Top = 364
|
||||||
Width = 540
|
Width = 543
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
HelpButton.Name = 'HelpButton'
|
HelpButton.Name = 'HelpButton'
|
||||||
@ -25,14 +25,14 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
CloseButton.DefaultCaption = True
|
CloseButton.DefaultCaption = True
|
||||||
CancelButton.Name = 'CancelButton'
|
CancelButton.Name = 'CancelButton'
|
||||||
CancelButton.DefaultCaption = True
|
CancelButton.DefaultCaption = True
|
||||||
TabOrder = 0
|
TabOrder = 4
|
||||||
ShowButtons = [pbOK, pbCancel, pbHelp]
|
ShowButtons = [pbOK, pbCancel, pbHelp]
|
||||||
end
|
end
|
||||||
object InfoLabel: TLabel
|
object InfoLabel: TLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 51
|
Width = 49
|
||||||
Caption = 'InfoLabel'
|
Caption = 'InfoLabel'
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
WordWrap = True
|
WordWrap = True
|
||||||
@ -43,17 +43,15 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = StartsSpeedButton
|
AnchorSideRight.Control = StartsSpeedButton
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 25
|
Height = 23
|
||||||
Top = 63
|
Top = 58
|
||||||
Width = 426
|
Width = 433
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Top = 10
|
BorderSpacing.Top = 10
|
||||||
OnChange = FilterEditChange
|
OnChange = FilterEditChange
|
||||||
OnExit = FilterEditExit
|
|
||||||
OnKeyDown = FilterEditKeyDown
|
OnKeyDown = FilterEditKeyDown
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
Text = 'FilterEdit'
|
|
||||||
end
|
end
|
||||||
object ItemsListBox: TListBox
|
object ItemsListBox: TListBox
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -63,9 +61,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = UnitLabel
|
AnchorSideBottom.Control = UnitLabel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 129
|
Height = 223
|
||||||
Top = 88
|
Top = 81
|
||||||
Width = 540
|
Width = 543
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 6
|
||||||
BorderSpacing.Right = 6
|
BorderSpacing.Right = 6
|
||||||
@ -76,15 +74,14 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
PopupMenu = PopupMenu1
|
PopupMenu = PopupMenu1
|
||||||
ScrollWidth = 538
|
ScrollWidth = 538
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
TopIndex = -1
|
|
||||||
end
|
end
|
||||||
object UnitLabel: TLabel
|
object UnitLabel: TLabel
|
||||||
AnchorSideLeft.Control = InfoLabel
|
AnchorSideLeft.Control = InfoLabel
|
||||||
AnchorSideBottom.Control = PackageLabel
|
AnchorSideBottom.Control = PackageLabel
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 218
|
Top = 305
|
||||||
Width = 52
|
Width = 50
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 1
|
BorderSpacing.Bottom = 1
|
||||||
Caption = 'UnitLabel'
|
Caption = 'UnitLabel'
|
||||||
@ -95,8 +92,8 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideBottom.Control = AddToImplementationUsesCheckBox
|
AnchorSideBottom.Control = AddToImplementationUsesCheckBox
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 234
|
Top = 321
|
||||||
Width = 74
|
Width = 72
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Bottom = 1
|
BorderSpacing.Bottom = 1
|
||||||
Caption = 'PackageLabel'
|
Caption = 'PackageLabel'
|
||||||
@ -107,38 +104,38 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideTop.Control = InfoLabel
|
AnchorSideTop.Control = InfoLabel
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 183
|
Width = 169
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
Caption = 'HideOtherProjectsCheckBox'
|
Caption = 'HideOtherProjectsCheckBox'
|
||||||
OnChange = HideOtherProjectsCheckBoxChange
|
OnChange = HideOtherProjectsCheckBoxChange
|
||||||
TabOrder = 3
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object AddToImplementationUsesCheckBox: TCheckBox
|
object AddToImplementationUsesCheckBox: TCheckBox
|
||||||
AnchorSideLeft.Control = PackageLabel
|
AnchorSideLeft.Control = PackageLabel
|
||||||
AnchorSideBottom.Control = ButtonPanel1
|
AnchorSideBottom.Control = ButtonPanel1
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 24
|
Height = 19
|
||||||
Top = 252
|
Top = 339
|
||||||
Width = 227
|
Width = 217
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
BorderSpacing.Bottom = 3
|
BorderSpacing.Bottom = 3
|
||||||
Caption = 'AddToImplementationUsesCheckBox'
|
Caption = 'AddToImplementationUsesCheckBox'
|
||||||
ParentShowHint = False
|
ParentShowHint = False
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
TabOrder = 4
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
object StartsSpeedButton: TSpeedButton
|
object StartsSpeedButton: TSpeedButton
|
||||||
AnchorSideTop.Control = FilterEdit
|
AnchorSideTop.Control = FilterEdit
|
||||||
AnchorSideRight.Control = ContainsSpeedButton
|
AnchorSideRight.Control = ContainsSpeedButton
|
||||||
AnchorSideBottom.Control = FilterEdit
|
AnchorSideBottom.Control = FilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 432
|
Left = 439
|
||||||
Height = 25
|
Height = 23
|
||||||
Top = 63
|
Top = 58
|
||||||
Width = 63
|
Width = 59
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
Caption = 'Starts with'
|
Caption = 'Starts with'
|
||||||
@ -153,9 +150,9 @@ object CodyIdentifiersDlg: TCodyIdentifiersDlg
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = FilterEdit
|
AnchorSideBottom.Control = FilterEdit
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 495
|
Left = 498
|
||||||
Height = 25
|
Height = 23
|
||||||
Top = 63
|
Top = 58
|
||||||
Width = 51
|
Width = 51
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
|
|||||||
@ -160,7 +160,6 @@ type
|
|||||||
procedure UseIdentifierClick(Sender: TObject);
|
procedure UseIdentifierClick(Sender: TObject);
|
||||||
procedure ContainsSpeedButtonClick(Sender: TObject);
|
procedure ContainsSpeedButtonClick(Sender: TObject);
|
||||||
procedure FilterEditChange(Sender: TObject);
|
procedure FilterEditChange(Sender: TObject);
|
||||||
procedure FilterEditExit(Sender: TObject);
|
|
||||||
procedure FilterEditKeyDown(Sender: TObject; var Key: Word;
|
procedure FilterEditKeyDown(Sender: TObject; var Key: Word;
|
||||||
{%H-}Shift: TShiftState);
|
{%H-}Shift: TShiftState);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
@ -180,7 +179,6 @@ type
|
|||||||
FLastHideOtherProjects: boolean;
|
FLastHideOtherProjects: boolean;
|
||||||
FIdleConnected: boolean;
|
FIdleConnected: boolean;
|
||||||
FMaxItems: integer;
|
FMaxItems: integer;
|
||||||
FNoFilterText: string;
|
|
||||||
FItems: TObjectList; // list of TCodyIdentifier
|
FItems: TObjectList; // list of TCodyIdentifier
|
||||||
FLastFilterType: TCodyIdentifierFilter;
|
FLastFilterType: TCodyIdentifierFilter;
|
||||||
procedure SetDlgAction(NewAction: TCodyIdentifierDlgAction);
|
procedure SetDlgAction(NewAction: TCodyIdentifierDlgAction);
|
||||||
@ -882,13 +880,6 @@ begin
|
|||||||
UpdateItemsList;
|
UpdateItemsList;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodyIdentifiersDlg.FilterEditExit(Sender: TObject);
|
|
||||||
begin
|
|
||||||
if FItems=nil then exit;
|
|
||||||
if GetFilterEditText='' then
|
|
||||||
FilterEdit.Text:=FNoFilterText;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCodyIdentifiersDlg.FilterEditKeyDown(Sender: TObject; var Key: Word;
|
procedure TCodyIdentifiersDlg.FilterEditKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
var
|
var
|
||||||
@ -935,7 +926,7 @@ begin
|
|||||||
ButtonPanel1.OKButton.Caption:=crsUseIdentifier;
|
ButtonPanel1.OKButton.Caption:=crsUseIdentifier;
|
||||||
ButtonPanel1.OKButton.OnClick:=@UseIdentifierClick;
|
ButtonPanel1.OKButton.OnClick:=@UseIdentifierClick;
|
||||||
FMaxItems:=40;
|
FMaxItems:=40;
|
||||||
FNoFilterText:=crsFilter;
|
FilterEdit.TextHint:=crsFilter;
|
||||||
FItems:=TObjectList.Create;
|
FItems:=TObjectList.Create;
|
||||||
HideOtherProjectsCheckBox.Checked:=true;
|
HideOtherProjectsCheckBox.Checked:=true;
|
||||||
HideOtherProjectsCheckBox.Caption:=crsHideUnitsOfOtherProjects;
|
HideOtherProjectsCheckBox.Caption:=crsHideUnitsOfOtherProjects;
|
||||||
@ -1270,8 +1261,6 @@ end;
|
|||||||
function TCodyIdentifiersDlg.GetFilterEditText: string;
|
function TCodyIdentifiersDlg.GetFilterEditText: string;
|
||||||
begin
|
begin
|
||||||
Result:=FilterEdit.Text;
|
Result:=FilterEdit.Text;
|
||||||
if Result=FNoFilterText then
|
|
||||||
Result:='';
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCodyIdentifiersDlg.FindSelectedIdentifier: TCodyIdentifier;
|
function TCodyIdentifiersDlg.FindSelectedIdentifier: TCodyIdentifier;
|
||||||
@ -1349,9 +1338,7 @@ begin
|
|||||||
UpdateCurOwnerOfUnit;
|
UpdateCurOwnerOfUnit;
|
||||||
UpdateGeneralInfo;
|
UpdateGeneralInfo;
|
||||||
FLastFilter:='...'; // force one update
|
FLastFilter:='...'; // force one update
|
||||||
if CurIdentifier='' then
|
if CurIdentifier<>'' then
|
||||||
FilterEdit.Text:=FNoFilterText
|
|
||||||
else
|
|
||||||
FilterEdit.Text:=CurIdentifier;
|
FilterEdit.Text:=CurIdentifier;
|
||||||
IdleConnected:=true;
|
IdleConnected:=true;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user