Page 1 of 1
iup.Alarm Problems
Posted: 14 Jul 2011 14:18
by tatewise
I have tried using iup.Alarm and despite following all the instructions cannot get it to support more than three buttons.
The FH Plug In Help on Create User Interfaces with IUP says always use the following two lines:
require('iuplua')
fhUpdateDisplay()
which I have done, although they seem to be unnecessary, and make no difference.
They are not present in the sample Christening-Baptism Conversion script, from where I obtained iup.Alarm sample.
Finally, the Help for iup.Alarm says /n can be used to split the lines but it should say n.
Here is my sample code which does not show Button4
require('iuplua')
fhUpdateDisplay()
iButton = iup.Alarm('Ancestral Sources Data Entry',
'Please choose the type of data entry.n(Other types will be added as Ancestral Sources evolves)',
'Census', 'Baptism', 'Cancel', 'Button4')
ID:5236
iup.Alarm Problems
Posted: 14 Jul 2011 15:00
by Jane
Although the require 'iuplua' is not essential, it's good practice to include it, as if you want to include other modules you need to require them. You will also find most web examples will include it.
As you will see from the help for fhUpdateDisplay() it is only required where you are making changes to the data and want to ensure the main Family Historian screen has been updated to show them, while the Plugin is running.
Having checked the help on the IUP documentation 3 buttons are a maximum so the FH plugin help will need updating.
I would use an iup.listdialog to do that.
See:
http://www.tecgraf.puc-rio.br/iup/en/dl ... ialog.html
An example:
Code: Select all
require( 'iuplua' )
size = 8
marks = { 0,0,0,0,1,1,0,0 }
options = {'Blue', 'Red', 'Green', 'Yellow', 'Black', 'White', 'Gray', 'Brown'}
error = iup.ListDialog(2,'Color selection',size,options,0,16,5,marks)
if error == -1 then
iup.Message('IupListDialog', 'Operation canceled')
else
local selection = ''
local i = 1
while i ~= size+1 do
if marks[i] ~= 0 then
selection = selection .. options[i] .. 'n'
end
i = i + 1
end
if selection == '' then
iup.Message('IupListDialog','No option selected')
else
iup.Message('Selected options',selection)
end
end
iup.Alarm Problems
Posted: 15 Jul 2011 15:18
by tatewise
I have investigated the IUP library and decided to implement my own multi-button GUI.
The resulting Plugin has been submitted to the Plugin Store.
Looks like we have a whole new set of topics on Plugins for the Knowledge Base in the offing.
iup.Alarm Problems
Posted: 15 Jul 2011 16:45
by Jane
Well done on getting a plugin into the store so quickly.
I had set up a section in the KB ready, and you should now be able to see it:
http://www.fhug.org.uk/wiki/doku.php?id=plugins:index
If not shout and I will have a play with the permissions.
If any other beta testers would like access please let me know your Wiki user name and I will grant you access.
iup.Alarm Problems
Posted: 15 Jul 2011 17:25
by tatewise
OK, clicking your link comes up with Permission Denied, but if I login to KB the Plugins page opens.
iup.Alarm Problems
Posted: 15 Jul 2011 17:26
by Jane
Good, that means I have the permissions correct.
I meant to say, for the plugin store you don't need to avoid spaces, it's clever and will convert spaces to _ and remove them again for the downloading user.