Cross-platform C SDK logo

Cross-platform C SDK

Combo

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Functions

Combo*combo_create (void)
voidcombo_OnFilter (...)
voidcombo_OnChange (...)
voidcombo_text (...)
voidcombo_align (...)
voidcombo_tooltip (...)
voidcombo_color (...)
voidcombo_color_focus (...)
voidcombo_bgcolor (...)
voidcombo_bgcolor_focus (...)
voidcombo_phtext (...)
voidcombo_phcolor (...)
voidcombo_phstyle (...)
const char_t*combo_get_text (...)
uint32_tcombo_count (...)
voidcombo_add_elem (...)
voidcombo_set_elem (...)
voidcombo_ins_elem (...)
voidcombo_del_elem (...)
voidcombo_duplicates (...)

ComboBox are text editing boxes with drop-down list (Figure 1). Therefore, they will work in the same way as Edit controls on which methods for the management of the list are added. In Hello PopUp and Combo! you have an example of use.

❮ Back
Next ❯

combo_create ()

Create a combo control.

Combo*
combo_create(void);

Return

The combo.


combo_OnFilter ()

Set a function to filter the text while editing.

void
combo_OnFilter(Combo *combo,
               Listener *listener);
combo

The combo.

listener

Callback function to be called after each key press. In EvTextFilter from event_result filtered text will be returned.

Remarks

See Filter texts and GUI Events.


combo_OnChange ()

Set a function to be called when the text has changed.

void
combo_OnChange(Combo *combo,
               Listener *listener);
combo

The combo.

listener

Callback function to be called when the control loses focus on the keyboard, indicating the end of the edition.

Remarks

This event will also be launched when you select an item from the list, a sign that the text has changed in the edit box. See Filter texts and GUI Events.


combo_text ()

Set the combo edit text.

void
combo_text(Combo *combo,
           const char_t *text);
combo

The combo.

text

UTF8 C-string terminated in null character '\0'.


combo_align ()

Set text alignment.

void
combo_align(Combo *combo,
            const align_t align);
combo

The combo.

align

Alignment.


combo_tooltip ()

Assign a tooltip to the control combo.

void
combo_tooltip(Combo *combo,
              const char_t *text);
combo

The combo.

text

UTF8 C-string terminated in null character '\0'.


combo_color ()

Set the color of the combo text.

void
combo_color(Combo *combo,
            const color_t color);
combo

The combo.

color

Text color.

Remarks

RGB values may not be fully portable. See Colors.


combo_color_focus ()

Sets the color of the text, when the control has the keyboard focus.

void
combo_color_focus(Combo *combo,
                  const color_t color);
combo

The combo.

color

Text color.

Remarks

RGB values may not be fully portable. See Colors.


combo_bgcolor ()

Set the background color.

void
combo_bgcolor(Combo *combo,
              const color_t color);
combo

The combo.

color

Background color.

Remarks

RGB values may not be fully portable. See Colors.


combo_bgcolor_focus ()

Sets the background color when the control has keyboard focus.

void
combo_bgcolor_focus(Combo *combo,
                    const color_t color);
combo

The combo.

color

Background color.


combo_phtext ()

Set an explanatory text for when the control is blank.

void
combo_phtext(Combo *combo,
             const char_t *text);
combo

The combo.

text

UTF8 C-string terminated in null character '\0'.


combo_phcolor ()

Set the color of the placeholder text.

void
combo_phcolor(Combo *combo,
              const color_t color);
combo

The combo.

color

Text color.


combo_phstyle ()

Set the font style for the placeholder.

void
combo_phstyle(Combo *combo,
              const uint32_t fstyle);
combo

The combo.

fstyle

Combination of values of fstyle_t.


combo_get_text ()

Get control text.

const char_t*
combo_get_text(const Combo *combo,
               const uint32_t index);
combo

The combo.

index

The index of the text. If it is UINT32_MAX it indicates the text of the edit box itself. If >= 0, indicates a text in the list.

Return

UTF8 C-string terminated in null character '\0'.


combo_count ()

Gets the number of items in the dropdown list.

uint32_t
combo_count(const Combo *combo);
combo

The combo.

Return

The number of elements.


combo_add_elem ()

Add a new item to the drop-down list.

void
combo_add_elem(Combo *combo,
               const char_t *text,
               const Image *image);
combo

The combo.

text

The text of the element in UTF-8 or the resource identifier. Resources.

image

Icon associated with the resource element or identifier. For space, it will scale to a maximum maximum of 16 pixels.


combo_set_elem ()

Edit an item from the drop-down list.

void
combo_set_elem(Combo *combo,
               const uint32_t index,
               const char_t *text,
               const Image *image);
combo

The combo.

index

The index of the item to replace.

text

The text of the element in UTF-8 or the resource identifier. Resources.

image

Icon associated with the resource element or identifier. For space, it will scale to a maximum maximum of 16 pixels.


combo_ins_elem ()

Insert an item in the drop-down list.

void
combo_ins_elem(Combo *combo,
               const uint32_t index,
               const char_t *text,
               const Image *image);
combo

The combo.

index

Insertion position.

text

The text of the element in UTF-8 or the resource identifier. Resources.

image

Icon associated with the resource element or identifier. For space, it will scale to a maximum maximum of 16 pixels.


combo_del_elem ()

Remove an item from the drop-down list.

void
combo_del_elem(Combo *combo,
               const uint32_t index);
combo

The combo.

index

The index of the item to delete.


combo_duplicates ()

Prevents duplicate texts from the drop-down list.

void
combo_duplicates(Combo *combo,
                 const bool_t duplicates);
combo

The combo.

duplicates

TRUEto allow duplicate texts.

❮ Back
Next ❯