2014-01-08 09:46:57 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
|
|
|
{
|
|
|
|
|
internal partial class HintsPanel : UserControl
|
|
|
|
|
{
|
|
|
|
|
public HintsPanel() {
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
hints.Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void SetHints(string[] hintsText) {
|
|
|
|
|
hints.Clear();
|
2014-01-09 11:31:34 +00:00
|
|
|
|
if(hintsText.Length == 0) return;
|
2014-01-08 09:46:57 +00:00
|
|
|
|
|
2014-01-09 11:31:34 +00:00
|
|
|
|
//convert to rtf markup
|
|
|
|
|
hintsText[0] = "{\\rtf1" + hintsText[0];
|
|
|
|
|
hintsText[hintsText.Length - 1] += "}";
|
2014-01-08 09:46:57 +00:00
|
|
|
|
|
2014-01-09 11:31:34 +00:00
|
|
|
|
hints.SelectedRtf = string.Join("\\par\\par ", hintsText).Replace("<b>", "{\\b ").Replace("</b>", "}");
|
2014-01-08 09:46:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal void ClearHints() {
|
|
|
|
|
hints.Clear();
|
|
|
|
|
}
|
2014-01-09 11:31:34 +00:00
|
|
|
|
|
|
|
|
|
// Fight TextBoxes habit of not releasing the focus by using a carefully placed label
|
|
|
|
|
private void hints_Enter(object sender, EventArgs e) {
|
|
|
|
|
label1.Focus();
|
|
|
|
|
}
|
2014-01-08 09:46:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|