Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified files/clibs/iup.dll
Binary file not shown.
Binary file added files/clibs/iup_mglplot.dll
Binary file not shown.
Binary file modified files/clibs/iup_pplot.dll
Binary file not shown.
Binary file added files/clibs/iup_scintilla.dll
Binary file not shown.
Binary file modified files/clibs/iupcd.dll
Binary file not shown.
Binary file modified files/clibs/iupcontrols.dll
Binary file not shown.
Binary file modified files/clibs/iupgl.dll
Binary file not shown.
Binary file modified files/clibs/iupgtk.dll
Binary file not shown.
Binary file modified files/clibs/iupim.dll
Binary file not shown.
Binary file modified files/clibs/iupimglib.dll
Binary file not shown.
Binary file modified files/clibs/iuplua51.dll
Binary file not shown.
Binary file added files/clibs/iuplua_mglplot51.dll
Binary file not shown.
Binary file modified files/clibs/iuplua_pplot51.dll
Binary file not shown.
Binary file added files/clibs/iuplua_scintilla51.dll
Binary file not shown.
Binary file modified files/clibs/iupluacd51.dll
Binary file not shown.
Binary file modified files/clibs/iupluacontrols51.dll
Binary file not shown.
Binary file modified files/clibs/iupluagl51.dll
Binary file not shown.
Binary file modified files/clibs/iupluaim51.dll
Binary file not shown.
Binary file modified files/clibs/iupluaimglib51.dll
Binary file not shown.
Binary file modified files/clibs/iupluaole51.dll
Binary file not shown.
Binary file modified files/clibs/iupluatuio51.dll
Binary file not shown.
Binary file modified files/clibs/iupluaweb51.dll
Binary file not shown.
Binary file modified files/clibs/iupole.dll
Binary file not shown.
Binary file modified files/clibs/iuptuio.dll
Binary file not shown.
Binary file modified files/clibs/iupweb.dll
Binary file not shown.
Binary file modified files/clibs/lpeg.dll
Binary file not shown.
Binary file not shown.
639 changes: 374 additions & 265 deletions files/docs/lpeg/lpeg.html

Large diffs are not rendered by default.

290 changes: 209 additions & 81 deletions files/docs/lpeg/re.html

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions files/docs/luajson/LuaJSON.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ luajson - JSON encoder/decoder for Lua

SYNOPSIS
--------
require("json")
local json = require("json")

json.decode("json-string" [, parameters])

Expand Down Expand Up @@ -112,7 +112,14 @@ number.inf = false
unicodeWhitespace : boolean::
Specifies if unicode whitespace characters are counted

array.trailingComma / object.trailingComma : boolean::
array.allowEmptyElement / calls.allowEmptyElement / object.allowEmptyElement : boolean::
Specifies if missing values are allowed, replacing them with the value of 'undefined' or 'null' if undefined not allowed.
Example cases:
[1,, 3] ==> { 1, json.util.undefined, 3 }
{ x: } ==> { x = json.util.undefined }
call(1,, 3) ==> call(1, json.util.undefined, 3)

array.trailingComma / calls.trailingComma / object.trailingComma : boolean::
Specifies if extraneous trailing commas are ignored in declaration

calls.defs : map<string | LPEG, function | boolean>::
Expand Down
8 changes: 5 additions & 3 deletions files/examples/iup/getparam.wlua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ require( "iuplua" )
require( "iupluacontrols" )

function param_action(dialog, param_index)
if (param_index == -1) then
if (param_index == iup.GETPARAM_OK) then
print("OK")
elseif (param_index == -2) then
elseif (param_index == iup.GETPARAM_INIT) then
print("Map")
elseif (param_index == -3) then
elseif (param_index == iup.GETPARAM_CANCEL) then
print("Cancel")
elseif (param_index == iup.GETPARAM_HELP) then
print("Help")
else
local param = iup.GetParamParam(dialog, param_index)
print("PARAM"..param_index.." = "..param.value)
Expand Down
13 changes: 13 additions & 0 deletions files/examples/iup/globalcb.wlua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

function gbutton_cb(but, press, x, y, status)
print(but, press, x, y, status)
end

function gkeypress_cb(code, pressed)
print(code, pressed)
end

