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