OnClientGUIAccepted: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Client event}}
{{Client event}}
__NOTOC__  
__NOTOC__  
هذا الحدث يحدث عند ضعت الاعب على زر
This event is triggered when enter is pressed on an editbox.
 
enter
 
في لوحة المفاتيح


==Parameters==  
==Parameters==  
Line 11: Line 7:
element editBox
element editBox
</syntaxhighlight>
</syntaxhighlight>
* '''editBox''': هو المستطيل الذي سيُكتب النص فيه
* '''editBox''': the [[Element/GUI/Edit_field|editbox]] which had focus.
 
==Source==
==Source==
في هذا الحدث هو دائماً [[event system#Event سورس|سورس]]Iالــ
The [[event system#Event source|source]] of this event is the editbox which enter was pressed on.
 
[[getRootElement|root]] element
==مـثـال==
هذا المثال يصنع


gui-edit
==Example==
 
This example creates an editbox and prints a message when enter is pressed.
ويآخذ الكلام الذي بـ داخلها ثم يخرجه الى مربع الشات
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
editBox = guiCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true ) -- gui-edit
editBox = guiCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler( "onClientGUIAccepted", editBox,   -- الحدث
addEventHandler( "onClientGUIAccepted", editBox,
     function( theElement ) -- الوظيفة
     function( theElement )  
         outputChatBox( guiGetText( theElement ) ) --[[ يخرج الى علبة الشات الكلام الذي بـ داخل
         outputChatBox( guiGetText( theElement ) )
     end                                               gui-edit]]
     end
)
)
</syntaxhighlight>
</syntaxhighlight>
'''اضافة:'''
في المثال كما نتذكر في مقدمة البرمجة ان هذه الوظيفة بدون اسم لآن الحدث جاء قبلها


==أنظر ايضاً==
[[pl:onClientGUIAccepted]]
===احداث GUI===
 
==See Also==
{{GUI_events}}
{{GUI_events}}
===Client event functions===
===Client event functions===
{{Client_event_functions}}
{{Client_event_functions}}

Latest revision as of 14:29, 20 May 2018

This event is triggered when enter is pressed on an editbox.

Parameters

element editBox
  • editBox: the editbox which had focus.

Source

The source of this event is the editbox which enter was pressed on.

Example

This example creates an editbox and prints a message when enter is pressed.

editBox = guiCreateEdit ( 0.3, 0.1, 0.4, 0.1, "", true )
addEventHandler( "onClientGUIAccepted", editBox,
    function( theElement ) 
        outputChatBox( guiGetText( theElement ) )
    end
)

See Also

Input

GUI


Client event functions