FGX.ComboBox.TfgCustomComboBox: различия между версиями

Материал из FGX Native Докуметации
Перейти к навигации Перейти к поиску
(summary)
(summary)
(не показаны 22 промежуточные версии этого же участника)
Строка 1: Строка 1:
* [[ FGX.Control.TfgControl | Вверх к родителю: TfgControl ]]
+
* [[ FGX.Controls.TfgControl | Вверх к родителю: TfgControl ]]
 +
* [[ FGX.ComboBox | К модулю: FGX.ComboBox ]]
  
 
Delphi
 
Delphi
  
<syntaxhighlight lang="Delphi">TfgCustomComboBox = class (TfgControl, IFGXTapSupported, IFGXNotificationObserver, IFGXNotificationObservable)</syntaxhighlight>
+
<syntaxhighlight lang="Delphi">TfgCustomComboBox = class (TfgControl, IFGXContainer)</syntaxhighlight>
  
Известные прямые наследники:
+
<p class="class-inheritance"><span class="type-border">[[System.Classes.TComponent|TComponent]]</span> -> <span class="type-border">[[FGX.Controls.TfgControl|TfgControl]]</span> -> <span class="type-border">[[FGX.ComboBox.TfgCustomComboBox|TfgCustomComboBox]]</span></p>
 +
 
 +
Прямые наследники:
 
[[FGX.ComboBox.TfgComboBox|TfgComboBox]]
 
[[FGX.ComboBox.TfgComboBox|TfgComboBox]]
  
Строка 11: Строка 14:
  
 
<span style="color:gray">Описание отсутствует.</span>
 
<span style="color:gray">Описание отсутствует.</span>
 +
== Конструкторы ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">constructor</syntaxhighlight> || <code>Create(AOwner: [[TComponent]])</code>
 +
<span style="color:gray">Описание отсутствует.</span>
 +
|}
 +
 +
== Методы ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">procedure</syntaxhighlight> || <code lang="Delphi">AddItem(const AItem: [[FGX.ComboBox.TfgCustomComboBoxItem|TfgCustomComboBoxItem]])</code>
 +
<p>Добавляет произвольный элемент комбобокса.</p>
 +
|-
 +
| <syntaxhighlight lang="Delphi">function</syntaxhighlight> || <code lang="Delphi">AddTextItem(const AText: [[string]]): [[FGX.ComboBox.TfgComboBoxTextItem|TfgComboBoxTextItem]]</code>
 +
<p>Добавляет текстовый элемент комбобокса. Он отображает только текст.</p>
 +
|-
 +
| <syntaxhighlight lang="Delphi">function</syntaxhighlight> || <code lang="Delphi">DeleteItem(const AItem: [[FGX.ComboBox.TfgCustomComboBoxItem|TfgCustomComboBoxItem]]): [[Boolean]]</code>
 +
 +
<p>Удаляет элемент по указанному инстансу <i>AItem</i> .</p><div class="info">Не допускается указывать nil. Если элемент был найден среди элементов контрола и удален, то вернет True, в противном случае - False.</div>
 +
|-
 +
| <syntaxhighlight lang="Delphi">function</syntaxhighlight> || <code lang="Delphi">DeleteItem(const AIndex: [[Integer]]): [[Boolean]]</code>
 +
 +
<p>Удаляет элемент по указанному индексу <i>AIndex</i> .</p><div class="info">Не допускается указывать индекс не существующего элемента страницы.</div>
 +
|-
 +
| <syntaxhighlight lang="Delphi">procedure</syntaxhighlight> || <code lang="Delphi">Clear()</code>
 +
<p>Удаляет все элементы выпадающего списка.</p>
 +
|-
 +
| <syntaxhighlight lang="Delphi">procedure</syntaxhighlight> || <code lang="Delphi">Open()</code>
 +
<p>Программно открывает выпадающий список.</p>
 +
|}
 +
 +
== Свойства ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>ActiveItem: [[FGX.ComboBox.TfgCustomComboBoxItem|TfgCustomComboBoxItem]]</code>
 +
 +
