OnDgsEditAccepted: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client event}} __NOTOC__ This event is triggered when enter is pressed on a dgs edit box. ==Parameters== <syntaxhighlight lang="lua"> element editBox </syntaxhighlight> *...")
 
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
==Parameters==  
==Parameters==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
element editBox
element editBox, bool isAutoCompleteConfirmed
</syntaxhighlight>
</syntaxhighlight>
* '''editBox''': the dgs edit box which had focus.
* '''editBox''': the dgs edit box which had focus.
* '''isAutoCompleteConfirmed''': A bool of whether the accept operation is triggered by auto completion confirm.


==Source==
==Source==
Line 17: Line 18:
DGS = exports.dgs
DGS = exports.dgs
editBox = DGS:dgsCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
editBox = DGS:dgsCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler( "OnDgsEditAccepted", editBox,
addEventHandler( "onDgsEditAccepted", editBox,
     function( theElement )  
     function( theElement )  
         outputChatBox( DGS:dgsGetText( theElement ) )
         outputChatBox( DGS:dgsGetText( theElement ) )

Latest revision as of 14:24, 9 September 2019

This event is triggered when enter is pressed on a dgs edit box.

Parameters

element editBox, bool isAutoCompleteConfirmed
  • editBox: the dgs edit box which had focus.
  • isAutoCompleteConfirmed: A bool of whether the accept operation is triggered by auto completion confirm.

Source

The source of this event is the dgs edit box which enter was pressed on.

Example

This example creates a dgs edit box and prints a message when enter is pressed.

DGS = exports.dgs
editBox = DGS:dgsCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler( "onDgsEditAccepted", editBox,
    function( theElement ) 
        outputChatBox( DGS:dgsGetText( theElement ) )
    end
)

See Also

General

Check Box

Combo Box

Drag'N Drop

Edit

Grid List

Menu

Selector

Mouse

Radio Button

Switch Button

Tab

Animation

Plugin

Media

Color Picker

QRCode

Remote Image

Client event functions