<commit_before>﻿using System;
using System.Windows.Forms;
using System.Net;
using System.Drawing;
using System.Xml;

namespace RelhaxModpack
{
    public partial class SelectionViewer : Form
    {
        private int x, y;
        private WebClient client = new WebClient();
        private string url = "";
        private int difference;
        public string SelectedXML = "";
        private string SelectedDocument = "";
        private const int titleBar = 23;//set origionally for 23
        private int ttIndex = -1;
        public SelectionViewer(int xx, int yy, string urll)
        {
            InitializeComponent();
            //parse in the new ints location of where to display the application
            x = xx;
            y = yy;
            url = urll;
        }
        private void SelectionViewer_Load(object sender, EventArgs e)
        {
            this.Location = new Point(x, y);
            //setting UI color
            Settings.setUIColor(this);
            //font scaling
            this.AutoScaleMode = Settings.appScalingMode;
            this.Font = Settings.appFont;
            if (Settings.appScalingMode == System.Windows.Forms.AutoScaleMode.Dpi)
            {
                this.Scale(new SizeF(Settings.scaleSize, Settings.scaleSize));
            }
            //title bar height
            //get the size of the title bar window
            Rectangle screenRektangle = RectangleToScreen(this.ClientRectangle);
            int titleHeight = screenRektangle.Top - this.Top;
            //largest possible is 46
            //mine (programmed for) is 23
            if (titleHeight > titleBar)
            {
                difference = titleHeight - titleBar;
            }
            //this.DialogResult = DialogResult.Cancel;
            SelectConfigLabel.Text = Translations.getTranslatedString("loading");
            SelectButton.Text = Translations.getTranslatedString("select");
            CancelCloseButton.Text = Translations.getTranslatedString("cancel");

            SelectionRadioButton b = new SelectionRadioButton
            {
                XMLURL = "localFile",
                Text = Translations.getTranslatedString("localFile")
            };
            b.Location = new Point(6, (SelectConfigPanel.Controls.Count * (b.Size.Height-3)));
            SelectConfigPanel.Controls.Add(b);

            foreach (var node in Settings.developerSelections)
            {
                SelectionRadioButton bb = new SelectionRadioButton
                {
                    XMLURL = node.internalName,
                    Text = node.displayName
                };
                bb.Location = new Point(6, (SelectConfigPanel.Controls.Count * (b.Size.Height-3)));
                // add ToolTip to the develeopersSelections
                ToolTip rbToolTip = new ToolTip();
                // Set up the delays for the ToolTip.
                rbToolTip.AutoPopDelay = 5000;
                rbToolTip.InitialDelay = 1000;
                rbToolTip.ReshowDelay = 500;
                // Force the ToolTip text to be displayed whether or not the form is active.
                rbToolTip.ShowAlways = true;
                // Set up the ToolTip text for the Button and Checkbox.
                rbToolTip.SetToolTip(bb, node.date);
                SelectConfigPanel.Controls.Add(bb);
            }
        }

        /*
         // Create the ToolTip and associate with the Form container.
         ToolTip toolTip1 = new ToolTip();

         // Set up the delays for the ToolTip.
         toolTip1.AutoPopDelay = 5000;
         toolTip1.InitialDelay = 1000;
         toolTip1.ReshowDelay = 500;
         // Force the ToolTip text to be displayed whether or not the form is active.
         toolTip1.ShowAlways = true;

         // Set up the ToolTip text for the Button and Checkbox.
         toolTip1.SetToolTip(this.button1, "My button1");
         toolTip1.SetToolTip(this.checkBox1, "My checkBox1");
         */
        /*
        // https://stackoverflow.com/questions/802213/tooltips-for-checkedlistbox-items
        //Make ttIndex a global integer variable to store index of item currently showing tooltip.
        //Check if current location is different from item having tooltip, if so call method
        if (ttIndex != checkedListBox1.IndexFromPoint(e.Location))
                ShowToolTip();


        private void ShowToolTip()
        {
            ttIndex = checkedListBox1.IndexFromPoint(checkedListBox1.PointToClient(MousePosition));
            if (ttIndex > -1)
            {
                Point p = PointToClient(MousePosition);
                toolTip1.ToolTipTitle = "Tooltip Title";
                toolTip1.SetToolTip(checkedListBox1, checkedListBox1.Items[ttIndex].ToString());

            }
        }*/

