mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 20:43:46 +02:00
IDE: fixed case sensitivity of combobox history lists
git-svn-id: trunk@29154 -
This commit is contained in:
parent
b176e79736
commit
c290e9f652
@ -110,7 +110,7 @@ begin
|
||||
|
||||
if OpenDialog.Execute then begin
|
||||
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
|
||||
SetComboBoxText(cmbDebuggerPath,AFilename);
|
||||
SetComboBoxText(cmbDebuggerPath,AFilename,cstFilename);
|
||||
CheckExecutable(FOldDebuggerPathAndParams,cmbDebuggerPath.Text,
|
||||
lisEnvOptDlgInvalidDebuggerFilename,
|
||||
lisEnvOptDlgInvalidDebuggerFilenameMsg);
|
||||
@ -145,8 +145,8 @@ begin
|
||||
|
||||
SetDebuggerClass(CurClass);
|
||||
if FCurDebuggerClass = nil
|
||||
then SetComboBoxText(cmbDebuggerType, '(none)')
|
||||
else SetComboBoxText(cmbDebuggerType, FCurDebuggerClass.Caption);
|
||||
then SetComboBoxText(cmbDebuggerType, '(none)',cstCaseInsensitive)
|
||||
else SetComboBoxText(cmbDebuggerType, FCurDebuggerClass.Caption,cstCaseInsensitive);
|
||||
|
||||
txtAdditionalPath.Text:=EnvironmentOptions.DebuggerSearchPath;
|
||||
end;
|
||||
@ -196,7 +196,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
SetComboBoxText(cmbDebuggerPath,Filename,20);
|
||||
SetComboBoxText(cmbDebuggerPath,Filename,cstFilename,20);
|
||||
|
||||
// get ptoperties
|
||||
PropertyGrid.Selection.Clear;
|
||||
|
@ -586,7 +586,7 @@ begin
|
||||
ComboBox:=BuildWorkDirCombobox
|
||||
else if Sender=RunBrowseWorkDirButton then
|
||||
ComboBox:=RunWorkDirCombobox;
|
||||
SetComboBoxText(ComboBox,NewFilename);
|
||||
SetComboBoxText(ComboBox,NewFilename,cstFilename);
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
|
@ -216,15 +216,15 @@ begin
|
||||
bakUserDefinedAddExt: BakProjTypeRadioGroup.ItemIndex:=4;
|
||||
bakSameName: BakProjTypeRadioGroup.ItemIndex:=5;
|
||||
end;
|
||||
SetComboBoxText(BakProjAddExtComboBox,AdditionalExtension);
|
||||
SetComboBoxText(BakProjAddExtComboBox,AdditionalExtension,cstFilename);
|
||||
if MaxCounter<=0 then
|
||||
SetComboBoxText(BakProjMaxCounterComboBox,BakMaxCounterInfiniteTxt)
|
||||
SetComboBoxText(BakProjMaxCounterComboBox,BakMaxCounterInfiniteTxt,cstCaseInsensitive)
|
||||
else
|
||||
SetComboBoxText(BakProjMaxCounterComboBox,IntToStr(MaxCounter));
|
||||
SetComboBoxText(BakProjMaxCounterComboBox,IntToStr(MaxCounter),cstCaseInsensitive);
|
||||
if SubDirectory<>'' then
|
||||
SetComboBoxText(BakProjSubDirComboBox,SubDirectory)
|
||||
SetComboBoxText(BakProjSubDirComboBox,SubDirectory,cstFilename)
|
||||
else
|
||||
SetComboBoxText(BakProjSubDirComboBox,dlgBakNoSubDirectory);
|
||||
SetComboBoxText(BakProjSubDirComboBox,dlgBakNoSubDirectory,cstFilename);
|
||||
end;
|
||||
BakTypeRadioGroupClick(BakProjTypeRadioGroup);
|
||||
with BackupInfoOtherFiles do
|
||||
@ -237,15 +237,15 @@ begin
|
||||
bakUserDefinedAddExt: BakOtherTypeRadioGroup.ItemIndex:=4;
|
||||
bakSameName: BakOtherTypeRadioGroup.ItemIndex:=5;
|
||||
end;
|
||||
SetComboBoxText(BakOtherAddExtComboBox,AdditionalExtension);
|
||||
SetComboBoxText(BakOtherAddExtComboBox,AdditionalExtension,cstFilename);
|
||||
if MaxCounter<=0 then
|
||||
SetComboBoxText(BakOtherMaxCounterComboBox,BakMaxCounterInfiniteTxt)
|
||||
SetComboBoxText(BakOtherMaxCounterComboBox,BakMaxCounterInfiniteTxt,cstCaseInsensitive)
|
||||
else
|
||||
SetComboBoxText(BakOtherMaxCounterComboBox,IntToStr(MaxCounter));
|
||||
SetComboBoxText(BakOtherMaxCounterComboBox,IntToStr(MaxCounter),cstCaseInsensitive);
|
||||
if SubDirectory<>'' then
|
||||
SetComboBoxText(BakOtherSubDirComboBox,SubDirectory)
|
||||
SetComboBoxText(BakOtherSubDirComboBox,SubDirectory,cstFilename)
|
||||
else
|
||||
SetComboBoxText(BakOtherSubDirComboBox,dlgBakNoSubDirectory);
|
||||
SetComboBoxText(BakOtherSubDirComboBox,dlgBakNoSubDirectory,cstFilename);
|
||||
end;
|
||||
BakTypeRadioGroupClick(BakOtherTypeRadioGroup);
|
||||
end;
|
||||
|
@ -170,7 +170,7 @@ begin
|
||||
AutoSaveEditorFilesCheckBox.Checked:=AutoSaveEditorFiles;
|
||||
AutoSaveProjectCheckBox.Checked:=AutoSaveProject;
|
||||
SetComboBoxText(AutoSaveIntervalInSecsComboBox
|
||||
,IntToStr(AutoSaveIntervalInSecs));
|
||||
,IntToStr(AutoSaveIntervalInSecs),cstCaseInsensitive);
|
||||
|
||||
// hints
|
||||
CheckDiskChangesWithLoadingCheckBox.Checked:=
|
||||
|
@ -701,7 +701,7 @@ begin
|
||||
if Box.Text <> GetCurFileExtensions(FCurrentHighlighter.LanguageName) then
|
||||
begin
|
||||
SetCurFileExtensions(FCurrentHighlighter.LanguageName, Box.Text);
|
||||
SetComboBoxText(Box, Box.Text);
|
||||
SetComboBoxText(Box, Box.Text,cstCaseInsensitive);
|
||||
end;
|
||||
//DebugLn(['TEditorOptionsForm.ComboBoxOnExit Box.Text="',Box.Text,'" Now="',GetCurFileExtensions(FCurrentHighlighter.LanguageName),'" FCurrentHighlighter.LanguageName=',FCurrentHighlighter.LanguageName]);
|
||||
end
|
||||
@ -1234,7 +1234,8 @@ begin
|
||||
GetColorSchemeForLang(EditorOpts.HighlighterList
|
||||
[CurLanguageID].SynClass.GetLanguageName));
|
||||
SetColorSchemeItem(GetColorSchemeForLang(FCurrentHighlighter.LanguageName));
|
||||
SetComboBoxText(FileExtensionsComboBox, GetCurFileExtensions(FCurrentHighlighter.LanguageName));
|
||||
SetComboBoxText(FileExtensionsComboBox,
|
||||
GetCurFileExtensions(FCurrentHighlighter.LanguageName),cstFilename);
|
||||
end;
|
||||
end;
|
||||
LanguageButton.Caption := Language;
|
||||
@ -1403,7 +1404,7 @@ begin
|
||||
with FileExtensionsComboBox, GeneralPage do
|
||||
if CurLanguageID >= 0 then
|
||||
SetComboBoxText(FileExtensionsComboBox,
|
||||
HighlighterList[CurLanguageID].FileExtensions);
|
||||
HighlighterList[CurLanguageID].FileExtensions,cstFilename);
|
||||
|
||||
SetCurrentScheme(TPreviewPasSyn, GetColorSchemeForLang(TPreviewPasSyn.GetLanguageName));
|
||||
CurLanguageID := HighlighterList.FindByClass(TCustomSynClass(FCurrentHighlighter.ClassType));
|
||||
|
@ -95,8 +95,8 @@ begin
|
||||
if PreviewEdits[a] <> nil then
|
||||
PreviewEdits[a].Font.Assign(TFontDialog(Sender).Font);
|
||||
|
||||
SetComboBoxText(EditorFontComboBox, DisplayPreview.Font.Name);
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(DisplayPreview.Font.Height));
|
||||
SetComboBoxText(EditorFontComboBox, DisplayPreview.Font.Name,cstCaseInsensitive);
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(DisplayPreview.Font.Height),cstCaseInsensitive);
|
||||
end;
|
||||
|
||||
function TEditorDisplayOptionsFrame.DoSynEditMouse(var AnInfo: TSynEditMouseActionInfo;
|
||||
@ -146,7 +146,7 @@ begin
|
||||
begin
|
||||
NewVal := StrToIntDef(EditorFontHeightComboBox.Text, DisplayPreview.Font.Height);
|
||||
RepairEditorFontHeight(NewVal);
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal),cstCaseInsensitive);
|
||||
with GeneralPage do
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> nil then
|
||||
@ -156,7 +156,7 @@ begin
|
||||
if Sender = ExtraCharSpacingComboBox then
|
||||
begin
|
||||
NewVal := StrToIntDef(ExtraCharSpacingComboBox.Text, DisplayPreview.ExtraCharSpacing);
|
||||
SetComboBoxText(ExtraCharSpacingComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(ExtraCharSpacingComboBox, IntToStr(NewVal),cstCaseInsensitive);
|
||||
with GeneralPage do
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> Nil then
|
||||
@ -166,7 +166,7 @@ begin
|
||||
if Sender = ExtraLineSpacingComboBox then
|
||||
begin
|
||||
NewVal := StrToIntDef(ExtraLineSpacingComboBox.Text, DisplayPreview.ExtraLineSpacing);
|
||||
SetComboBoxText(ExtraLineSpacingComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(ExtraLineSpacingComboBox, IntToStr(NewVal),cstCaseInsensitive);
|
||||
with GeneralPage do
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> Nil then
|
||||
@ -176,7 +176,7 @@ begin
|
||||
if Sender = RightMarginComboBox then
|
||||
begin
|
||||
NewVal := StrToIntDef(RightMarginComboBox.Text, DisplayPreview.RightEdge);
|
||||
SetComboBoxText(RightMarginComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(RightMarginComboBox, IntToStr(NewVal),cstCaseInsensitive);
|
||||
with GeneralPage do
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> nil then
|
||||
@ -318,11 +318,11 @@ begin
|
||||
VisibleGutterCheckBox.Checked := VisibleGutter;
|
||||
ShowLineNumbersCheckBox.Checked := ShowLineNumbers;
|
||||
VisibleRightMarginCheckBox.Checked := VisibleRightMargin;
|
||||
SetComboBoxText(RightMarginComboBox, IntToStr(RightMargin));
|
||||
SetComboBoxText(EditorFontComboBox, EditorFont);
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(EditorFontHeight));
|
||||
SetComboBoxText(ExtraCharSpacingComboBox, IntToStr(ExtraCharSpacing));
|
||||
SetComboBoxText(ExtraLineSpacingComboBox, IntToStr(ExtraLineSpacing));
|
||||
SetComboBoxText(RightMarginComboBox, IntToStr(RightMargin),cstCaseInsensitive);
|
||||
SetComboBoxText(EditorFontComboBox, EditorFont,cstCaseInsensitive);
|
||||
SetComboBoxText(EditorFontHeightComboBox, IntToStr(EditorFontHeight),cstCaseInsensitive);
|
||||
SetComboBoxText(ExtraCharSpacingComboBox, IntToStr(ExtraCharSpacing),cstCaseInsensitive);
|
||||
SetComboBoxText(ExtraLineSpacingComboBox, IntToStr(ExtraLineSpacing),cstCaseInsensitive);
|
||||
DisableAntialiasingCheckBox.Checked := DisableAntialiasing;
|
||||
end;
|
||||
|
||||
|
@ -188,14 +188,14 @@ var
|
||||
begin
|
||||
with AOptions as TEditorOptions do
|
||||
begin
|
||||
SetComboBoxText(BlockIndentComboBox, IntToStr(BlockIndent));
|
||||
SetComboBoxText(TabWidthsComboBox, IntToStr(TabWidth));
|
||||
SetComboBoxText(BlockIndentComboBox, IntToStr(BlockIndent), cstCaseInsensitive);
|
||||
SetComboBoxText(TabWidthsComboBox, IntToStr(TabWidth), cstCaseInsensitive);
|
||||
BlockIndentTypeComboBox.ItemIndex := ord(BlockIndentType);
|
||||
|
||||
// undo
|
||||
UndoAfterSaveCheckBox.Checked := UndoAfterSave;
|
||||
GroupUndoCheckBox.Checked := eoGroupUndo in SynEditOptions;
|
||||
SetComboBoxText(UndoLimitComboBox, IntToStr(UndoLimit));
|
||||
SetComboBoxText(UndoLimitComboBox, IntToStr(UndoLimit), cstCaseInsensitive);
|
||||
|
||||
// scroll
|
||||
HalfPageScrollCheckBox.Checked := eoHalfPageScroll in SynEditOptions;
|
||||
@ -405,7 +405,7 @@ begin
|
||||
if Sender = BlockIndentComboBox then
|
||||
begin
|
||||
NewVal := StrToIntDef(BlockIndentComboBox.Text, PreviewEdits[1].BlockIndent);
|
||||
SetComboBoxText(BlockIndentComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(BlockIndentComboBox, IntToStr(NewVal), cstCaseInsensitive);
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> nil then
|
||||
PreviewEdits[a].BlockIndent := NewVal;
|
||||
@ -414,7 +414,7 @@ begin
|
||||
if Sender = TabWidthsComboBox then
|
||||
begin
|
||||
NewVal := StrToIntDef(TabWidthsComboBox.Text, PreviewEdits[1].TabWidth);
|
||||
SetComboBoxText(TabWidthsComboBox, IntToStr(NewVal));
|
||||
SetComboBoxText(TabWidthsComboBox, IntToStr(NewVal), cstCaseInsensitive);
|
||||
for a := Low(PreviewEdits) to High(PreviewEdits) do
|
||||
if PreviewEdits[a] <> nil then
|
||||
PreviewEdits[a].TabWidth := NewVal;
|
||||
|
@ -110,13 +110,13 @@ begin
|
||||
|
||||
if Sender=CompilerPathButton then begin
|
||||
// check compiler filename
|
||||
SetComboBoxText(CompilerPathComboBox,AFilename);
|
||||
SetComboBoxText(CompilerPathComboBox,AFilename,cstFilename);
|
||||
CheckExecutable(FOldCompilerFilename,CompilerPathComboBox.Text,
|
||||
lisEnvOptDlgInvalidCompilerFilename,
|
||||
lisEnvOptDlgInvalidCompilerFilenameMsg);
|
||||
end else if Sender=MakePathButton then begin
|
||||
// check make filename
|
||||
SetComboBoxText(MakePathComboBox,AFilename);
|
||||
SetComboBoxText(MakePathComboBox,AFilename,cstFilename);
|
||||
CheckExecutable(FOldMakeFilename,MakePathComboBox.Text,
|
||||
lisEnvOptDlgInvalidMakeFilename,
|
||||
lisEnvOptDlgInvalidMakeFilenameMsg);
|
||||
@ -141,7 +141,7 @@ begin
|
||||
OpenDialog.Filter:='FPC message file (*.msg)|*.msg|Any file|'+AllFilesMask;
|
||||
if OpenDialog.Execute then begin
|
||||
AFilename:=CleanAndExpandFilename(OpenDialog.Filename);
|
||||
SetComboBoxText(CompilerMessagesComboBox,AFilename);
|
||||
SetComboBoxText(CompilerMessagesComboBox,AFilename,cstFilename);
|
||||
end;
|
||||
InputHistories.StoreFileDialogSettings(OpenDialog);
|
||||
finally
|
||||
@ -173,15 +173,15 @@ begin
|
||||
|
||||
if Sender=LazarusDirButton then begin
|
||||
// check lazarus directory
|
||||
SetComboBoxText(LazarusDirComboBox,ADirectoryName);
|
||||
SetComboBoxText(LazarusDirComboBox,ADirectoryName,cstFilename);
|
||||
CheckLazarusDir;
|
||||
end else if Sender=FPCSourceDirButton then begin
|
||||
// check fpc source directory
|
||||
SetComboBoxText(FPCSourceDirComboBox,ADirectoryName);
|
||||
SetComboBoxText(FPCSourceDirComboBox,ADirectoryName,cstFilename);
|
||||
IsFPCSourceDir;
|
||||
end else if Sender=TestBuildDirButton then begin
|
||||
// check test directory
|
||||
SetComboBoxText(TestBuildDirComboBox,ADirectoryName);
|
||||
SetComboBoxText(TestBuildDirComboBox,ADirectoryName,cstFilename);
|
||||
CheckTestDir;
|
||||
end;
|
||||
|
||||
@ -274,7 +274,7 @@ begin
|
||||
begin
|
||||
LazarusDirComboBox.Items.Assign(LazarusDirHistory);
|
||||
FOldLazarusDir:=LazarusDirectory;
|
||||
SetComboBoxText(LazarusDirComboBox,LazarusDirectory,MaxComboBoxCount);
|
||||
SetComboBoxText(LazarusDirComboBox,LazarusDirectory,cstFilename,MaxComboBoxCount);
|
||||
with CompilerPathComboBox do
|
||||
begin
|
||||
Items.BeginUpdate;
|
||||
@ -285,22 +285,22 @@ begin
|
||||
end;
|
||||
|
||||
FOldCompilerFilename:=CompilerFilename;
|
||||
SetComboBoxText(CompilerPathComboBox,CompilerFilename,MaxComboBoxCount);
|
||||
SetComboBoxText(CompilerPathComboBox,CompilerFilename,cstFilename,MaxComboBoxCount);
|
||||
FPCSourceDirComboBox.Items.Assign(FPCSourceDirHistory);
|
||||
FOldFPCSourceDir:=FPCSourceDirectory;
|
||||
SetComboBoxText(FPCSourceDirComboBox,FPCSourceDirectory,MaxComboBoxCount);
|
||||
SetComboBoxText(FPCSourceDirComboBox,FPCSourceDirectory,cstFilename,MaxComboBoxCount);
|
||||
MakePathComboBox.Items.Assign(MakeFileHistory);
|
||||
FOldMakeFilename:=MakeFilename;
|
||||
SetComboBoxText(MakePathComboBox,MakeFilename,MaxComboBoxCount);
|
||||
SetComboBoxText(MakePathComboBox,MakeFilename,cstFilename,MaxComboBoxCount);
|
||||
TestBuildDirComboBox.Items.Assign(TestBuildDirHistory);
|
||||
FOldTestDir:=TestBuildDirectory;
|
||||
SetComboBoxText(TestBuildDirComboBox,TestBuildDirectory,MaxComboBoxCount);
|
||||
SetComboBoxText(TestBuildDirComboBox,TestBuildDirectory,cstFilename,MaxComboBoxCount);
|
||||
CompilerMessagesComboBox.Items.Assign(CompilerMessagesFileHistory);
|
||||
SetComboBoxText(CompilerMessagesComboBox,CompilerMessagesFilename,MaxComboBoxCount);
|
||||
SetComboBoxText(CompilerMessagesComboBox,CompilerMessagesFilename,cstFilename,MaxComboBoxCount);
|
||||
|
||||
// recent files and directories
|
||||
SetComboBoxText(MaxRecentOpenFilesComboBox,IntToStr(MaxRecentOpenFiles));
|
||||
SetComboBoxText(MaxRecentProjectFilesComboBox,IntToStr(MaxRecentProjectFiles));
|
||||
SetComboBoxText(MaxRecentOpenFilesComboBox,IntToStr(MaxRecentOpenFiles),cstCaseInsensitive);
|
||||
SetComboBoxText(MaxRecentProjectFilesComboBox,IntToStr(MaxRecentProjectFiles),cstCaseInsensitive);
|
||||
OpenLastProjectAtStartCheckBox.Checked:=OpenLastProjectAtStart;
|
||||
ShowCompileDialogCheckBox.Checked:=ShowCompileDialog;
|
||||
AutoCloseCompileDialogCheckBox.Checked:=AutoCloseCompileDialog;
|
||||
|
@ -251,9 +251,18 @@ 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);
|
||||
type
|
||||
TCmpStrType = (
|
||||
cstCaseSensitive,
|
||||
cstCaseInsensitive,
|
||||
cstFilename
|
||||
);
|
||||
|
||||
function IndexInStringList(List: TStrings; Cmp: TCmpStrType; s: string): integer;
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String;
|
||||
Cmp: TCmpStrType);
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String;
|
||||
Cmp: TCmpStrType; MaxCount: integer);
|
||||
function CheckGroupItemChecked(CheckGroup: TCheckGroup; const Caption: string): Boolean;
|
||||
|
||||
implementation
|
||||
@ -2657,33 +2666,49 @@ begin
|
||||
@ComparePAnsiStringWithStrToStrItemFilename);
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox: TComboBox; const AText: String);
|
||||
function IndexInStringList(List: TStrings; Cmp: TCmpStrType; s: string
|
||||
): integer;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i:=0 to List.Count-1 do begin
|
||||
case Cmp of
|
||||
cstCaseSensitive: if List[i]=s then exit(i);
|
||||
cstCaseInsensitive: if AnsiCompareText(List[i],s)=0 then exit(i);
|
||||
cstFilename: if CompareFilenames(List[i],s)=0 then exit(i);
|
||||
end;
|
||||
end;
|
||||
Result:=-1;
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox: TComboBox; const AText: String;
|
||||
Cmp: TCmpStrType);
|
||||
var
|
||||
a: integer;
|
||||
begin
|
||||
a:=AComboBox.Items.IndexOf(AText);
|
||||
a:=IndexInStringList(AComboBox.Items,Cmp,AText);
|
||||
if a>=0 then
|
||||
AComboBox.ItemIndex:=a
|
||||
else
|
||||
begin
|
||||
AComboBox.Items.Add(AText);
|
||||
AComboBox.ItemIndex := AComboBox.Items.IndexOf(AText);
|
||||
AComboBox.ItemIndex := IndexInStringList(AComboBox.Items,Cmp,AText);
|
||||
end;
|
||||
AComboBox.Text := AText;
|
||||
end;
|
||||
|
||||
procedure SetComboBoxText(AComboBox:TComboBox; const AText: String;
|
||||
MaxCount: integer);
|
||||
Cmp: TCmpStrType; MaxCount: integer);
|
||||
var
|
||||
a: integer;
|
||||
begin
|
||||
a := AComboBox.Items.IndexOf(AText);
|
||||
a := IndexInStringList(AComboBox.Items,Cmp,AText);
|
||||
if a >= 0 then
|
||||
AComboBox.ItemIndex := a
|
||||
else
|
||||
begin
|
||||
AComboBox.Items.Insert(0,AText);
|
||||
AComboBox.ItemIndex:=AComboBox.Items.IndexOf(AText);
|
||||
AComboBox.ItemIndex:=IndexInStringList(AComboBox.Items,Cmp,AText);
|
||||
if MaxCount<2 then MaxCount:=2;
|
||||
while AComboBox.Items.Count>MaxCount do
|
||||
AComboBox.Items.Delete(AComboBox.Items.Count-1);
|
||||
|
Loading…
Reference in New Issue
Block a user