* Add GRO Source plugin

Writing and using plugins for Version 5 and above.
Post Reply
avatar
gsward
Diamond
Posts: 68
Joined: 11 Mar 2011 14:47
Family Historian: V6

Add GRO Source plugin

Post by gsward » 26 Feb 2019 12:08

Could I request an update to the Add GRO Source plugin. Now that we have the GRO index online with age at death information (which was not previously on freeBMD), would it be possible to add the age field?

A couple of "nice to haves" in addition, would be if the selection of Birth, Marriage, Death was linked to the previously set up sources. Occasionally I end up with the data attached to the wrong source! The "icing on the cake" would be if the Registration District linked to the places list.

Thanks,

Graham

User avatar
Jane
Site Admin
Posts: 7821
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Add GRO Source plugin

Post by Jane » 26 Feb 2019 15:27

The place is a step too far and I suspect it would be better to add a prompt for the Place if it needs it to create the event, mainly as I think it's better to have the citation show as on the Index rather than an expanded place.
e.g
Liverpool N,
Liverpool
West Derby etc
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
gsward
Diamond
Posts: 68
Joined: 11 Mar 2011 14:47
Family Historian: V6

Re: Add GRO Source plugin

Post by gsward » 26 Feb 2019 16:45

Thank you. That works well for me and you have added the maiden name too of course. If you have not done so already it should go into the Plugin Store.

Graham

User avatar
Jane
Site Admin
Posts: 7821
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Add GRO Source plugin

Post by Jane » 27 Feb 2019 08:51

I had an idea for the Place names.

If it's going to add a Place to an Event this version prompts all matching Place names in a drop down and includes the option to type in a new one if needed.

I could have prompted the whole list, but it seemed more sensible to only include ones which contained the Registration district name.
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: 17081
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Add GRO Source plugin

Post by tatewise » 27 Feb 2019 12:38

By chance I tried this Plugin on a Project where the selected Individual had unusual characters in his Name.
e.g. % and UTF-8 accented letters and symbols.

The % causes the iup.GetParam function call to display nothing and always return false.

The fix is to use strName = strName:gsub("%%","%%%%") to replace any % with double %%.

To handle the UTF-8 accented letters and symbols correctly needs:

Code: Select all

require("iuplua")
if fhGetAppVersion() > 5 then
	fhSetStringEncoding("UTF-8")
	iup.SetGlobal("UTF8MODE","YES")
	iup.SetGlobal("UTF8MODE_FILE","NO")
end
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 7821
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Add GRO Source plugin

Post by Jane » 27 Feb 2019 13:01

Thanks Mike, I have added that in.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
gsward
Diamond
Posts: 68
Joined: 11 Mar 2011 14:47
Family Historian: V6

Re: Add GRO Source plugin

Post by gsward » 27 Feb 2019 13:27

This is what I like about FH, I actually struggle to think of many (any?) software products that are so well supported.

Thanks

Graham

User avatar
tatewise
Megastar
Posts: 17081
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Add GRO Source plugin

Post by tatewise » 27 Feb 2019 14:08

Jane, you forgot to incorporate strName = strName:gsub("%%","%%%%") to fix % in Name which is necessary as explained in IUP documentation for IupParam - Notes:
text is a descriptive text, to be placed to the left of the entry field in a label. It can contains any string, but to contain a '%' must use two characters "%%" to avoid conflict with the type separator.
e.g.

Code: Select all

if #ptrList == 1 then
    strName = fhGetItemText(ptrList[1],'~.NAME'):gsub('%%','%%%%')
    strName = 'Current Record: '..strName..' ('..fhCallBuiltInFunction('LifeDates',ptrList[1])..') '
else
    strName = 'No record selected'
end
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 7821
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Add GRO Source plugin

Post by Jane » 27 Feb 2019 14:17

Never seen a % in a name!

I'll have a look later
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: 17081
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Add GRO Source plugin

Post by tatewise » 27 Feb 2019 14:32

Agreed, but I like to make things foolproof, and it is tip worth remembering for any iup.GetParam(...) dialogue.
It is one of those things that is difficult to anticipate until it strikes with unusual user data.
Users do employ unusual characters in Names to indicate missing or unknown components, etc, so why not %?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 7821
Joined: 01 Nov 2002 15:00
Family Historian: V6.2
Location: Somerset, England
Contact:

Re: Add GRO Source plugin

Post by Jane » 27 Feb 2019 15:14

I have escaped the name and all the places in the drop down
Attachments
Add GRO Source.fh_lua
(8.76 KiB) Downloaded 34 times
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