* Option buttons in Plug-in
-
dickthomas
- Silver
- Posts: 9
- Joined: 16 Nov 2002 13:23
- Family Historian: None
Option buttons in Plug-in
I am writing a plug-in that requires user to make a choice of one of 5 options. fhMessageBox works well for 3 options but no more than that. Ideally I would like a window to appear with the 5 options and for the user to choose by use of radio buttons. I have searched on Google for this in Lua but although there are clear references to this I am not at all clear how I would get them to work in a FH plug-in.
Has anybody got any ideas how to do this ?
Alternatively is there any way in which fhMessageBox can be expanded to have more than 3 options ?
Thanks
Cheers,
Dick Thomas
ID:6173
Has anybody got any ideas how to do this ?
Alternatively is there any way in which fhMessageBox can be expanded to have more than 3 options ?
Thanks
Cheers,
Dick Thomas
ID:6173
- tatewise
- Megastar
- Posts: 27078
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Option buttons in Plug-in
In the Family Historian Plugin Help open the section Introduction to Lua and then the Create User Interfaces with IUP.
This offers iup.GetParam that allows multiple options.
You can define up to three buttons as renamed versions of OK, Cancel, and Help.
You can define as many radio button toggles as you like.
There are other options for choosing file paths, and entering text, etc.
The items in this section are predefined IUP user interfaces.
The full IUP definition that allows virtually any user interface to be defined is found via the http://www.tecgraf.puc-rio.br/iup/ link.
However, this will require a great deal of time and effort to master.
Have look in other Plugins that have significant user interfaces for examples.
e.g. Ancestral Sources Data Entry would be a good start for basic buttons, also Map Life Facts and Change any Fact Tag,
This offers iup.GetParam that allows multiple options.
You can define up to three buttons as renamed versions of OK, Cancel, and Help.
You can define as many radio button toggles as you like.
There are other options for choosing file paths, and entering text, etc.
The items in this section are predefined IUP user interfaces.
The full IUP definition that allows virtually any user interface to be defined is found via the http://www.tecgraf.puc-rio.br/iup/ link.
However, this will require a great deal of time and effort to master.
Have look in other Plugins that have significant user interfaces for examples.
e.g. Ancestral Sources Data Entry would be a good start for basic buttons, also Map Life Facts and Change any Fact Tag,
-
dickthomas
- Silver
- Posts: 9
- Joined: 16 Nov 2002 13:23
- Family Historian: None
Option buttons in Plug-in
Thanks Mike,
I'll give it a go. I don't know why I didn't see this when I was scanning through the help.
Kind regards,
Dick
I'll give it a go. I don't know why I didn't see this when I was scanning through the help.
Kind regards,
Dick
- tatewise
- Megastar
- Posts: 27078
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Option buttons in Plug-in
I have written a function that replicates iup.Alarm but allows up to 9 buttons.
This has been added to the Plugin Code Snippets as User Interface Buttons.
This has been added to the Plugin Code Snippets as User Interface Buttons.
- Jane
- Site Admin
- Posts: 8440
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Option buttons in Plug-in
Mike, I have posted a variation on your code as a separate snippet, which might contain a few tricks you have not found in Lua yet.
[wiki]plugins:code_snippets:user_interface_buttons[/wiki]
[wiki]plugins:code_snippets:user_interface_buttons[/wiki]
- tatewise
- Megastar
- Posts: 27078
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Option buttons in Plug-in
Thanks Jane, I had an inkling that something like that was possible, but wanted to create something quickly for Dick.
I have revised my Code Snippet and so perhaps V2 can vanish.
V1.1 includes a horizontal line separator and padding on the buttons like iup.Alarm.
I have revised my Code Snippet and so perhaps V2 can vanish.
V1.1 includes a horizontal line separator and padding on the buttons like iup.Alarm.
-
dickthomas
- Silver
- Posts: 9
- Joined: 16 Nov 2002 13:23
- Family Historian: None
Option buttons in Plug-in
Thanks Mike and Jane,
I had just about got a solution with iup.getparam but it wasn't as neat as yours. The only advantage with mine was that the options were listed vertically rather than across the page making it rather easier to get the text in. I need a bit more practice in Lua !
Kind regards,
Dick
I had just about got a solution with iup.getparam but it wasn't as neat as yours. The only advantage with mine was that the options were listed vertically rather than across the page making it rather easier to get the text in. I need a bit more practice in Lua !
Kind regards,
Dick
- Jane
- Site Admin
- Posts: 8440
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Option buttons in Plug-in
Just change hbox for for vbox to list them other other way.
-
dickthomas
- Silver
- Posts: 9
- Joined: 16 Nov 2002 13:23
- Family Historian: None
Option buttons in Plug-in
Brilliant - whole thing is beginning to look good and do the job.
Cheers,
Dick
Cheers,
Dick