Archive: list of checkboxes (revisited)


list of checkboxes (revisited)
It was asked back in May 2004 if there was a way to make a custom page that has a list of checkboxes similar to the components list: see here

I have a similar requirement to the user who posed that question: the list needs to be something that can be populated at runtime, needs to display in its own page, and needs to be scrollable since for a certain number of users it could contain dozens of items.

Is the answer to this still that you have to use the System plugin and Win32 APIs to create this or is it now possible to do this with InstallOptions? (If someone can point to an example of something similar to this, of course that would be great!)


anyone have a solution to this? I need to do exactly the same but can't figure out how to do so.


EmbeddedLists plug-in

-Stu


Thanks alot!
This is not exactly what I wanted, but it is close enough and I think I can make it work.

Thanks again!


If you wanted something identical to the tree view control on the components page, I could add that as well.

-Stu


What I need is the additional ability to set the state of the checkboxes that is in the list. One of my checkbox is the parent of all the other checkboxes, so its state affects all other checkboxes' state. If the parent is checked, all the rest need to be marked as checked. If the parent is unchecked, all the rest should also be unchecked so that the user can check them individually. Is that possible?

Also it would be nice to be able to use checkboxes that without using the MultiColumn.

Thanks!


It uses a syslistview32 control, not a systreeview32 control.
You can't have child items under parent items in a list view control. The plugin would have to be expanded to add support for a dialog with a tree view control.

To set an items' state to checked, add a + in front of the item name.

-Stu


The parent/child relationship is something I can manage, I don't need the view to display child under parent only when parent is expanded. So treeview control is not required for now, but might be nice to have in the future.

The ability to set the state of the checkbox is a big help!
Is it hard to enable checkboxes w/o using MultiColumn?

Thanks for the quick reply!


It is possible, but not without adding another dialog resource which will add to the plugin size. List view controls support different list styles but unfortunately the list style cannot be changed dynamically at run time.

I would like to add treeview support as it's one thing that would be very useful. I might even add list images too.

-Stu


Is it possible for you to show me how to add the additional dialog resource so I can use checkboxes w/o using MultiColumn? Plugin size is not a big concern for my project.

Thanks!


Open the source code in Visual Studio 6 or .NET and open EmbeddedLists.rc. You want the IDC_MULTICOLUMN dialog and you need to change the list view control View property from Report to List. Make sure the build configuration is set to Release and not Debug. If you build from Contrib\EmbeddedLists\ the plugin will be put in the Plugins folder directly. You should be able to ommit the /HEADINGS parameter altogether when calling the plugin.

-Stu


The project depends on exdll.h which is not included in the original zip file. Can you please provide me the missing files? Thanks!

Compilation Error:
Cannot open include file: '..\ExDll\exdll.h'


It's in the NSIS source distribution, but here it is anyway.
Rename to exdll.h and place in Contrib\ExDLL.

I've been working on the new version. So far I've added support for check boxes on all types of lists; column widths can now be changed; headings can be removed via plugin parameters; item texts can be edited and item sorting has been added.

There is now only one resource instead of three.

Tomorrow I will add tree view support and perhaps list item icons as well.

-Stu


awesome!


Had little time today so I only added item icon support.
TreeView will come tomorrow.

-Stu


I will check in again next Monday. Thanks!


Just to let you know I've done some more work and it's nearly done. Just need to do debugging and write plugin documentation.

Plugin now uses INI files for accessing data as plugin parameters were getting very messy.

-Stu


Thanks for the update.


Should be done by tomorrow evening (GMT).

-Stu


You can download the new version from here:
http://nsis.sourceforge.net/File:EmbeddedLists.zip

If you need any help or find any issues please post here.

-Stu


This new version is very interesting, but has some bugs. The items selected are not shown correctly with MessageBox and single select allows multiselection :(


I'll have a look soon. Basically ran out of time so I had to get it off my shoulders :)

-Stu


Fixed the problems that you mentioned.
http://nsis.sourceforge.net/File:EmbeddedLists.zip

-Stu


Looking good! Thanks Stu!


Almost perfect... all MultiColumn and some TreeView examples still not displaying correct selected items and TreeView Basic items can't be selected.


You can't select multiple items in the TreeView control. If you want to be able to select one item, I can add a boolean to enable/disable the unselect feature.
I'll check the problems later this evening.

-Stu


Couldn't find any plugin issues, except the scripts where Pop[ping] $R0 twice (one Pop was for using the old plugin and wasn't removed).

If you find that items don't appear selected in the order that you have them set in the INI file, then that'd be Sort=1 in action.

-Stu


Yes, in fact the extra "Pop $R0" was the culprit for multiselect issues. In TreeView_Basic example if I try to select one item, it remains unselected and $R0 is /END after popping; in TreeView_LabelEdit example, if I select one item, no message appears indicatiing it as selected and $R0 is /END after popping.


That is by design. If you would like support for selection I will add it.

-Stu


Originally posted by Afrow UK
That is by design. If you would like support for selection I will add it.

-Stu
It would be very nice :)

http://nsis.sourceforge.net/File:EmbeddedLists.zip

TreeView items are now selectable by default.
They cannot be selected with NoItemSelection=1.

-Stu


I realize this topic is somewhat old, but I have a question about the plugin. I was poking my way through the source and the plugin, and this is perfect except for one detail. Is there any way to change the colors of the dialog items? I'm using an installer skin and the default grey looks a tad bit out of place.