IUP

From Vendetta Lua
(Redirected from Iup)
Jump to navigationJump to search


Overview

IUP is a portable toolkit for building graphical user interfaces. It offers APIs in three basic languages: C, Lua and LED.
Its library contains about 100 functions for creating and manipulating dialogs.
IUP's purpose is to allow a program to run in different systems without changes - the toolkit provides the application portability. Supported systems include: Motif and Microsoft Windows 2000/XP/2003.
IUP uses an abstract layout model based on the boxes-and-glue paradigm from the TEX text editor. This model, combined with the dialog-specification language (LED) or with the Lua binding (IupLua) makes the dialog creation task more flexible and independent from the graphics system's resolution.
Currently available interface elements can be categorized as follows:
  • Primitives (effective user interaction): dialog, label, button, text, multi-line, list, toggle, canvas, frame, image.
  • Composition (ways to show the elements): hbox, vbox, zbox, fill.
  • Grouping (definition of a common functionality for a group of elements): radio.
  • Menu (related both to menu bars and to pop-up menus): menu, submenu, item, separator.
  • Additional (elements built outside the main library): dial, gauge, matrix, tabs, valuator, OpenGL canvas, color chooser, color browser.
  • Dialogs (useful predefined dialogs): file selection, message, alarm, data input, list selection.
Hence IUP has some advantages over other interface toolkits available:
  • Simplicity: due to the small number of functions and to its attribute mechanism, the learning curve for a new user is often faster.
  • Portability: the same functions are implemented in each one of the platforms, thus assuring the interface system's portability.
  • Customization: the dialog specification language (LED) and the Lua binding (IupLua) are two mechanisms in which it is possible to customize an application for a specific user with a simple-syntax text file.
  • Flexibility: its abstract layout mechanism provides flexibility to dialog creation.
  • Extensibility: the programmer can create new interface elements as needed.
IUP is free software, can be used for public and commercial applications.

Credits

This work was developed at Tecgraf by means of the partnership with PETROBRAS/CENPES.
People who took part in IUP's development:
André Carregal
André Clinio
André Costa
André Derraik
Antonio Scuri
Carlos Augusto Mendes
Carlos Henrique Levy
Carlos José Pereira de Lucena
Claudio Coutinho de Biasi
Danny Reinhold
Diego Nehab
Diogo Martinez
Enio Emanuel Russo
Guilherme Fonseca Alvarenga
Henrique Dalcin Mendes Pinheiro
Leonardo Constantino Oliveira
Luiz Cristóvão Gomes Coelho
Luiz Henrique de Figueiredo
Marcelo Gattass
Mark Stroetzel Glasberg
Mauricio Oliveira Carneiro
Milton Jonathan
Neil Armstrong
Renato Borges
Renato Cerqueira
Roberto Beauclair
Vinicius Almendra
We must also mention engineer Enio Emanuel Russo, from PETROBRAS, who effectively contributed to the system's specification and project.
The initial version of the present document was developed by Carlos Henrique Levy, Neil Armstrong and André Carregal, being supervised and oriented by Luiz Martins, Luiz Henrique de Figueiredo, Marcelo Gattass and Carlos José Pereira de Lucena at Tecgraf, PUC-Rio for the Data Processing Sector (SEPROC) at CENPES/PETROBRAS.
Fullscreen support in Motif copied from wxWidgets. Their license is as flexible as the Tecgraf Library License, you can find it here: http://www.wxwidgets.org/newlicen.htm.


















Alarm

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
<source lang="lua">

-- 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 </source>


Appand

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

Description:
IUP Generator function. See:iup.canvas

Cboxv

Description:
IUP Generator function. See:iup.cbox


Destroy

Description:
[3]

Detach

Description:
[4]

Dialog

Description:
IUP Generator function. See:iup.dialog


DoDragDrop

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

FileDlg

Description:
does nothing

Fill

Description:
IUP Generator function. See:iup.fill

Flush

Description:
[5]

Frame

Description:
IUP Generator function. See:iup.frame

GetAttribute

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

GetAttributeData

Description:
[7]

GetAttributes

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

GetBrother

Description:
[9]

GetBrother

Description:
[10]

GetCapture

Description:
no clue

GetDialog

Description:
[11]

GetFocus

Description:
[12]

GetFromC

Description:
no idea

GetGlobal

Description:
[13]

GetHandle

Description:
[14]

GetLanguage

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

GetName

Description:
[16]

GetNextChild

Description:
[17]

GetParent

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

Hbox

Description:
IUP Generator function. See:iup.hbox


Help

Definition: Help(string url) -> nil
Description:
http://www.tecgraf.puc-rio.br/iup/en/func//iuphelp.html This doesn't seem to work.

Hide

Description:
http://www.tecgraf.puc-rio.br/iup/en/func//iuphide.html


Image

Description:
Create iup image. It doesn't seem to be possible to use the returned image in other elements.

Item

Description:
Create iup item for iup menus, which don't seem to work.

Joystick

Description:
IUP Generator function. See:iup.joystick

Label

Description:
IUP Generator function. See:iup.label

List

Description:
IUP Generator function. See:iup.list

ListDialog

