protected override void OnInit(EventArgs e) { ItemTemplate = new TreeViewTemplate(); Items.Add(new RadComboBoxItem()); base.OnInit(e); OnClientDropDownOpened = "dnn.controls.termsSelector.OnClientDropDownOpened"; if (!string.IsNullOrEmpty(CssClass)) { CssClass = string.Format("{0} TermsSelector", CssClass); } else { CssClass = "TermsSelector"; } }
protected override void OnInit(EventArgs e) { ItemTemplate = new TreeViewTemplate(); Items.Add(new RadComboBoxItem()); base.OnInit(e); OnClientDropDownOpened = "webcontrols.termsSelector.OnClientDropDownOpened"; if (!string.IsNullOrEmpty(CssClass)) { CssClass = string.Format("{0} TermsSelector", CssClass); } else { CssClass = "TermsSelector"; } }
protected override void OnInit(EventArgs e) { ItemTemplate = new TreeViewTemplate(); Items.Add(new RadComboBoxItem()); base.OnInit(e); JavaScript.RequestRegistration(CommonJs.jQueryMigrate); OnClientDropDownOpened = "webcontrols.termsSelector.OnClientDropDownOpened"; if (!string.IsNullOrEmpty(CssClass)) { CssClass = string.Format("{0} TermsSelector", CssClass); } else { CssClass = "TermsSelector"; } }
protected override void OnSettingUp() { base.OnSettingUp(); var nameTemplate = new TextEntryTemplate { Label = "Name: ", MaximumCharacters = 20, // HasFrameBorder = false, TopLeftPos = new Point(2, 2), Tooltip = "Enter your character's name", StartingField = "player", CanHaveKeyboardFocus = true, Pigments = new PigmentAlternatives() { { PigmentType.FrameNormal, new Pigment(ColorPresets.White, ColorPresets.Black) }, { PigmentType.ViewNormal, new Pigment(ColorPresets.White, ColorPresets.Black) }, { PigmentType.ViewSelected, new Pigment(ColorPresets.Green, ColorPresets.Black) } } }; _nameEntry = new TextEntry(nameTemplate); AddControl(_nameEntry); var jobs = new List <ListItemData>(); for (int i = 0; i < 2; i++) { jobs.Add(new ListItemData("jobs" + i)); } var occupationTemplate = new ListBoxTemplate() { Title = "Occupation", TitleAlignment = HorizontalAlignment.Center, MinimumListBoxWidth = 15, FrameTitle = true, AutoSizeOverride = new Size(15, 10), Items = jobs }; occupationTemplate.AlignTo(LayoutDirection.South, nameTemplate); _occupationListBox = new ListBox(occupationTemplate); AddControl(_occupationListBox); jobs.Add(new ListItemData("test")); var sexTemplate = new MenuButtonTemplate() { Label = "Sex", // MinimumWidth = 15, TopLeftPos = nameTemplate.CalculateRect().TopRight.Shift(2, 0), // Tooltip = "Click to switch sex, right click to choose from a menu", Items = new List <string>() { "Male", "Female" }, }; _sexButton = new MenuButton(sexTemplate); AddControl(_sexButton); var nodes = new List <TreeNode>(); int index = 0; for (int i = 0; i < 5; i++) { var treeNode = new TreeNode("category" + i); nodes.Add(treeNode); for (int j = 0; j < 10; j++) { treeNode.AddChild(new TreeNode("jobs" + index)); index++; } } var treeTemplate = new TreeViewTemplate() { Title = "Occupation", TitleAlignment = HorizontalAlignment.Center, MinimumListBoxWidth = 15, FrameTitle = true, AutoSizeOverride = new Size(15, 10), Items = nodes }; treeTemplate.AlignTo(LayoutDirection.South, sexTemplate, 1); AddControl(new TreeView(treeTemplate)); var treeTemplate1 = new TreeViewTemplate { Title = "Occupation", TitleAlignment = HorizontalAlignment.Center, MinimumListBoxWidth = 15, FrameTitle = true, AutoSizeOverride = new Size(15, 10), Items = nodes.Where((n, i) => i % 10 == 0).ToList(), }; treeTemplate1.AlignTo(LayoutDirection.South, treeTemplate, 1); AddControl(new TreeView(treeTemplate1)); var sliderTestTemplate = new SliderTemplate() { Label = "Slider", ShowLabel = true, HasFrameBorder = false, MinimumWidth = 22, MaximumValue = 100, StartingValue = 50, }; sliderTestTemplate.AlignTo(LayoutDirection.South, occupationTemplate); var sliderTest = new Slider(sliderTestTemplate); AddControl(sliderTest); var doneTemplate = new ButtonTemplate() { Label = "Press [Enter] Finish", }; doneTemplate.SetBottomRight(ScreenRect.BottomRight.Shift(-1, -1)); var doneButton = new Button(doneTemplate); doneButton.ButtonPushed += StartNewGame; AddControl(doneButton); KeyPressed += CharGen_KeyPressed; }
protected override void OnInit(EventArgs e) { ItemTemplate = new TreeViewTemplate(); Items.Add(new RadComboBoxItem()); base.OnInit(e); }