mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed bug when the status panel did not work
This commit is contained in:
parent
2af83d4b1d
commit
9de470dfa7
2 changed files with 16 additions and 10 deletions
1
Crypto Notepad/MainForm.Designer.cs
generated
1
Crypto Notepad/MainForm.Designer.cs
generated
|
|
@ -957,6 +957,7 @@ public void InitializeComponent()
|
|||
this.statusPanel.Name = "statusPanel";
|
||||
this.statusPanel.Size = new System.Drawing.Size(484, 22);
|
||||
this.statusPanel.TabIndex = 18;
|
||||
this.statusPanel.VisibleChanged += new System.EventHandler(this.StatusPanel_VisibleChanged);
|
||||
//
|
||||
// statusPanelLabel
|
||||
//
|
||||
|
|
|
|||
|
|
@ -430,28 +430,25 @@ private async void StatusPanelMessage(string type)
|
|||
|
||||
private void StatusPanelTextInfo()
|
||||
{
|
||||
int currentColumn = 0;
|
||||
int currentLine = 0;
|
||||
int linesCount = 0;
|
||||
if (statusPanel.Visible)
|
||||
{
|
||||
currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
|
||||
int currentColumn = 1 + richTextBox.SelectionStart - richTextBox.GetFirstCharIndexOfCurrentLine();
|
||||
RichTextBox rtb = new RichTextBox
|
||||
{
|
||||
WordWrap = false,
|
||||
Text = richTextBox.Text
|
||||
};
|
||||
currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
|
||||
linesCount = richTextBox.Lines.Count();
|
||||
int currentLine = 1 + rtb.GetLineFromCharIndex(richTextBox.SelectionStart);
|
||||
int linesCount = richTextBox.Lines.Count();
|
||||
if (linesCount == 0)
|
||||
{
|
||||
linesCount = 1;
|
||||
}
|
||||
statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength;
|
||||
statusPaneLinesLabel.Text = "Lines: " + linesCount;
|
||||
statusPaneLnLabel.Text = "Ln: " + currentLine;
|
||||
statusPaneColLabel.Text = "Col: " + currentColumn;
|
||||
}
|
||||
statusPanelLengthLabel.Text = "Length: " + richTextBox.TextLength;
|
||||
statusPaneLinesLabel.Text = "Lines: " + linesCount;
|
||||
statusPaneLnLabel.Text = "Ln: " + currentLine;
|
||||
statusPaneColLabel.Text = "Col: " + currentColumn;
|
||||
}
|
||||
|
||||
private void LockFile()
|
||||
|
|
@ -659,6 +656,13 @@ public void ToolbarIcons(bool oldIcons)
|
|||
|
||||
|
||||
#region Event Handlers
|
||||
private void StatusPanel_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (statusPanel.Visible)
|
||||
{
|
||||
StatusPanelTextInfo();
|
||||
}
|
||||
}
|
||||
private void LineNumbers_VisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (lineNumbers.Visible)
|
||||
|
|
@ -1769,6 +1773,7 @@ private void VariablesMainMenu_Click(object sender, EventArgs e)
|
|||
Debug.WriteLine("EditorMenuStrip: " + contextMenu.Enabled);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue