DgsComboBoxSetItemFont

From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function changes the font of a dgs combobox item.

Syntax

bool dgsComboBoxSetItemFont ( element comboBox, int itemId, mixed font )

Required Arguments

  • comboBox: The dgs combobox containing the item you're interested in
  • itemId: The index of the item
  • font: Either a custom dx font element or the name of a built-in dx font (see here Standard_DGS_Font_Names)

Returns

Returns true if the text was set successfully, false otherwise.

Example

This changes the font of the selected item using command setFont.

loadstring(exports.dgs:dgsImportFunction())()

local comboBox = dgsCreateComboBox(200,200,100,30,"test",false)
for i=1,5 do
    dgsComboBoxAddItem(comboBox,i)
end

addCommandHandler('setFont',function(cmd, text)
    local item = dgsComboBoxGetSelectedItem(comboBox)
    if item ~= -1 then
        dgsComboBoxSetItemFont(comboBox, item, 'clear')
    end
end)

See Also

Custom Cursor Functions

Multi Language Supports

Animation

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Plugin

Blur Box

Color Picker

Canvas

Circle

Effect 3D

Gradient

Media Browser

Mask

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Rounded Rectangle

Screen Source