-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,021 additions
and
978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,84 @@ | ||
namespace EasyCPDLC | ||
using System; | ||
using System.Drawing; | ||
using System.Windows.Forms; | ||
|
||
namespace EasyCPDLC | ||
{ | ||
class CPDLCMessage : System.Windows.Forms.Label | ||
public class CPDLCMessage : Label | ||
{ | ||
|
||
public string type; | ||
public bool acknowledged = false; | ||
public string recipient; | ||
public string message; | ||
public bool outbound; | ||
private string storedText; | ||
|
||
public CPDLCResponse header; | ||
|
||
public CPDLCMessage() | ||
{ | ||
|
||
} | ||
public CPDLCMessage(string _type, string _recipient, string _message, bool _outbound = false, CPDLCResponse _header = null) | ||
{ | ||
type = _type; | ||
recipient = _recipient; | ||
message = _message; | ||
outbound = _outbound; | ||
header = _header; | ||
SetStyle(ControlStyles.Selectable, true); | ||
} | ||
|
||
public void OverrideText(string newText) | ||
{ | ||
storedText = Text; | ||
Console.WriteLine(storedText); | ||
Invoke(new Action(() => Text = newText)); | ||
} | ||
|
||
public void RestoreText() | ||
{ | ||
Invoke(new Action(() => Text = storedText)); | ||
} | ||
|
||
protected override void OnEnter(EventArgs e) | ||
{ | ||
ForeColor = Color.Orange; | ||
} | ||
|
||
protected override void OnLeave(EventArgs e) | ||
{ | ||
ForeColor = SystemColors.ControlDark; | ||
} | ||
} | ||
|
||
public class CPDLCResponse | ||
{ | ||
public string dataType { get; set; } | ||
public int messageID { get; set; } | ||
public int responseID { get; set; } | ||
public string responses { get; set; } | ||
public string DataType { get; set; } | ||
public int MessageID { get; set; } | ||
public int ResponseID { get; set; } | ||
public string Responses { get; set; } | ||
|
||
} | ||
|
||
public class AccessibleLabel : Label | ||
{ | ||
private readonly Color foreColor; | ||
public AccessibleLabel(Color _foreColor) | ||
{ | ||
SetStyle(ControlStyles.Selectable, true); | ||
foreColor = _foreColor; | ||
} | ||
|
||
protected override void OnEnter(EventArgs e) | ||
{ | ||
ForeColor = Color.Orange; | ||
} | ||
|
||
protected override void OnLeave(EventArgs e) | ||
{ | ||
ForeColor = foreColor; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.