iup.SetGlobal("INPUTCALLBACKS", "Yes")
iup.SetGlobalCallback("GLOBALBUTTON_CB", gbutton_cb)
iup.SetGlobalCallback("GLOBALKEYPRESS_CB", gkeypress_cb)

37 changes: 37 additions & 0 deletions files/examples/iup/html_clipboard.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- StartHTML = byte count to just before <HTML> in this case, could be a more complex header
-- EndHTML = byte count to the last byte, not counting the extra NUL
-- StartFragment = byte count just after the <!--StartFragment-->
-- EndFragment = byte count just before the <!--EndFragment-->

-- Notice that byte count must include the line feed,
-- if DOS format is used must count LF by 2
-- Notice thatcharacter encoding is UTF-8,
-- so if string has extended characters must converto to UTF-8 before copying

-- Tested on Windows

html = [[Version:0.9
StartHTML:000084
EndHTML:000242
StartFragment:000163
EndFragment:000207
<HTML>
<head>
<title>HTML clipboard</title>
</head>
<body>
<!--StartFragment-->a <strong>copy</strong> <em>to</em> the clip<!--EndFragment-->
</body>
</html>
]] .. "\0" -- Extra NUL for UTF-8

clipboard = iup:clipboard()

clipboard.text = nil -- clear contents

clipboard.text = "a copy to the clip" -- copy also as text

clipboard.addformat = 'HTML Format' -- copy as HTML
clipboard.format = 'HTML Format'
clipboard.formatdatasize = html:len()+1
clipboard.formatdata = html
16 changes: 8 additions & 8 deletions files/examples/iup/image.wlua
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,25 @@ img_cursor = iup.image{
}

-- Creates a button and associates image img_x to it
btn = iup.button{ image = img_x }
btn = iup.button{ image = img_x, title = "btn" }

-- Creates a label and associates image img_x to it
lbl = iup.label{ image = img_x }
lbl = iup.label{ image = img_x, title = "lbl" }

-- Creates toggle and associates image img_x to it
tgl = iup.toggle{ image = img_x }
tgl = iup.toggle{ image = img_x, title = "tgl" }

-- Creates two toggles and associates image img_x to them
tgl_radio_1 = iup.toggle{ image = img_x }
tgl_radio_2 = iup.toggle{ image = img_x }
tgl_radio_1 = iup.toggle{ image = img_x, title = "tgl_radio_1" }
tgl_radio_2 = iup.toggle{ image = img_x, title = "tgl_radio_2" }

-- Creates label showing image size
lbl_size = iup.label{ title = '"X" image width = '..img_x.width..'; "X" image height = '..img_x.height }

-- Creates frames around the elements
frm_btn = iup.frame{btn; title="button", size="EIGHTHxEIGHTH"}
frm_lbl = iup.frame{lbl; title="label" , size="EIGHTHxEIGHTH"}
frm_tgl = iup.frame{tgl; title="toggle", size="EIGHTHxEIGHTH"}
frm_btn = iup.frame{btn; title="button"}
frm_lbl = iup.frame{lbl; title="label" }
frm_tgl = iup.frame{tgl; title="toggle"}

