private void textBoxBananaPos_TextChanged(object sender, EventArgs e) { if (treeStageLayout.SelectedNode == null || treeStageLayout.SelectedNode.Tag == null || !(treeStageLayout.SelectedNode.Tag is StageLayoutBanana)) { return; } StageLayoutBanana b = (StageLayoutBanana)treeStageLayout.SelectedNode.Tag; float val = 0; Vector3 pos = b.Position; TextBox tb = (TextBox)sender; if (float.TryParse(tb.Text, out val)) { if (tb == textBoxBananaX) { pos.X = val; } if (tb == textBoxBananaY) { pos.Y = val; } if (tb == textBoxBananaZ) { pos.Z = val; } } b.Position = pos; treeStageLayout.SelectedNode.Tag = b; mainWindow.paneStageViewer.InvalidateGL(); }
private void treeStageLayout_AfterSelect(object sender, TreeViewEventArgs e) { tableBanana.Visible = false; mainTable.RowStyles.Clear(); mainTable.RowStyles.Add(new RowStyle(SizeType.Percent, 100)); if (treeStageLayout.SelectedNode != null) { if (treeStageLayout.SelectedNode.Tag != null) { if (treeStageLayout.SelectedNode.Tag is StageLayoutBanana) { mainTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 120)); mainTable.SetCellPosition(tableBanana, new TableLayoutPanelCellPosition(0, 1)); tableBanana.Visible = true; StageLayoutBanana b = (StageLayoutBanana)treeStageLayout.SelectedNode.Tag; textBoxBananaX.Text = b.Position.X.ToString(); textBoxBananaY.Text = b.Position.Y.ToString(); textBoxBananaZ.Text = b.Position.Z.ToString(); if (b.Type == StageLayoutBanana.BananaType.Single) { comboBananaType.SelectedIndex = comboBananaType.Items.IndexOf("Single"); } else { comboBananaType.SelectedIndex = comboBananaType.Items.IndexOf("Bunch"); } } } } }
private void comboBananaType_SelectedValueChanged(object sender, EventArgs e) { if (treeStageLayout.SelectedNode == null || treeStageLayout.SelectedNode.Tag == null || !(treeStageLayout.SelectedNode.Tag is StageLayoutBanana)) { return; } StageLayoutBanana b = (StageLayoutBanana)treeStageLayout.SelectedNode.Tag; b.Type = comboBananaType.SelectedText == "Single" ? StageLayoutBanana.BananaType.Single : StageLayoutBanana.BananaType.Bunch; treeStageLayout.SelectedNode.Tag = b; }