Page 1 of 1

IUP Hints And Tips

Posted: 04 Oct 2013 09:47
by tatewise
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:
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.

Re: IUP Hints And Tips

Posted: 04 Oct 2013 10:10
by Jane
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.

Re: IUP Hints And Tips

Posted: 04 Oct 2013 11:35
by tatewise
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

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

Re: IUP Hints And Tips

Posted: 06 Oct 2013 10:25
by Jane
I have split this topic to create a new one for Module discussions.