Difference between revisions of "IUP"

From Vendetta Lua
Jump to: navigation, search
Line 1: Line 1:
== Functions ==
 
 
 
=== Alarm ===
 
=== Alarm ===
 
'''Definition:'''
 
'''Definition:'''
Line 11: Line 9:
 
=== Animate ===
 
=== Animate ===
 
'''Definition:'''<br>
 
'''Definition:'''<br>
Animate(userdate ctl, float xstart, ystart, wstart, hstart, xend, yend, wend, hend, length, int type) -> userdata dialog
+
Animate(userdate element, float xstart, ystart, wstart, hstart, xend, yend, wend, hend, length, int type) -> userdata dialog
 
<br>
 
<br>
 
'''Description:'''<br>
 
'''Description:'''<br>
Line 17: Line 15:
 
<br>
 
<br>
 
'''Arguments:'''<br>
 
'''Arguments:'''<br>
''ctl'' control or dialog to animate. The animation of controls i clipped to their parent dialog<br>
+
''element'' control or dialog to animate. The animation of controls is clipped to their parent dialog<br>
 
''xstart'' initial horizontal position. value is relative to the screen. if nil the current position is used (0 - screenwidth)<br>
 
''xstart'' initial horizontal position. value is relative to the screen. if nil the current position is used (0 - screenwidth)<br>
 
''ystart'' initial vertical position<br>
 
''ystart'' initial vertical position<br>
Line 43: Line 41:
 
   local d = iup.dialog{iup.label{title="bla"}}  
 
   local d = iup.dialog{iup.label{title="bla"}}  
 
   d:show()  
 
   d:show()  
   iup.Animate(d, 10, 10, nil, nil, 200, 10, nil, nil, 1000, 0)  
+
   iup.Animate(d, 10, 10, nil, nil, 200, 10, nil, nil, 1000, 1)  
 
end
 
end
 
</source>
 
</source>
Line 57: Line 55:
  
 
=== Button ===
 
=== Button ===
'''Definition:'''<br>
+
'''Definition:'''
 
Button(string title) -> userdata button
 
Button(string title) -> userdata button
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a button control. see [[API_iup_button|iup.button]]
+
Create a button.<br>
 +
Note: [[API_iup_button|iup.button]] is normally used to create this element.
 
<br>
 
<br>
 
'''Arguments:'''<br>
 
'''Arguments:'''<br>
Line 81: Line 80:
  
 
=== Canvas ===
 
=== Canvas ===
'''Definition:'''<br>
+
'''Definition:'''
 
Canvas() -> userdata canvas
 
Canvas() -> userdata canvas
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a canvas. see [[API_iup_canvas|iup.canvas]]
+
Create a canvas.<br>
 +
Note: [[API_iup_canvas|iup.canvas]] is normally used to create this element.
 
<br>
 
<br>
 
'''Returns:'''<br>
 
'''Returns:'''<br>
Line 93: Line 93:
 
=== Cboxv ===
 
=== Cboxv ===
 
'''Definition:'''<br>
 
'''Definition:'''<br>
Cboxv(table controls) -> userdata canvas
+
Cboxv(table elements) -> userdata cbox
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a cbox. see [[API_iup_cbox|iup.cbox]]
+
Create a cbox.<br>
 +
Note: [[API_iup_cbox|iup.cbox]] is normally used to create this element.
 
<br>
 
<br>
 
'''Arguments:'''<br>
 
'''Arguments:'''<br>
''controls'' table with children of the box (optional)
+
''elements'' table with children of the box (optional)
 
<br>
 
<br>
 
'''Returns:'''<br>
 
'''Returns:'''<br>
''canvas'' [[API_iup_cbox|cbox]]
+
''cbox'' [[API_iup_cbox|cbox]]
 
<br>
 
<br>
  
Line 120: Line 121:
  
 
=== Dialog ===
 
=== Dialog ===
'''Definition:'''<br>
+
'''Definition:'''
Dialog(userdata control) -> userdata dialog
+
Dialog(userdata element) -> userdata dialog
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a dialog. see [[API_iup_dialog|iup.dialog]]
+
Create a dialog.<br>
 +
Note: [[API_iup_dialog|iup.dialog]] is normally used to create this element.
 
<br>
 
<br>
 
'''Arguments:'''<br>
 
'''Arguments:'''<br>
''control'' child of the dialog
+
''element'' child of the dialog
 
<br>
 
<br>
 
'''Returns:'''<br>
 
'''Returns:'''<br>
''canvas'' [[API_iup_dialog|dialog]]
+
''dialog'' [[API_iup_dialog|dialog]]
 
<br>
 
<br>
  
Line 150: Line 152:
  
 
=== Fill ===
 
=== Fill ===
'''Definition:'''<br>
+
'''Definition:'''
 
Fill() -> userdata fill
 
Fill() -> userdata fill
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a fill. see [[API_iup_fill|iup.fill]]
+
Create a fill.<br>
 +
Note: [[API_iup_fill|iup.fill]] is normally used to create this element.
 
<br>
 
<br>
 
'''Returns:'''<br>
 
'''Returns:'''<br>
Line 170: Line 173:
  
 
=== Frame ===
 
=== Frame ===
'''Definition:'''<br>
+
'''Definition:'''
Frame(userdata control) -> userdata frame
+
Frame(userdata element) -> userdata frame
 
<br>
 
<br>
 
'''Description:''' <br>
 
'''Description:''' <br>
Create a frame. see [[API_iup_frame|iup.frame]]
+
Create a frame.<br>
 +
Note: [[API_iup_frame|iup.frame]] is normally used to create this element.
 
<br>
 
<br>
 
'''Arguments:'''<br>
 
'''Arguments:'''<br>
''control'' child of the frame
+
''element'' child of the frame
 
<br>
 
<br>
 
'''Returns:'''<br>
 
'''Returns:'''<br>
 
''frame'' [[API_iup_frame|frame]]
 
''frame'' [[API_iup_frame|frame]]
 +
<br>
 +
 +
=== GetAttribute ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html]
 +
Accessing globals doesn't work as described.
 +
<br>
 +
 +
=== GetAttributeData ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html]
 +
<br>
 +
 +
=== GetAttributes ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html]
 +
The docs suggest iup.GetAllAttributes, which doesn't exist in the game.
 +
<br>
 +
 +
=== GetBrother ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html]
 +
<br>
 +
 +
=== GetBrother ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetattribute.html]
 +
<br>
 +
 +
=== GetCapture ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
no clue
 +
<br>
 +
 +
=== GetDialog ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/dlg/iupgetdialog.html]
 +
<br>
 +
 +
=== GetFocus ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetfocus.html]
 +
<br>
 +
 +
=== GetFromC ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
no idea
 +
<br>
 +
 +
=== GetGlobal ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetglobal.html]
 +
<br>
 +
 +
=== GetHandle ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgethandle.html]
 +
<br>
 +
 +
=== GetLanguage ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetlanguage.html]
 +
It seems to return garbage in the game.
 +
<br>
 +
 +
=== GetName ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetname.html]
 +
<br>
 +
 +
=== GetNextChild ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetnextchild.html]
 +
<br>
 +
 +
=== GetParent ===
 +
'''Definition:'''
 +
<br>
 +
'''Description:'''<br>
 +