frm_tgl_radio = iup.frame{
iup.radio{
Expand Down
2 changes: 2 additions & 0 deletions files/examples/iup/list.wlua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ require( "iuplua" )
-- Creates a list and sets items, initial item and size
list = iup.list {"Gold", "Silver", "Bronze", "None"
; value = 4, size = "EIGHTHxEIGHTH"}

list[5] = "test"

-- Creates frame with simple list and sets its title
frm_medal = iup.frame {list ; title = "Best medal"}
Expand Down
42 changes: 42 additions & 0 deletions files/examples/iup/matrix_fittosize.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--require( "iuplua" )
--require( "iupluacontrols" )

mat = iup.matrix {
numcol=5,
numlin=3,
numcol_visible=5,
numlin_visible=3,
expand = "HORIZONTAL",
resizematrix = "YES"}

mat:setcell(0,0,"Inflation")
mat:setcell(1,0,"Medicine")
mat:setcell(2,0,"Food")
mat:setcell(3,0,"Energy")
mat:setcell(0,1,"January 2000")
mat:setcell(0,2,"February 2000")
mat:setcell(1,1,"5.6")
mat:setcell(2,1,"2.2")
mat:setcell(3,1,"7.2")
mat:setcell(1,2,"4.6")
mat:setcell(2,2,"1.3")
mat:setcell(3,2,"1.4")

dlg = iup.dialog{iup.vbox{mat; margin="10x10"}; shrink="yes"}

function dlg:resize_cb(w, h)
iup.Refresh(dlg)
mat.rasterwidth1 = nil
mat.rasterwidth2 = nil
mat.rasterwidth3 = nil
mat.rasterwidth4 = nil
mat.rasterwidth5 = nil
mat.fittosize = "columns"
return iup.IGNORE
end

dlg:showxy(iup.CENTER, iup.CENTER)

if (iup.MainLoopLevel()==0) then
iup.MainLoop()
end
34 changes: 34 additions & 0 deletions files/examples/iup/normalizer1.wlua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
require'iuplua'

local label1 = iup.label{title = 'param 1'}
local label2 = iup.label{title = 'param 2 with long name'}

local norm = iup.normalizer{label1, label2}
norm.normalize = "HORIZONTAL"
norm:destroy()

local dialog = iup.dialog
{
title="a dialog", size="QUARTERxQUARTER",
iup.vbox
{
cgap = "5x5",
cmargin = "5x5",
iup.hbox
{
label1,
iup.text{},
},
iup.hbox
{
label2,
iup.text{},
}
}
}

dialog:show()
iup.MainLoop()

dialog:destroy()
iup.Close()
28 changes: 28 additions & 0 deletions files/examples/iup/normalizer2.wlua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require'iuplua'

local norm = iup.normalizer{}
local dialog = iup.dialog
{
title="a dialog", size="QUARTERxQUARTER",
iup.vbox
{
CGAP = "5x5", CMARGIN = "5x5",
iup.hbox
{
iup.label{title = 'param 1', NORMALIZERGROUP = norm};
iup.text{};
};
iup.hbox
{
iup.label{title = 'param 2 with long name', NORMALIZERGROUP = norm};
iup.text{};
};
};
}
norm.normalize = "HORIZONTAL"
iup.Destroy(norm)

dialog:show()
iup.MainLoop()

dialog:destroy()
3 changes: 1 addition & 2 deletions files/examples/iup/pplot.wlua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require( "iuplua" )
require( "iupluacontrols" )
require( "iuplua_pplot" )
require( "iuplua_pplot" )

plot = iup.pplot{
TITLE = "Simple Line",
Expand Down
44 changes: 44 additions & 0 deletions files/examples/iup/pplot_bar.wlua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require("iuplua")
require("iuplua_pplot")

tblSurnames = {Blogs=4,
Smith=5,
Jones=12,
Weaver=3,
Whitesmith=4
}

plot = iup.pplot{
title = "Surname Distribution",
marginbottom="65",
marginleft="65",
axs_xlabel=" ",
axs_ylabel="Count",
legendshow="YES",
legendpos="TOPLEFT",
axs_xmin = "0",
axs_ymin = "0",
axs_yautomin = "NO",
axs_xautomin = "NO",
axs_xautotick = "no",
ds_showvalues = "YES"
}

iup.PPlotBegin(plot, 1)
i = 0
for strSurname, iQty in pairs(tblSurnames) do
iup.PPlotAddStr(plot, strSurname, iQty)
i = i + 1
end
iup.PPlotEnd(plot)

plot.ds_mode = "BAR"
plot.ds_legend = "Surnames"

d = iup.dialog{plot, size="800x200", title="PPlot"}

d:show()

if (iup.MainLoopLevel()==0) then
iup.MainLoop()
end
14 changes: 14 additions & 0 deletions files/examples/iup/text_highlight.wlua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require("iuplua")

local text1= iup.text{value="Apenas PARTE DESTE TEXTO deve ficar em highlight", size="250",
readonly="YES", FORMATTING = "YES"}
local text2= iup.text{value="Nada deste texto deve ficar em highlight", size="250"}
local vbox= iup.vbox{text1,text2}

local tags = iup.user { selectionpos = "7:24", bgcolor = "255 128 64" }
text1.addformattag = tags

local dlg=iup.dialog{vbox}
dlg:show()

iup.MainLoop()
Loading