iup example cleanup

This commit is contained in:
qfox 2008-08-02 22:10:49 +00:00
parent 94e212df3e
commit cb9117cdf6
1 changed files with 209 additions and 174 deletions

View File

@ -1,189 +1,224 @@
require('auxlib'); -- super mario bros 1 hitbox script
-- iup example
-- this shows a test window with all kinds of idle dialogs
-- we need iup, so include it here
local iuplua_open = package.loadlib("iuplua51.dll", "iuplua_open");
iuplua_open();
-- we also need the "special controls" of iup (dont change the order though)
local iupcontrolslua_open = package.loadlib("iupluacontrols51.dll", "iupcontrolslua_open");
iupcontrolslua_open();
-- callback function to clean up our mess
-- this is called when the script exits (forced or natural)
-- you need to close all the open dialogs here or FCEUX crashes
function emu.OnClose.iuplua()
-- gui.popup("OnClose!");
if(emu and emu.OnCloseIup ~= nil) then
emu.OnCloseIup();
end
iup.Close(); -- close the iup system
end
-- this system allows you to open a number of dialogs without
-- having to bother about cleanup when the script exits
local handles = {}; -- this table should hold the handle to all dialogs created in lua
local dialogs = 0; -- should be incremented PRIOR to creating a new dialog
-- called by the onclose event (above)
function emu.OnCloseIup()
if (handles) then -- just in case the user was "smart" enough to clear this
local i = 1;
while (handles[i] ~= nil) do -- cycle through all handles, false handles are skipped, nil denotes the end
if (handles[i] and handles[i].destroy) then -- check for the existence of what we need
handles[i]:destroy(); -- close this dialog (close() just hides it)
handles[i] = nil;
end;
i = i + 1;
end;
end;
end;
-- Note that in the following example, parentheses are optional if you
-- are specifying tables with curly braces! Might look a little confusing.
function testiup() function testiup()
local img1 =
iup.image{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1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,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,2,2,2,3,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}; -- note that this ; is NOT the end of the command but a mere seperator, equivalent to a comma (,)
colors =
{
"BGCOLOR", -- 1
"255 0 0", -- 2
"0 0 0" -- 3 (changed because of Lua index starts at 1)
}
};
img1 = iup.image local img2 =
{ iup.image{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1}, {2,2,2,2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,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}; -- note that this ; is NOT the end of the command but a mere seperator, equivalent to a comma (,)
colors = colors =
{ {
"BGCOLOR", -- 1 "0 255 0", -- 1
"255 0 0", -- 2 "BGCOLOR", -- 2
"0 0 0" -- 3 (changed because of Lua index starts at 1) "255 0 0", -- 3
} "0 0 0" -- 4
} }
};
img2 = iup.image mnu = iup.menu{
{ iup.submenu{
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2}, title="IupSubMenu 1",
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2}, iup.menu {
{2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2}, iup.item{title="IupItem 1 Checked",value="ON"},
{2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2}, iup.separator{},
{2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2}, iup.item{title="IupItem 2 Disabled",active="NO"}
{2,2,2,2,2,2,2,2,2,2,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2}, }
{2,2,2,2,2,2,2,2,2,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2},
{2,2,2,2,2,2,2,2,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,4,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,3,3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,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
colors =
{
"0 255 0", -- 1
"BGCOLOR", -- 2
"255 0 0", -- 3
"0 0 0" -- 4
}
}
mnu = iup.menu
{
iup.submenu
{
iup.menu
{
iup.item{title="IupItem 1 Checked",value="ON"},
iup.separator{},
iup.item{title="IupItem 2 Disabled",active="NO"}
}
;title="IupSubMenu 1"
}, },
iup.item{title="IupItem 3"}, iup.item{title="IupItem 3"},
iup.item{title="IupItem 4"} iup.item{title="IupItem 4"}
} };
dlg = iup.dialog btn = iup.button{title="Press me!"};
{ -- set the callback function, action
iup.vbox -- when the user clicks on the button, this function is executed
{ -- and in this case, it fires a silly popup message
iup.hbox btn.action =
{ function (self)
iup.frame iup.Message("Why","Why oh why did you press me?");
{ end;
iup.vbox
{ dialogs = dialogs + 1; -- there is no ++ in Lua
iup.button{title="Button Text"}, handles[dialogs] =
iup.button{title="",image=img1}, iup.dialog{
iup.button{title="",image=img1,impress=img2} title="IupDialog Title",
} menu=mnu, -- add the menu in the table
;title="IupButton" iup.vbox{
}, iup.hbox{
iup.frame iup.frame{
{ title="IupButton",
iup.vbox iup.vbox{
{ btn, -- add the button
iup.label{title="Label Text"}, iup.button{title="",image=img1},
iup.label{title="",separator="HORIZONTAL"}, iup.button{title="",image=img1,impress=img2}
iup.label{title="",image=img1} }
} },
;title="IupLabel" iup.frame{
}, title="IupLabel",
iup.frame iup.vbox{
{ iup.label{title="Label Text"},
iup.vbox iup.label{title="",separator="HORIZONTAL"},
{ iup.label{title="",image=img1}
iup.toggle{title="Toggle Text", value="ON"}, }
iup.toggle{title="",image=img1,impress=img2}, },
iup.frame iup.frame{
{ title="IupToggle",
iup.radio iup.vbox{
{ iup.toggle{title="Toggle Text", value="ON"},
iup.vbox iup.toggle{title="",image=img1,impress=img2},
{ iup.frame{
iup.toggle{title="Toggle Text"}, title="IupRadio",
iup.toggle{title="Toggle Text"} iup.radio{
iup.vbox{
iup.toggle{title="Toggle Text"},
iup.toggle{title="Toggle Text"}
}
}
} -- /frame
} -- /vbox
},
iup.frame{
title="IupText/IupMultiline",
iup.vbox{
iup.text{size="80x",value="IupText Text"},
iup.multiline{size="80x60",
expand="YES",
value="IupMultiline Text\nSecond Line\nThird Line"}
}
},
iup.frame{
title="IupList",
iup.vbox{
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; expand="YES",value="1"},
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; dropdown="YES",expand="YES",value="2"},
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; editbox="YES",expand="YES",value="3"}
}
} }
} }, -- /hbox
;title="IupRadio" iup.canvas{bgcolor="128 255 0"},
} gap="5",
} alignment="ARIGHT",
;title="IupToggle" margin="5x5"
}, } -- /vbox
iup.frame };
{
iup.vbox
{
iup.text{size="80x",value="IupText Text"},
iup.multiline{size="80x60",expand="YES",value="IupMultiline Text\nSecond Line\nThird Line"}
}
;title="IupText/IupMultiline"
},
iup.frame
{
iup.vbox
{
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; expand="YES",value="1"},
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; dropdown="YES",expand="YES",value="2"},
iup.list{"Item 1 Text","Item 2 Text","Item 3 Text"; editbox="YES",expand="YES",value="3"}
}
;title="IupList"
}
},
iup.canvas{bgcolor="128 255 0"}
;gap="5",alignment="ARIGHT",margin="5x5"
}
;title="IupDialog Title", menu=mnu
}
dlg:show() handles[dialogs]:show(); -- this actually shows you the dialog. Note that this is equivalent to calling handles[dialogs].show(handles[dialogs]); just shorter.
end;
end testiup(); -- note that this is NOT called from WITHIN the loop!
testiup();
-- once the loop quits, the script exits and all dialogs are automatically destroyed by the onclose event
while (true) do while (true) do
FCEU.frameadvance(); FCEU.frameadvance();
end; end;