[http://www.tecgraf.puc-rio.br/iup/en/func/iupgetparent.html]
 +
<br>
 +
 +
=== GetText ===
 +
'''Definition:'''
 +
GetBrother(string title, deftext) -> string text
 +
<br>
 +
'''Description:'''<br>
 +
Shows a modal dialog to edit a multiline text. See iup2 docs.
 +
It doesn't seem to work properly.
 +
<br>
 +
 +
=== GetType ===
 +
'''Definition:'''
 +
GetType(userdata element) -> string type
 +
<br>
 +
'''Description:'''<br>
 +
Returns the type of an interface element.
 +
<br>
 +
'''Arguments:'''<br>
 +
''element'' an interface element
 +
<br>
 +
'''Returns:'''<br>
 +
''type'' type of element
 
<br>
 
<br>

Revision as of 00:44, 13 May 2010

Alarm

Definition:
Description:
[1] The ICON and PARENTDIALOG globals seem to be ignored

Animate

Definition:
Animate(userdate element, float xstart, ystart, wstart, hstart, xend, yend, wend, hend, length, int type) -> userdata dialog
Description:
Move and resize a control or dialog according to given parameters.
Arguments:
element control or dialog to animate. The animation of controls is clipped to their parent dialog
xstart initial horizontal position. value is relative to the screen. if nil the current position is used (0 - screenwidth)
ystart initial vertical position
wstart initial width
hstart initial height
xend final horizontal position
yend final vertical position
wend final width
hend final height
length animation time in milliseconds
type animation type. if 1 bounce between initial and final state otherwise transform lineary from initial to final state
Example

-- make a dialog and resize it to a size of 200x200
do 
   local d = iup.dialog{iup.label{title="bla"}} 
   d:show() 
   iup.Animate(d, nil, nil, nil, nil, nil, nil, 200, 200, 1000, 0) 
end
 
-- make a dialog and bounce between the positions 10,10 and 200,10
do 
   local d = iup.dialog{iup.label{title="bla"}} 
   d:show() 
   iup.Animate(d, 10, 10, nil, nil, 200, 10, nil, nil, 1000, 1) 
end


Appand

Definition:
Description:
[2]


Button

Definition: Button(string title) -> userdata button
Description:
Create a button.
Note: iup.button is normally used to create this element.
Arguments:
title button title
Returns:
button button


CancelDragDrop

Definition: CancelDragDrop() -> nil
Description:
DragDrop


Canvas

Definition: Canvas() -> userdata canvas
Description:
Create a canvas.
Note: iup.canvas is normally used to create this element.
Returns:
canvas canvas

Cboxv

Definition:
Cboxv(table elements) -> userdata cbox
Description:
Create a cbox.
Note: iup.cbox is normally used to create this element.
Arguments:
elements table with children of the box (optional)
Returns:
cbox cbox

Destroy

Definition:
Description:
[3]

Detach

Definition:
Description:
[4]

Dialog

Definition: Dialog(userdata element) -> userdata dialog
Description:
Create a dialog.
Note: iup.dialog is normally used to create this element.
Arguments:
element child of the dialog
Returns:
dialog dialog

DoDragDrop

Definition: DoDragDrop(dataobject, datasource, effectsallowed) -> nil
Description:
DragDrop

FileDlg

Definition: FileDlg() -> nil
Description:
does nothing

Fill

Definition: Fill() -> userdata fill
Description:
Create a fill.
Note: iup.fill is normally used to create this element.
Returns:
fill fill


Flush

Definition:
Description:
[5]


Frame

Definition: Frame(userdata element) -> userdata frame
Description:
Create a frame.
Note: iup.frame is normally used to create this element.
Arguments:
element child of the frame
Returns:
frame frame

GetAttribute

Definition:
Description:
[6] Accessing globals doesn't work as described.

GetAttributeData

Definition:
Description:
[7]

GetAttributes

Definition:
Description:
[8] The docs suggest iup.GetAllAttributes, which doesn't exist in the game.

GetBrother

Definition:
Description:
[9]

GetBrother

Definition:
Description:
[10]

GetCapture

Definition:
Description:
no clue

GetDialog

Definition:
Description:
[11]

GetFocus

Definition:
Description:
[12]

GetFromC

Definition:
Description:
no idea

GetGlobal

Definition:
Description:
[13]

GetHandle

Definition:
Description:
[14]

GetLanguage

Definition:
Description:
[15] It seems to return garbage in the game.

GetName

Definition:
Description:
[16]

GetNextChild

Definition:
Description:
[17]

GetParent

Definition:
Description:
[18]

GetText

Definition: GetBrother(string title, deftext) -> string text
Description:
Shows a modal dialog to edit a multiline text. See iup2 docs. It doesn't seem to work properly.

GetType

Definition: GetType(userdata element) -> string type
Description:
Returns the type of an interface element.
Arguments:
element an interface element
Returns:
type type of element