        private void SelectButton_Click(object sender, EventArgs e)
        {
            SelectedDocument = this.getSelectedXMLDoc();
            if(SelectedDocument.Equals("-1"))
            {
                //error
                Utils.appendToLog("ERROR: Failed to parse XML File");
                SelectedXML = SelectedDocument;
            }
            else if (SelectedDocument.Equals("localFile"))
            {
                //local file dialog box
                SelectedXML = SelectedDocument;
                this.DialogResult = DialogResult.OK;
            }
            else
            {<commit_msg>removed unused code from SelectionViewer.cs (again => cleaning up is hard for me)<commit_after>﻿using System;
using System.Windows.Forms;
using System.Net;
using System.Drawing;
using System.Xml;

namespace RelhaxModpack
{
    public partial class SelectionViewer : Form
    {
        private int x, y;
        private WebClient client = new WebClient();
        private string url = "";
        private int difference;
        public string SelectedXML = "";
        private string SelectedDocument = "";
        private const int titleBar = 23;//set origionally for 23
        private int ttIndex = -1;
        public SelectionViewer(int xx, int yy, string urll)
        {
            InitializeComponent();
            //parse in the new ints location of where to display the application
            x = xx;
            y = yy;
            url = urll;
        }
        private void SelectionViewer_Load(object sender, EventArgs e)
        {
            this.Location = new Point(x, y);
            //setting UI color
            Settings.setUIColor(this);
            //font scaling
            this.AutoScaleMode = Settings.appScalingMode;
            this.Font = Settings.appFont;
            if (Settings.appScalingMode == System.Windows.Forms.AutoScaleMode.Dpi)
            {
                this.Scale(new SizeF(Settings.scaleSize, Settings.scaleSize));
            }
            //title bar height
            //get the size of the title bar window
            Rectangle screenRektangle = RectangleToScreen(this.ClientRectangle);
            int titleHeight = screenRektangle.Top - this.Top;
            //largest possible is 46
            //mine (programmed for) is 23
            if (titleHeight > titleBar)
            {
                difference = titleHeight - titleBar;
            }
            //this.DialogResult = DialogResult.Cancel;
            SelectConfigLabel.Text = Translations.getTranslatedString("loading");
            SelectButton.Text = Translations.getTranslatedString("select");
            CancelCloseButton.Text = Translations.getTranslatedString("cancel");

            SelectionRadioButton b = new SelectionRadioButton
            {
                XMLURL = "localFile",
                Text = Translations.getTranslatedString("localFile")
            };
            b.Location = new Point(6, (SelectConfigPanel.Controls.Count * (b.Size.Height-3)));
            SelectConfigPanel.Controls.Add(b);

            foreach (var node in Settings.developerSelections)
            {
                SelectionRadioButton bb = new SelectionRadioButton
                {
                    XMLURL = node.internalName,
                    Text = node.displayName
                };
                bb.Location = new Point(6, (SelectConfigPanel.Controls.Count * (b.Size.Height-3)));
                // add ToolTip to the develeopersSelections
                ToolTip rbToolTip = new ToolTip();
                // Set up the delays for the ToolTip.
                rbToolTip.AutoPopDelay = 5000;
                rbToolTip.InitialDelay = 1000;
                rbToolTip.ReshowDelay = 500;
                // Force the ToolTip text to be displayed whether or not the form is active.
                rbToolTip.ShowAlways = true;
                // Set up the ToolTip text for the Button and Checkbox.
                rbToolTip.SetToolTip(bb, node.date);
                SelectConfigPanel.Controls.Add(bb);
            }
        }

        private void SelectButton_Click(object sender, EventArgs e)
        {
            SelectedDocument = this.getSelectedXMLDoc();
            if(SelectedDocument.Equals("-1"))
            {
                //error
                Utils.appendToLog("ERROR: Failed to parse XML File");
                SelectedXML = SelectedDocument;
            }
            else if (SelectedDocument.Equals("localFile"))
            {
                //local file dialog box
                SelectedXML = SelectedDocument;
                this.DialogResult = DialogResult.OK;
            }
            else
            {
{'fraction_non_alphanumeric': 0.07969639468690702, 'fraction_numerical': 0.009065991988193127, 'mean_word_length': 1.6663856098931984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6181491', 'n_tokens_mistral': 2446, 'n_tokens_neox': 2274, 'n_words': 630}