Jump to content

Nested Switchers


Recommended Posts

I would like to create two tabs (Tab1 and Tab2) on the top level, 3 tabs in Tab1 and 2 tabs in Tab2:

static PRM_Name	level1SwitcherName("Level1");
static PRM_Default	level1Switcher[] = {
	PRM_Default(3, "Tab1"),
	PRM_Default(2, "Tab2"),
};

static PRM_Name		level2SwitcherName("Level2");
static PRM_Default	 level2Switcher[] = {
	PRM_Default(3, "Tab1Child1"),
	PRM_Default(2, "Tab1Child2"),
	PRM_Default(1, "Tab1Child3"),
	PRM_Default(5, "Tab2Child1"),
	PRM_Default(6, "Tab2Child2")
};

PRM_Template
SOP_MegaOP::myTemplateList[] = {
	PRM_Template(PRM_SWITCHER,  sizeof(level1Switcher)/sizeof(PRM_Default), &level1SwitcherName, level1Switcher),
	PRM_Template(PRM_SWITCHER,  sizeof(level2Switcher)/sizeof(PRM_Default), &level2SwitcherName, level2Switcher),

		...

	PRM_Template()
};

So I expect that this code should give me what I want (Tab1->Tab1Child1, Tab1Child2, Tab1Child3 and Tab2->Tab2Child1, Tab2Child2) but result is a little bit confusing(Tab1->Tab1Child1, Tab1Child2, Tab1Child3, Tab2Child1, Tab2Child2 and nothing in Tab2). Even if I change PRM_Default(3, "Tab1") to PRM_Default(1, "Tab1") result is the same. So I've missed something but what?

Edited by hoknamahn
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...