Skip to content

Commit

Permalink
Merge pull request baykovr#48 from AdamJamesNaylor/master
Browse files Browse the repository at this point in the history
Added ability to double click items in profile to edit them
  • Loading branch information
baykovr committed Jan 14, 2016
2 parents 3ebc171 + e273a48 commit 6a5da2e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 37 deletions.
24 changes: 13 additions & 11 deletions GAVPI/GAVPI/GUI/frmProfile.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 32 additions & 26 deletions GAVPI/GAVPI/GUI/frmProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,30 +178,28 @@ private void logicalToolStripMenuItem1_Click(object sender, EventArgs e)
}

// Edit Trigger
private void editToolStripMenuItem_Click(object sender, EventArgs e)
{
if (dgTriggers.MultiSelect == true)
{
private void editToolStripMenuItem_Click(object sender, EventArgs e) {
EditTrigger();
}

private void EditTrigger() {
if (dgTriggers.MultiSelect == true) {
throw new NotImplementedException("Editing mutliple triggers at once is unsupported.");
}
foreach (DataGridViewRow row in this.dgTriggers.SelectedRows)
{
foreach (DataGridViewRow row in this.dgTriggers.SelectedRows) {
VI_Trigger selected_trigger = row.DataBoundItem as VI_Trigger;
if (selected_trigger != null)
{
frm_AddEdit_PhraseTrigger newTrigger = new frm_AddEdit_PhraseTrigger( selected_trigger );

if( newTrigger.ShowDialog() == DialogResult.OK ) {
if (selected_trigger != null) {
frm_AddEdit_PhraseTrigger newTrigger = new frm_AddEdit_PhraseTrigger(selected_trigger);

if (newTrigger.ShowDialog() == DialogResult.OK) {
ProfileEdited();

refresh_dgTriggers();

} // if()

refresh_dgTriggers();
} // if()
}
}

}

// Delete Trigger
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -323,23 +321,24 @@ private void newToolStripMenuItem1_Click(object sender, EventArgs e)
refresh_dgActionSequences();
}
// Edit Action Sequence
private void editToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (dgActionSequences.MultiSelect == true)
{
private void editToolStripMenuItem1_Click(object sender, EventArgs e) {
EditActionSequence();
}

private void EditActionSequence() {
if (dgActionSequences.MultiSelect == true) {
throw new NotImplementedException("Editing multiple sequences at once is unsupported.");
}
foreach (DataGridViewRow row in this.dgActionSequences.SelectedRows)
{
foreach (DataGridViewRow row in this.dgActionSequences.SelectedRows) {
VI_Action_Sequence sequence_to_edit = row.DataBoundItem as VI_Action_Sequence;
frm_AddEdit_ActionSequence newActionSequence = new frm_AddEdit_ActionSequence( sequence_to_edit );

if( newActionSequence.ShowDialog() == DialogResult.OK ) ProfileEdited();

frm_AddEdit_ActionSequence newActionSequence = new frm_AddEdit_ActionSequence(sequence_to_edit);

if (newActionSequence.ShowDialog() == DialogResult.OK) ProfileEdited();
}
refresh_dgActionSequences();
refresh_dgTriggerEvents();
}

// Delete Action Sequence
private void deleteToolStripMenuItem1_Click(object sender, EventArgs e)
{
Expand Down Expand Up @@ -624,6 +623,13 @@ private void AssociatedProcessTextBox_TextChanged( object sender, EventArgs e )

} // private void AssociatedProcessTextBox_LostFocus( object, EventArgs )

private void dgActionSequences_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) {
EditActionSequence();
}

private void dgTriggers_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) {
EditTrigger();
}
}

}

0 comments on commit 6a5da2e

Please sign in to comment.