mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-23 21:59:22 +02:00
select index of item in list, if text occurs in list
git-svn-id: trunk@6780 -
This commit is contained in:
parent
ac8ba31fd1
commit
aa256339b2
@ -693,6 +693,25 @@ begin
|
|||||||
Result:=FItemIndex;
|
Result:=FItemIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{------------------------------------------------------------------------------
|
||||||
|
Method: TCustomComboBox.RealSetText
|
||||||
|
Params: AValue -
|
||||||
|
Returns: nothing
|
||||||
|
|
||||||
|
If the text AValue occurs in the list of strings, then sets the itemindex,
|
||||||
|
otherwise does the default action
|
||||||
|
------------------------------------------------------------------------------}
|
||||||
|
procedure TCustomComboBox.RealSetText(const AValue: TCaption);
|
||||||
|
var
|
||||||
|
I: integer;
|
||||||
|
begin
|
||||||
|
I := FItems.IndexOf(AValue);
|
||||||
|
if I >= 0 then
|
||||||
|
ItemIndex := I
|
||||||
|
else
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TCustomComboBox.SetItemIndex
|
Method: TCustomComboBox.SetItemIndex
|
||||||
Params: Val -
|
Params: Val -
|
||||||
@ -778,6 +797,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.54 2005/02/11 16:26:26 micha
|
||||||
|
select index of item in list, if text occurs in list
|
||||||
|
|
||||||
Revision 1.53 2005/02/06 20:43:57 micha
|
Revision 1.53 2005/02/06 20:43:57 micha
|
||||||
remember text of combobox in case one sets itemindex (fixes bug 536)
|
remember text of combobox in case one sets itemindex (fixes bug 536)
|
||||||
|
|
||||||
|
@ -281,6 +281,7 @@ type
|
|||||||
procedure SetSelText(const Val: string); virtual;
|
procedure SetSelText(const Val: string); virtual;
|
||||||
procedure SetSorted(Val: boolean); virtual;
|
procedure SetSorted(Val: boolean); virtual;
|
||||||
procedure SetStyle(Val: TComboBoxStyle); virtual;
|
procedure SetStyle(Val: TComboBoxStyle); virtual;
|
||||||
|
procedure RealSetText(const AValue: TCaption); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
|
|
||||||
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
|
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8;
|
||||||
@ -1217,6 +1218,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.192 2005/02/11 16:26:26 micha
|
||||||
|
select index of item in list, if text occurs in list
|
||||||
|
|
||||||
Revision 1.191 2005/02/04 15:36:50 mattias
|
Revision 1.191 2005/02/04 15:36:50 mattias
|
||||||
published TComboBox.ItemIndex from Sergios
|
published TComboBox.ItemIndex from Sergios
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user