public StateEditor() { InitializeComponent(); _radBasePanel = new RadPanel(base_panel); _codeBox.Dock = DockStyle.Fill; CodePage.Controls.Add(_codeBox); _radBasePanel.Name = "base_panel"; _currentCtrl = _radBasePanel; MainPropGrid.SelectedObject = _radBasePanel; }
private void PanelButton_Click(object sender, EventArgs e) { Panel newPanel = new Panel(); RadPanel radPanel = new RadPanel(newPanel) {Name = "control_" + _controls.Count}; newPanel.MouseDown += Object_MouseDown; newPanel.MouseMove += Object_MouseMove; newPanel.MouseUp += Object_MouseUp; newPanel.Paint += Object_Paint; radPanel.X = radPanel.Y = 3; radPanel.W = 64; radPanel.H = 32; if (_currentCtrl is RadPanel) { radPanel.Parent = _currentCtrl; _currentCtrl.Preview.Controls.Add(newPanel); } else { radPanel.Parent = _radBasePanel; base_panel.Controls.Add(newPanel); } _controls.Add(radPanel); }