Description:
http://www.tecgraf.puc-rio.br/iup/en/dlg/iuplistdialog.html Crashes the game.

LoadImage

Description:
Create iup image. It doesn't seem to be possible to use the returned image in other elements. see iup2 docs.

LoadNavmap

Definition: LoadNavmap(userdata map, int type, string name, int arg3) -> nil
Description:
Set the map that is displayed in a navmap element
Arguments:
map navmap
type map type. system (1), sector (2)
name map to load. "lua/maps/systemXXmap.lua" (where XX is the system id) or "lua/maps/universemap.lua"
arg3 no idea. selected system - 1 for type 1 and 0 for type 2

LoopStep

Description:
[19]

MainLoop

Description:
[20]

Map

Description:
[21]

MapFont

Description:
[22] Doesn't seem to work.

Matrix

Description:
IUP Generator function. See:iup.matrix

MatrixGetAttribute

Description:
[23]

MatrixGetCell

Description:
[24]

MatrixSetAttribute

Description:
[25]

MatrixSetCell

Description:
[26]

Menu

Description:
Create iup menu. Doesn't seem to work.

Message

Description:
[27]

Modelview

Description:
IUP Generator function. See:iup.modelview

Navmap

Description:
IUP Generator function. See:iup.navmap

NextField

Description:
[28]

Popup

Description:
[29]

PreviousField

Description:
[30]

Progressbar

Description:
IUP Generator function. See:iup.progressbar

ProjectPoint

Definition: ProjectPoint(userdata modelview, gvector meshpos) -> gvection projectpos
Description:
Get projection coordinates of a mesh position in a modelview. (check this)

Arguments:
modelview button
pos gvector mesh position
Returns:
projectpos gvector or projected position

RGB

Definition: RGB(fload r, g, b) -> string iupcolor
Description:
Convert float rgb colors into an iup color string

Arguments:
r red component (0 - 1)
g green component (0 - 1)
g bluw component (0 - 1)
Returns:
iupcolor iupcolor

Radar

Description:
IUP Generator function. See:iup.radar

Radio

Description:
IUP Generator function. See:iup.radio

Refresh

Description:
[31]

ReleaseCapture

Definition: ReleaseCapture(userdata element) -> nil
Description:
Stop directing all input to the given element (check this)

Arguments:
element an iup element (must be canvas?)

SaveImage

Description:
Save iup image. Probably doesn't work. see iup2 docs.

Sbox

Description:
IUP Generator function. See:iup.sbox

Scanf

Description:
no idea

Separator

Description:
IUP Generator function. See:iup.separator

SetAttribute

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

SetAttributes

Description:
[33]

SetCapture

Definition: SetCapture(userdata element) -> nil
Description:
Direct all input to the given element (check this)

Arguments:
element an iup element (must be canvas?)

SetDefaultFontSize

Definition: SetDefaultFontSize(int size) -> nil
Description:
Set default font size for widgets that don't have it set explicitely.
Desn't seem to resize existing text properly

Arguments:
size font size

SetFocus

Description:
[34]

SetGlobal

Description:
[35]

SetHandle

Description:
[36]

SetIdle

Description:
[37]
Doesn't seem to work

SetLanguage

Description:
[38]

SetNavmapPath

Definition: SetNavmapPath(userdata map, path) -> nil
Description:
Set path in navmap
Arguments:
map navmap
path full navmap path. see GetFullPath

SetOrientation

Definition: SetOrientation(userdata mv, quaternion orient) -> nil
Description:
Set the orientation of an object within a modelview
Arguments:
mw modelview
orient orientation of object

SetOwner

Description:
no idea

SetPosition

Definition: SetPosition(userdata mv, gevector pos) -> nil
Description:
Set the position of an object within a modelview
Arguments:
mw modelview
pos position of object

Show

Description:
[39]

ShowXY

Description:
[40]

StoreAttribute

Description:
[41]

StoreGlobal

Description:
[42]

Submenu

Description:
IUP Generator function. See:iup.submenu

Tabsv

Description:
IUP Generator function. See:iup.tabs

Text

Description:
IUP Generator function. See:iup.text

Timer

Description:
IUP Generator function. See:iup.timer

Tabsv

Description:
IUP Generator function. See:iup.tabs

Toggle

Description:
IUP Generator function. See:iup.toggle

Tree

Description:
IUP Generator function. See:iup.tree

TreeGetAttribute

Description:
[43]

TreeGetId

Description:
[44]

TreeGetTable

Description:
[45]

TreeGetTableId

Description:
[46]

TreeGetUserId

Description:
[47]

TreeSetAttribute

Description:
[48]

TreeSetTableId

Description:
[49]

TreeSetUserId

Description:
[50]

TreeSetValue

Description:
[51]

TreeSetValueRec

Description:
[52]

TreeStoreAttribute

Description:
[53]

UnMapFont

Description:
[54] Doesn't seem to work.

Vbox

Description:
IUP Generator function. See:iup.vbox

Version

Description:
[55]

VersionNumber

Description:
[56]

Zbox

Description:
IUP Generator function. See:iup.zbox

button

Definition: button{table attribs} -> userdata element
Description:
Create a button. see button

Arguments:
attribs element attributes
Returns:
element button