Skip to content

Commit

Permalink
Added context menu back in.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Jan 25, 2020
1 parent cf1b990 commit 51f0321
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
44 changes: 43 additions & 1 deletion SuperGrate/Main.Designer.cs

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

20 changes: 19 additions & 1 deletion SuperGrate/Main.cs
Expand Up @@ -57,6 +57,9 @@ public Main(string[] parameters)
listUsers.LargeImageList = new ImageList();
listUsers.LargeImageList.ImageSize = new Size(32, 32);
listUsers.LargeImageList.Images.Add("user", Properties.Resources.user_32.ToBitmap());
miConDelete.SetMenuItemIcon(Properties.Resources.x);
miConProperties.SetMenuItemIcon(Properties.Resources.user);
miConStart.SetMenuItemIcon(Properties.Resources.go);
}
private void Main_Load(object sender, EventArgs e)
{
Expand Down Expand Up @@ -476,7 +479,7 @@ private void miAddRemoveCol_Click(object sender, EventArgs e)
}
}
}
private async void listUsers_DoubleClick(object sender, EventArgs e)
private async void OpenUserProperties_Event(object sender, EventArgs e)
{
if(listUsers.SelectedItems.Count == 1)
{
Expand Down Expand Up @@ -554,6 +557,21 @@ private void listUsers_ColumnClick(object sender, ColumnClickEventArgs e)
CurrentSortColumn[CurrentListSource] = selColumn;
listUsers.SetRows(CurrentUserRows, CurrentSortColumn[CurrentListSource], CurrentSortDirection[CurrentListSource]);
}
private void listUsers_MouseClick(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
if (listUsers.SelectedItems.Count == 1)
{
miConProperties.Enabled = true;
}
else
{
miConProperties.Enabled = false;
}
miConUser.Show((Control)sender, e.Location);
}
}
}
public enum ListSources
{
Expand Down
3 changes: 3 additions & 0 deletions SuperGrate/Main.resx
Expand Up @@ -126,4 +126,7 @@
<metadata name="dialogSaveLog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value>
</metadata>
<metadata name="miConUser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>379, 17</value>
</metadata>
</root>

0 comments on commit 51f0321

Please sign in to comment.