*IUP Hints And Tips

Writing and using plugins for Version 5 and above.
User avatar
tatewise
Megastar
Posts: 14611
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

IUP Hints And Tips

Postby tatewise » 04 Oct 2013 09:47

Under Adding The Text Boxes the KB says:
You should note that the iup documentation always uses capital letters for the value keywords e.g MULTILINE, but in Lua you need to use lowercase e.g. multiline but the values for the keywords do need to be in capitals, if they are shown in capitals in the documentation.
However, it is my experience that IupLua is almost entirely case insensitive.

In fact under Attributes > Guide > Using the documentation says:
But attribute values like "YES", "NO", "TOP", are case insensitive, so "Yes", "no", "top", and other variations will work.

And under Attributes > Guide > Using the documentation says:
Note that the attribute names in C and in IupLua are the same, but in IupLua they can be written in lower case.

So Multiline="No" and MULTILINE="yes" and multiline="NO" are all OK.

The only things I have found to be case sensitive are the iup functions:
e.g.
Control & Layout & Dialog & etc, tables with { } arguments must be lower case:
iup.button{} iup.label{} iup.text{} iup.hbox{} iup.vbox{} iup.dialog{} etc.

Constants that have no arguments must be UPPER CASE:
iup.CLOSE iup.LEFT iup.CENTER iup.RIGHT iup.NULL iup.IGNORE etc.

Functions with ( ) arguments must be MixedCase:
iup.MainLoopLevel() iup.MainLoop() iup.LoopStep()
iup.Append() iup.Insert() iup.RefreshChildren()
iup.Help() iup.Alarm() iup.Message() iup.Flush() iup.TreeAddNodes()
iup.GetAttribute() iup.GetAttributeId() iup.SetAttributeId() iup.GetGlobal() etc.
Mike Tate ~ researching the Tate and Scott family history.

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

Re: IUP Hints And Tips

Postby Jane » 04 Oct 2013 10:10

Strange I am sure I found one or two which are sensitive, but if you are sure then you can add in a tip about case and remove my line.
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: 14611
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: IUP Hints And Tips

Postby tatewise » 04 Oct 2013 11:35

I also had a vague recollection of some case sensitivity in attribute names & values, but I've been experimenting this morning and cannot find any.
The documentation says they are not case sensitive, so perhaps what we are both thinking of is the iup.names.
As I said, the iup.names are very fussy, and I had not noticed until this morning that the rules appear to be tied to whether they are iup.tables{}, or iup.CONSTANTS, or iup.Functions().

FYI: I have written some Lua Library Modules that all my Plugins now use, although none have made it to the Plugin Store yet, except for Show Project Statistics that uses most of them.
Here are my SkyDrive links to them:

A Global Functions Module for popular basic functions ( some require "lfs" )

A GUI Library Module relevant to KB IUP tips ( needs all the iup libraries )
It does a lot of the repetitive donkey work, and includes many standard GUI features, but needs a user guide:
Common attribute values such as colour codes, and popular filenames & filepaths, etc.
LoadSettings & SaveSettings for sticky data settings
ShowDialogue for default operations of showxy and popup
NewHelpDialogue & AddHelpButton for a Help & Advice button
FontDialogue for a Set Window Font button
MemoDialogue & WarnDialogue both like iup.Alarm and fhMessageBox
CheckVersionInStore

A HTML XML URI UTF8 CP1252 Module for all those web page & UTF8 cases

A Progress Bar Module requires "iuplua"

A Table Load Save Module
Mike Tate ~ researching the Tate and Scott family history.

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

Re: IUP Hints And Tips

Postby Jane » 06 Oct 2013 10:25

I have split this topic to create a new one for Module discussions.

http://www.fhug.org.uk/forum/viewtopic.php?f=42&t=10814
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."


Return to “Plugin Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests