Skip to content

Commit

Permalink
Finished Help Button
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Nov 10, 2019
1 parent 2605c17 commit 4d96a26
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 12 deletions.
48 changes: 36 additions & 12 deletions SuperGrate/Main.Designer.cs

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

35 changes: 35 additions & 0 deletions SuperGrate/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;
using System.Drawing;

namespace SuperGrate
{
Expand Down Expand Up @@ -35,6 +36,27 @@ private void Main_Load(object sender, EventArgs e)
Logger.Success("Welcome to Super Grate! v" + Application.ProductVersion);
Logger.Information("Enter some information to get started!");
UpdateFormRestrictions();
BindHelp(this);
}
private void BindHelp(Control control)
{
foreach (Control childControl in control.Controls)
{
childControl.MouseEnter += Control_Click;
if(childControl.HasChildren)
{
BindHelp(childControl);
}
}
}
private void Control_Click(object sender, EventArgs e)
{
if (Cursor == Cursors.Help)
{
Point mouse = MousePosition;
mouse.Offset(50, 50);
Help.ShowPopup(this, helpProvider.GetHelpString((Control)sender), mouse);
}
}
private RunningTask Running {
get {
Expand Down Expand Up @@ -340,6 +362,19 @@ private void lbxUsers_KeyDown(object sender, KeyEventArgs e)
btStartStop.PerformClick();
}
}
private void miHelpButton_Click(object sender, EventArgs e)
{
if (Cursor == Cursors.Help)
{
miHelpButton.Checked = false;
Cursor = Cursors.Default;
}
else
{
miHelpButton.Checked = true;
Cursor = Cursors.Help;
}
}
}
public enum ListSources
{
Expand Down
3 changes: 3 additions & 0 deletions SuperGrate/Main.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
<metadata name="helpProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>258, 17</value>
</metadata>
<metadata name="helpProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>258, 17</value>
</metadata>
<data name="lbxUsers.HelpString" xml:space="preserve">
<value>This box is a list of the user profiles on either the source computer or the store. To tell the difference, look to the left. (You can multi-select by holding down the mouse, or by holding shift / ctrl key on the keyboard. To un-select a profile, hold down the crtl key and click.)</value>
</data>
Expand Down

0 comments on commit 4d96a26

Please sign in to comment.