예제 #1
0
파일: Form1.cs 프로젝트: jjmucci/stserver
        // This is a one off function that is called the first time the MainLoop()
        // function runs, it just sets up a few of the UI elements that only need
        // updating once.
        private void SetupFormLayout()
        {
            // need validator class instance
            if (Hopper == null)
            {
                MessageBox.Show("Validator class is null.", "ERROR");
                return;
            }

            // Positioning
            int x = 555, y = 30;

            Label lbl = new Label();

            lbl.Location = new Point(x, y);
            lbl.Size     = new Size(70, 35);
            lbl.Name     = "lbl";
            lbl.Text     = "Recycle\nChannels:";
            Controls.Add(lbl);

            y += 20;
            for (int i = 1; i <= Hopper.NumberOfChannels; i++)
            {
                CheckBox c = new CheckBox();
                c.Location        = new Point(x, y + (i * 20));
                c.Name            = i.ToString();
                c.Text            = CHelpers.FormatToCurrency(Hopper.GetChannelValue(i)) + " " + new String(Hopper.GetChannelCurrency(i));
                c.Checked         = Hopper.IsChannelRecycling(i);
                c.CheckedChanged += new EventHandler(recycleBox_CheckedChange);
                Controls.Add(c);
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: kalkansa/stserver
        // This is a one off function that is called the first time the MainLoop()
        // function runs, it just sets up a few of the UI elements that only need
        // updating once.
        private void SetupFormLayout()
        {
            // Basic Validator UI setup

            // Get channel levels in hopper
            tbCoinLevels.Text = Hopper.GetChannelLevelInfo();

            // setup list of recyclable channel tick boxes based on OS type
            System.OperatingSystem osInfo = System.Environment.OSVersion;
            int x = 560, y = 47;

            Label l = new Label();

            l.Location = new Point(x, y);
            l.Size     = new Size(65, 38);
            l.Name     = "lblRecycleCheckBoxes";
            l.Text     = "Recycle\nChannels:";
            Controls.Add(l);

            for (int i = 1; i <= Hopper.NumberOfChannels; i++)
            {
                CheckBox c = new CheckBox();
                c.Location = new Point(x, y + 15 + (i * 20));
                c.Name     = i.ToString();
                c.Text     = CHelpers.FormatToCurrency(Hopper.GetChannelValue(i)) +
                             " " + new String(Hopper.GetChannelCurrency(i));
                c.Checked         = Hopper.IsChannelRecycling(i);
                c.CheckedChanged += new EventHandler(recycleBox_CheckedChange);
                Controls.Add(c);
            }
        }
예제 #3
0
파일: Form1.cs 프로젝트: kalkansa/stserver
        // This is a one off function that is called the first time the MainLoop()
        // function runs, it just sets up a few of the UI elements that only need
        // updating once.
        private void SetupFormLayout()
        {
            // Note float UI setup

            // Find number and value of channels in NV11 and update combo box
            cbRecycleChannelNV11.Items.Add("No recycling");
            foreach (ChannelData d in NV11.UnitDataList)
            {
                cbRecycleChannelNV11.Items.Add(d.Value / 100 + " " + new String(d.Currency));
            }
            cbRecycleChannelNV11.SelectedIndex = 0;

            // Get channel levels in hopper
            tbCoinLevels.Text = Hopper.GetChannelLevelInfo();

            // setup list of recyclable channel tick boxes
            int x = 0, y = 0;

            x = 465;
            y = 30;

            Label lbl = new Label();

            lbl.Location = new Point(x, y);
            lbl.Size     = new Size(70, 35);
            lbl.Name     = "lbl";
            lbl.Text     = "Recycle\nChannels:";
            Controls.Add(lbl);

            y += 20;
            for (int i = 1; i <= Hopper.NumberOfChannels; i++)
            {
                CheckBox c = new CheckBox();
                c.Location        = new Point(x, y + (i * 20));
                c.Name            = i.ToString();
                c.Text            = CHelpers.FormatToCurrency(Hopper.GetChannelValue(i)) + " " + new String(Hopper.GetChannelCurrency(i));
                c.Checked         = Hopper.IsChannelRecycling(i);
                c.CheckedChanged += new EventHandler(recycleBox_CheckedChange);
                Controls.Add(c);
            }
        }
예제 #4
0
파일: Form1.cs 프로젝트: kalkansa/stserver
        // This is a one off function that is called the first time the MainLoop()
        // function runs, it just sets up a few of the UI elements that only need
        // updating once.
        private void SetupFormLayout()
        {
            // Get channel levels in hopper
            tbCoinLevels.Text = Hopper.GetChannelLevelInfo();

            // setup list of recyclable channel tick boxes based on OS type
            System.OperatingSystem osInfo = System.Environment.OSVersion;
            int x1 = 0, y1 = 0, x2 = 0, y2 = 0;

            // XP, 2000, Server 2003
            if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 5)
            {
                x1 = this.Location.X + 455;
                y1 = this.Location.Y + 10;
                x2 = this.Location.X + 780;
                y2 = this.Location.Y + 10;
            }
            // Vista, 7
            else if (osInfo.Platform == PlatformID.Win32NT && osInfo.Version.Major == 6)
            {
                x1 = this.Location.X + 458;
                y1 = this.Location.Y + 12;
                x2 = this.Location.X + 780;
                y2 = this.Location.Y + 12;
            }

            GroupBox g1 = new GroupBox();

            g1.Size     = new Size(100, 380);
            g1.Location = new Point(x1, y1);
            g1.Text     = "Hopper Recycling";

            GroupBox g2 = new GroupBox();

            g2.Size     = new Size(100, 380);
            g2.Location = new Point(x2, y2);
            g2.Text     = "Payout Recycling";

            // Hopper checkboxes
            for (int i = 1; i <= Hopper.NumberOfChannels; i++)
            {
                CheckBox c = new CheckBox();
                c.Location        = new Point(5, 20 + (i * 20));
                c.Name            = i.ToString();
                c.Text            = CHelpers.FormatToCurrency(Hopper.GetChannelValue(i)) + " " + new String(Hopper.GetChannelCurrency(i));
                c.Checked         = Hopper.IsChannelRecycling(i);
                c.CheckedChanged += new EventHandler(recycleBoxHopper_CheckedChange);
                g1.Controls.Add(c);
            }

            // Payout checkboxes
            for (int i = 1; i <= Payout.NumberOfChannels; i++)
            {
                CheckBox c = new CheckBox();
                c.Location = new Point(5, 20 + (i * 20));
                c.Name     = i.ToString();
                ChannelData d = new ChannelData();
                Payout.GetDataByChannel(i, ref d);
                c.Text            = CHelpers.FormatToCurrency(d.Value) + " " + new String(d.Currency);
                c.Checked         = d.Recycling;
                c.CheckedChanged += new EventHandler(recycleBoxPayout_CheckedChange);
                g2.Controls.Add(c);
            }

            Controls.Add(g1);
            Controls.Add(g2);
        }