OnDgsComboBoxAccepted

From Multi Theft Auto: Wiki
Revision as of 01:25, 23 June 2018 by Thisdp (talk | contribs) (Created page with "{{Client event}} __NOTOC__ This event is called when a dgs combo box gets accepted. ==Parameters== <syntaxhighlight lang="lua"> element theElement </syntaxhighlight> *'''the...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This event is called when a dgs combo box gets accepted.

Parameters

element theElement
  • theElement: the dgs combo box that got accepted.

Example

This example will set the memo text to the selected combobox item text.

DGS = exports.dgs
Combo = DGS:dgsCreateComboBox ( 50, 40, 200, 20, "Example", false )
Memo = DGS:dgsCreateMemo( 50, 60, 200, 50, "", false)
addEventHandler ( "onDgsComboBoxAccepted", root,
    function ( comboBox )
        if ( comboBox == Combo ) then
            local item = DGS:dgsComboBoxGetSelected ( Combo )
            local text = tostring ( DGS:dgsComboBoxGetItemText ( Combo , item ) )
            if ( text ~= "" ) then
                 DGS:dgsSetText ( Memo , text )
            end
        end
    end
)

See Also

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions