private void btnNewLoop_Click(object sender, EventArgs e) { if (_loopPanes.Count > 0) { _loopPanes[_loopPanes.Count - 1].IsLastLoop = false; } ViewLoop newLoop = _editingView.AddNewLoop(); ViewLoopEditor newPane = AddNewLoopPane(newLoop); btnNewLoop.Top = 10 + newPane.Top + newPane.Height; btnDeleteLastLoop.Top = btnNewLoop.Top; btnDeleteLastLoop.Visible = true; viewPreview.ViewUpdated(); }
private ViewLoopEditor AddNewLoopPane(ViewLoop loop) { ViewLoopEditor loopPane = new ViewLoopEditor(loop, _guiController); loopPane.Left = 10; loopPane.Top = 10 + _loopPanes.Count * loopPane.Height + editorPanel.AutoScrollPosition.Y; loopPane.SelectedFrameChanged += new ViewLoopEditor.SelectedFrameChangedHandler(loopPane_SelectedFrameChanged); loopPane.NewFrameAdded += new ViewLoopEditor.NewFrameAddedHandler(loopPane_NewFrameAdded); if (loop.ID == _editingView.Loops.Count - 1) { loopPane.IsLastLoop = true; } loopPane.Enter += new EventHandler(loopPane_GotFocus); //loopPane.GotFocus += new EventHandler(loopPane_GotFocus); //loopPane.Leave += new EventHandler(loopPane_GotFocus); editorPanel.Controls.Add(loopPane); _loopPanes.Add(loopPane); return(loopPane); }
private void InitializeControls() { int lastPaneY = 10; foreach (ViewLoop loop in _editingView.Loops) { ViewLoopEditor loopPane = AddNewLoopPane(loop); lastPaneY = loopPane.Top + loopPane.Height; } btnNewLoop.Left = 10; btnDeleteLastLoop.Left = btnNewLoop.Left + btnNewLoop.Width + 10; btnNewLoop.Top = 10 + lastPaneY; btnDeleteLastLoop.Top = btnNewLoop.Top; if (_editingView.Loops.Count == 0) { btnDeleteLastLoop.Visible = false; } }
private ViewLoopEditor AddNewLoopPane(ViewLoop loop) { ViewLoopEditor loopPane = new ViewLoopEditor(loop, _guiController); loopPane.Left = 10; loopPane.Top = 10 + _loopPanes.Count * loopPane.Height + editorPanel.AutoScrollPosition.Y; loopPane.SelectedFrameChanged += new ViewLoopEditor.SelectedFrameChangedHandler(loopPane_SelectedFrameChanged); loopPane.NewFrameAdded += new ViewLoopEditor.NewFrameAddedHandler(loopPane_NewFrameAdded); if (loop.ID == _editingView.Loops.Count - 1) { loopPane.IsLastLoop = true; } loopPane.Enter += new EventHandler(loopPane_GotFocus); //loopPane.GotFocus += new EventHandler(loopPane_GotFocus); //loopPane.Leave += new EventHandler(loopPane_GotFocus); editorPanel.Controls.Add(loopPane); _loopPanes.Add(loopPane); return loopPane; }