PDA

View Full Version : Parameter Blocks: Dotnet ListView Items in a Scripted plugin?


HeadSmell
06-18-2011, 12:30 PM
Hi guys,
Hope to get some help...I'm a little stuck here.
I am making a Thinking Particles script operator, which is a scripted plugin clause.

I've incorporated a DotNet Listview,populated with a list of cache files in the rollout. The problem is when I deselect the TP node then select it again all the ListView items disappear in the rollout.

How would i go about writing the listview items in the parameters main rollout,so the values stick?

I am amusing this is what is needed, I'm new to dotnet and scripted plugins.
Cheers
-Alex

lo
06-18-2011, 01:41 PM
try a stringTab parameter in your paramblock, writing to it on rollout close and reading from it on rollout open.

HeadSmell
06-19-2011, 04:06 AM
Thanks lo,
Though, I'm still a bit confuse on what to actually put for the:
<name> type:#stringTab tabSize: tabSizeVariable:true ui:

I'm getting a Compile error:
UI item array size does not match tabSize: specified in lv
when using:
lv type:#stringTab tabSizeVariable:true ui:lv

I take it tabSize is the array count? I'm a bit confused as to where the listview is storing the array.

Cheers

denisT
06-19-2011, 04:20 AM
see Scripted Plug-in Clauses
a .net control can't be linked to any parameter of param block.

HeadSmell
06-19-2011, 05:04 AM
Bummer...
Thanks Denis

lo
06-19-2011, 05:06 AM
You can not automatically link the listviewitems to the stringtab. You will need to write functions to read relevant information from the listview adn write it into the stringTab.
These functions should be called on the rollouts open/close events.
you should start with a tabSize of zero and set tabSizeVariable:true

HeadSmell
06-19-2011, 06:16 AM
Ah I see now :)
by writing to an array using #stringTab , then using a fn to test and populate the the Listview on a rollout open event.

Thanks guys

lo
06-19-2011, 06:26 AM
test what? You can assume the listview will always be empty on the rollout open event.

HeadSmell
06-19-2011, 06:36 AM
well this is a thinking particles node,it will be selected and deselected many times, causing the rollout to open and close each time.

I was going to make a fn to test if the user has already populated the list previously on a open rollout event handler.

Am i going about it wrong? Is there an easier way to go about it?
Thanks

lo
06-19-2011, 07:10 AM
well this is a thinking particles node,it will be selected and deselected many times, causing the rollout to open and close each time.

I was going to make a fn to test if the user has already populated the list previously on a open rollout event handler.

Am i going about it wrong? Is there an easier way to go about it?
Thanks

Didn't you say that when the user deselects the node the listview is reset?

parameters main
(
strTab type:#stringTab tabSize:0 tabSizeVariable:true
)

rollout mainRol
(
dotnetcontrol lv "ListView" etc....

on mainRol open do populateLvFromStrTab()
on mainRol close do writeLvItemsToStrTab()
)

HeadSmell
06-19-2011, 07:43 AM
All working now :)
Thanks again for your help
-Alex

lo
06-19-2011, 07:58 AM
sure
glad to hear it's working

CGTalk Moderation
06-19-2011, 07:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.