Crystal icon indicating copy to clipboard operation
Crystal copied to clipboard

The content of the server message window cannot be cleared. Adding a double-click message window to clear console messages does not clear the content saved to the file.

Open zhaokai1982 opened this issue 7 months ago • 4 comments

  1. The interface of the client login program is misaligned, and the interface has been fixed.

  2. The content of the server message window cannot be cleared. Adding a double-click message window to clear console messages does not clear the content saved to the file. Text logs are always retained.

  3. It is also necessary to add confirmation when the server program is closed, otherwise it is easy to mistakenly close the server and close the conversation without confirmation.

     // Double click on the log window to clear the content (with confirmation)
     private void LogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the log content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             LogTextBox.Clear();
         }
     }
    
     //Double click in the debugging window to clear the content (with confirmation)
     private void DebugLogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the debugging content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             DebugLogTextBox.Clear();
         }
     }
    
     //Double click in chat window to clear content (with confirmation)
     private void ChatLogTextBox_DoubleClick(object sender, EventArgs e)
     {
         if (MessageBox.Show("Are you sure you want to clear the chat content?", "Confirm to clear", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             ChatLogTextBox.Clear();
         }
     }
    
     private void MainMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
     {
    
     }
    

zhaokai1982 avatar Jun 07 '25 11:06 zhaokai1982

  Additional binding events need to be added in the upper part, as shown below.

The above code and the following code are added to \Crystal\Server. MirForms\SMain. cs

        public SMain()
    {
        InitializeComponent();

        AutoResize();
        //Double click the event to clear the content
        LogTextBox.DoubleClick += LogTextBox_DoubleClick;
        DebugLogTextBox.DoubleClick += DebugLogTextBox_DoubleClick;
        ChatLogTextBox.DoubleClick += ChatLogTextBox_DoubleClick;
    }

zhaokai1982 avatar Jun 07 '25 11:06 zhaokai1982

If you're wanting to contribute changes to the source please create pull requests. Pasted code in issues will not be added.

Suprcode avatar Jun 07 '25 11:06 Suprcode

I understand, but access to GIT is restricted in our country and region, and submissions always fail

zhaokai1982 avatar Jun 07 '25 12:06 zhaokai1982

But you can access this website, and you have repos on your account so you should be able to fork this repo and make edits to create a pull request. Even if access is blocked through other means.

Suprcode avatar Jun 07 '25 14:06 Suprcode