* iup.Alarm Problems

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

iup.Alarm Problems

Post by tatewise » 14 Jul 2011 14:18

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
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

iup.Alarm Problems

Post by Jane » 14 Jul 2011 15:00

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
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

iup.Alarm Problems

Post by tatewise » 15 Jul 2011 15:18

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

iup.Alarm Problems

Post by Jane » 15 Jul 2011 16:45

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.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27080
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

iup.Alarm Problems

Post by tatewise » 15 Jul 2011 17:25

OK, clicking your link comes up with Permission Denied, but if I login to KB the Plugins page opens.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8441
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

iup.Alarm Problems

Post by Jane » 15 Jul 2011 17:26

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.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply