mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-25 23:39:03 +02:00
ide: cleanup
git-svn-id: trunk@17062 -
This commit is contained in:
parent
d0a9ecd1b6
commit
7c43bd88d8
@ -584,7 +584,7 @@ begin
|
||||
ComboBox:=BuildWorkDirCombobox
|
||||
else if Sender=RunBrowseWorkDirButton then
|
||||
ComboBox:=RunWorkDirCombobox;
|
||||
EnvironmentOpts.SetComboBoxText(ComboBox,NewFilename);
|
||||
SetComboBoxText(ComboBox,NewFilename);
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
|
@ -34,12 +34,9 @@ uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, LCLProc, Forms, Controls, Buttons, GraphType,
|
||||
Graphics, ExtCtrls, StdCtrls, Spin, FileUtil, LResources, Dialogs,
|
||||
Laz_XMLCfg,
|
||||
ObjectInspector, IDEWindowIntf,
|
||||
LazarusIDEStrConsts, TransferMacros, LazConf, ExtToolDialog, IDEProcs,
|
||||
IDEOptionDefs, InputHistory, EditorOptions, IDETranslations, ButtonPanel;
|
||||
Classes, SysUtils, Graphics, Controls, Forms, LCLProc, FileUtil, Dialogs,
|
||||
Laz_XMLCfg, IDEProcs, LazarusIDEStrConsts, IDETranslations, LazConf,
|
||||
ObjectInspector, IDEOptionDefs, IDEWindowIntf, ExtToolDialog, TransferMacros;
|
||||
|
||||
const
|
||||
EnvOptsVersion: integer = 106;
|
||||
@ -479,10 +476,6 @@ function CheckDirPathExists(const Dir,
|
||||
function SimpleDirectoryCheck(const OldDir, NewDir,
|
||||
NotFoundErrMsg: string; out StopChecking: boolean): boolean;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString);
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString;
|
||||
MaxCount: integer);
|
||||
|
||||
procedure RegisterEnvironmentOptionsEditor(AEditor: TAbstractOptionsFrameClass);
|
||||
procedure EnumEnvironmentOptionsEditors(ACallBack: TEnvironmentOptionsEditorGetProc);
|
||||
|
||||
@ -616,36 +609,6 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String);
|
||||
var a:integer;
|
||||
begin
|
||||
a:=AComboBox.Items.IndexOf(AText);
|
||||
if a>=0 then
|
||||
AComboBox.ItemIndex:=a
|
||||
else begin
|
||||
AComboBox.Items.Add(AText);
|
||||
AComboBox.ItemIndex:=AComboBox.Items.IndexOf(AText);
|
||||
end;
|
||||
AComboBox.Text:=AText;
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String;
|
||||
MaxCount: integer);
|
||||
var a:integer;
|
||||
begin
|
||||
a:=AComboBox.Items.IndexOf(AText);
|
||||
if a>=0 then
|
||||
AComboBox.ItemIndex:=a
|
||||
else begin
|
||||
AComboBox.Items.Insert(0,AText);
|
||||
AComboBox.ItemIndex:=AComboBox.Items.IndexOf(AText);
|
||||
if MaxCount<2 then MaxCount:=2;
|
||||
while AComboBox.Items.Count>MaxCount do
|
||||
AComboBox.Items.Delete(AComboBox.Items.Count-1);
|
||||
end;
|
||||
AComboBox.Text:=AText;
|
||||
end;
|
||||
|
||||
{ TEnvironmentOptions }
|
||||
|
||||
constructor TEnvironmentOptions.Create;
|
||||
|
@ -31,9 +31,6 @@ unit EnvironmentOpts_Dlg;
|
||||
interface
|
||||
|
||||
uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, Controls, Forms, LResources, ComCtrls, ButtonPanel,
|
||||
EnvironmentOpts, LazarusIDEStrConsts, IDEWindowIntf;
|
||||
|
||||
|
@ -26,7 +26,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, ExtCtrls,
|
||||
EnvironmentOpts, LazarusIDEStrConsts;
|
||||
EnvironmentOpts, LazarusIDEStrConsts, IDEProcs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -26,7 +26,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, Dialogs, LCLProc,
|
||||
EnvironmentOpts, LazarusIDEStrConsts, IDETranslations, InputHistory;
|
||||
EnvironmentOpts, LazarusIDEStrConsts, IDETranslations, InputHistory, IDEProcs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -26,7 +26,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, Dialogs, Controls,
|
||||
EnvironmentOpts, LazarusIDEStrConsts, InputHistory, LazConf;
|
||||
EnvironmentOpts, LazarusIDEStrConsts, InputHistory, LazConf, IDEProcs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -26,7 +26,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, Dialogs,
|
||||
EnvironmentOpts, LazarusIDEStrConsts;
|
||||
EnvironmentOpts, LazarusIDEStrConsts, IDEProcs;
|
||||
|
||||
type
|
||||
|
||||
|
@ -31,7 +31,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Laz_XMLCfg, FileUtil, LCLProc, AvgLvlTree,
|
||||
FileProcs, LazConf;
|
||||
FileProcs, LazConf, StdCtrls;
|
||||
|
||||
type
|
||||
// comments
|
||||
@ -232,6 +232,9 @@ function CompareStringToStringItemsFilename(Data1, Data2: Pointer): integer;
|
||||
function ComparePAnsiStringWithStrToStrItemFilename(Key, Data: Pointer): Integer;
|
||||
function CreateFilenameToStringTree: TStringToStringTree;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString);
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString;
|
||||
MaxCount: integer);
|
||||
|
||||
implementation
|
||||
|
||||
@ -2571,5 +2574,39 @@ begin
|
||||
@ComparePAnsiStringWithStrToStrItemFilename);
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox: TComboBox; const AText: String);
|
||||
var
|
||||
a: integer;
|
||||
begin
|
||||
a:=AComboBox.Items.IndexOf(AText);
|
||||
if a>=0 then
|
||||
AComboBox.ItemIndex:=a
|
||||
else
|
||||
begin
|
||||
AComboBox.Items.Add(AText);
|
||||
AComboBox.ItemIndex := AComboBox.Items.IndexOf(AText);
|
||||
end;
|
||||
AComboBox.Text := AText;
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String;
|
||||
MaxCount: integer);
|
||||
var
|
||||
a: integer;
|
||||
begin
|
||||
a := AComboBox.Items.IndexOf(AText);
|
||||
if a >= 0 then
|
||||
AComboBox.ItemIndex := a
|
||||
else
|
||||
begin
|
||||
AComboBox.Items.Insert(0,AText);
|
||||
AComboBox.ItemIndex:=AComboBox.Items.IndexOf(AText);
|
||||
if MaxCount<2 then MaxCount:=2;
|
||||
while AComboBox.Items.Count>MaxCount do
|
||||
AComboBox.Items.Delete(AComboBox.Items.Count-1);
|
||||
end;
|
||||
AComboBox.Text := AText;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user