Difference between revisions of "QuestionDialog"

From Vendetta Lua
Jump to: navigation, search
m (Reverted edits by Otutytaqo (Talk) to last version by Chefkoch)
 
Line 2: Line 2:
 
A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().
 
A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().
  
>== Functions ==
+
== Functions ==
  
 
=== SetMessage ===
 
=== SetMessage ===
'''Definition:'''<br>
+
'''Definition:'''<br>
SetMessage(ihandle qdialog, string message, string ltitle, function lcb, string rtitle, function rcb) -&gt; nil
+
SetMessage(ihandle qdialog, string message, string ltitle, function lcb, string rtitle, function rcb) -> nil
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Description:''' &lt;br&gt;
+
'''Description:''' <br>
 
Sets message plus title and callbacks for the buttons.
 
Sets message plus title and callbacks for the buttons.
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Arguments:'''&lt;br&gt;
+
'''Arguments:'''<br>
'''qdialog''' the question dialog (can be omitted with the colon syntax)&lt;br&gt;
+
'''qdialog''' the question dialog (can be omitted with the colon syntax)<br>
'''message''' message to display in the dialog&lt;br&gt;
+
'''message''' message to display in the dialog<br>
'''ltitle''' left button title&lt;br&gt;
+
'''ltitle''' left button title<br>
'''lcb''' left button callback&lt;br&gt;
+
'''lcb''' left button callback<br>
'''rtitle''' right button title&lt;br&gt;
+
'''rtitle''' right button title<br>
 
'''rcb''' right button callback
 
'''rcb''' right button callback
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
'''Returns:'''
 
'''Returns:'''
&lt;br&gt;&lt;br&gt;
+
<br><br>
'''Example:'''&lt;br&gt;
+
'''Example:'''<br>
&lt;source lang=&quot;lua&quot;&gt;
+
<source lang="lua">
 
local function yes_cb()
 
local function yes_cb()
print(&quot;you said yes&quot;)
+
print("you said yes")
 
HideDialog(QuestionDialog)
 
HideDialog(QuestionDialog)
 
end
 
end
  
 
local function no_cb()
 
local function no_cb()
print(&quot;you said no&quot;)
+
print("you said no")
 
HideDialog(QuestionDialog)
 
HideDialog(QuestionDialog)
 
end
 
end
  
QuestionDialog:SetMessage(&quot;Answer me!&quot;, &quot;Yes&quot;, yes_cb, &quot;No&quot;, no_cb)
+
QuestionDialog:SetMessage("Answer me!", "Yes", yes_cb, "No", no_cb)
 
ShowDialog(QuestionDialog)
 
ShowDialog(QuestionDialog)
&lt;/source&gt;
+
</source>
&lt;br&gt;&lt;br&gt;
+
<br><br>
 
+
----
+
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
+
----
+
=[http://yvotezo.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
+
----
+
=[http://yvotezo.co.cc CLICK HERE]=
+
----
+
</div>
+

Latest revision as of 18:54, 20 November 2010

A fullscreen iup dialog with two buttons that can be used to ask for confirmation and stuff like that. Display with :show() or ShowDialog().

Functions

SetMessage

Definition:
SetMessage(ihandle qdialog, string message, string ltitle, function lcb, string rtitle, function rcb) -> nil

Description:
Sets message plus title and callbacks for the buttons.

Arguments:
qdialog the question dialog (can be omitted with the colon syntax)
message message to display in the dialog
ltitle left button title
lcb left button callback
rtitle right button title
rcb right button callback

Returns:

Example:

local function yes_cb()
print("you said yes")
HideDialog(QuestionDialog)
end
 
local function no_cb()
print("you said no")
HideDialog(QuestionDialog)
end
 
QuestionDialog:SetMessage("Answer me!", "Yes", yes_cb, "No", no_cb)
ShowDialog(QuestionDialog)