<p>Активный/выбранный элмент ( <i>ItemIndex</i> ).</p><div class="info">Если ни один элемент не выбран, то вернет nil.</div>
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>Items[Index]: [[FGX.ComboBox.TfgCustomComboBoxItem|TfgCustomComboBoxItem]]</code>
 +
 +
<p>Возвращает элемент по указанному индексу.</p><div class="info">Не допускается указывать индекс не существующего элемента.</div>
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>ItemsCount: [[Integer]]</code>
 +
<p>Количество элементов списка.</p>
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>Text: [[string]]</code>
 +
 +
<p>Возвращает текст текущего элемента, если элемент поддерживает текст (IFGXTextSupported).</p><div class="info">Если текущего элемента нет или он не поддерживает текст, то вернет пустую строку.</div>
 +
|-
 +
| <syntaxhighlight lang="Delphi">property</syntaxhighlight> || <code>ItemIndex: [[Integer]]</code>
 +
<p>Индекс выбранного элемента выпадающего списка.</p>
 +
|}
 +
 +
== События ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">event</syntaxhighlight> || <code>OnChanged: [[TNotifyEvent]]</code>
 +
<p>Срабатывает, когда пользователь выбрал другой элемент списка.</p>
 +
|-
 +
| <syntaxhighlight lang="Delphi">event</syntaxhighlight> || <code>OnItemSelected: [[TfgItemSelectedEvent]]</code>
 +
<p>Срабатывает, когда пользователь выбрал другой элемент списка. Дополнительно передает индекс выбранного элемента и сам экземпляр элемента.</p>
 +
|}
 +
 +
== Константы ==
 +
 +
{| class="wikitable sortable"
 +
|-
 +
| <syntaxhighlight lang="Delphi">const</syntaxhighlight> || <code>UndefinedItemIndex: [[Integer]]</code>
 +
<span style="color:gray">Описание отсутствует.</span>
 +
|}

Версия 00:18, 9 ноября 2020

Delphi

TfgCustomComboBox = class (TfgControl, IFGXContainer)

TComponent -> TfgControl -> TfgCustomComboBox

Прямые наследники: TfgComboBox

Описание

Описание отсутствует.

Конструкторы

constructor
Create(AOwner: TComponent)

Описание отсутствует.

Методы

procedure
AddItem(const AItem: TfgCustomComboBoxItem)

Добавляет произвольный элемент комбобокса.

function
AddTextItem(const AText: string): TfgComboBoxTextItem

Добавляет текстовый элемент комбобокса. Он отображает только текст.

function
DeleteItem(const AItem: TfgCustomComboBoxItem): Boolean

Удаляет элемент по указанному инстансу AItem .

Не допускается указывать nil. Если элемент был найден среди элементов контрола и удален, то вернет True, в противном случае - False.
function
DeleteItem(const AIndex: Integer): Boolean

Удаляет элемент по указанному индексу AIndex .

Не допускается указывать индекс не существующего элемента страницы.
procedure
Clear()

Удаляет все элементы выпадающего списка.

procedure
Open()

Программно открывает выпадающий список.

Свойства

property
ActiveItem: TfgCustomComboBoxItem

Активный/выбранный элмент ( ItemIndex ).

Если ни один элемент не выбран, то вернет nil.
property
Items[Index]: TfgCustomComboBoxItem

Возвращает элемент по указанному индексу.

Не допускается указывать индекс не существующего элемента.
property
ItemsCount: Integer

Количество элементов списка.

property
Text: string

Возвращает текст текущего элемента, если элемент поддерживает текст (IFGXTextSupported).

Если текущего элемента нет или он не поддерживает текст, то вернет пустую строку.
property
ItemIndex: Integer

Индекс выбранного элемента выпадающего списка.

События

event
OnChanged: TNotifyEvent

Срабатывает, когда пользователь выбрал другой элемент списка.

event
OnItemSelected: TfgItemSelectedEvent

Срабатывает, когда пользователь выбрал другой элемент списка. Дополнительно передает индекс выбранного элемента и сам экземпляр элемента.

Константы

const
UndefinedItemIndex: Integer

Описание отсутствует.