Esempio n. 1
0
 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     lbMsg.Hide();
     lbFio.Hide();
     pbPhoto.Hide();
     timer.Enabled = false;
 }
        /// <summary>
        /// Changes data of an existing Kunde/Kontakt
        /// </summary>
        /// <param name="k">The to-be-changed Kunde/Kontakt</param>
        /// <param name="errorlabel">The label in which errormessages may be written</param>
        public void Change(KundeKontaktTable k, Label errorlabel)
        {
            errorlabel.Hide();

            IRule lnhsv = new LettersNumbersHyphenSpaceValidator();
            IRule lhv = new LettersHyphenValidator();
            IRule lengthv = new StringLength150Validator();

            DataBindingFramework.BindFromString(k.Vorname, "Vorname", errorlabel, true, lhv, lengthv);
            DataBindingFramework.BindFromString(k.NachnameFirmenname, "Nachname", errorlabel, false, lnhsv, lengthv);

            if (errorlabel.Visible)
            {
                throw new InvalidInputException();
            }

            // else save new Kunde or Kontakt in database
            if (k.Vorname.Length == 0)
            {
                this.logger.Log(Logger.Level.Info, "No first name will be stored.");
            }

            this.logger.Log(Logger.Level.Info, "User requested to change " + (k.Type == false ? "Kunde" : "Kontakt") + " with ID " + k.ID);

            // Update data
            try
            {
                DALFactory.GetDAL().UpdateKundeKontakte(k);
            }
            catch (SQLiteException)
            {
                throw;
            }
        }
Esempio n. 3
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            _mergeModels = checkBox1.Checked;
            if (_mergeModels)
            {
                label1.Hide();
                comboBox1.Hide();
                _baseInf = (IMatrixNode)_externalModel._linker.BoneCache[0];
                switch (comboBox3.SelectedIndex)
                {
                case 0:
                    label2.Text = "Add base bone \"" + _baseInf + "\" to the children of: ";
                    break;

                case 1:
                    label2.Text = "With base bone \"" + _baseInf + "\", replace: ";
                    break;

                case 2:
                    label2.Text = "Merge base bone \"" + _baseInf + "\" with: ";
                    break;
                }
            }
            else
            {
                label1.Show();
                comboBox1.Show();
                getBaseInfluence();
            }
        }
Esempio n. 4
0
 public Form2()
 {
     InitializeComponent();
     hardB = new Button();
     promptL = new Label();
     easyB = new Button();
     medium = new Button();
     promptL.Text = "Please select a difficulty";
     promptL.AutoSize = true;
     promptL.Location = new Point(71, 9);
     medium.Location = new Point(94, 90);
     medium.Text = "Medium";
     medium.Click += medium_Click;
     easyB.Location = new Point(94, 55);
     easyB.Text = "Easy";
     easyB.Click += easy_Click;
     hardB.Location = new Point(94, 125);
     hardB.Text = "Hell";
     hardB.Click += hard_Click;
     this.Controls.Add(easyB);
     this.Controls.Add(promptL);
     this.Controls.Add(medium);
     this.Controls.Add(hardB);
     easyB.Hide();
     medium.Hide();
     hardB.Hide();
     promptL.Hide();
     hardB.Enabled = false;
 }
Esempio n. 5
0
        private void GetBaseInfluence()
        {
            ResourceNode[] boneCache = _externalModel._linker.BoneCache;
            if ((_node = (MDL0ObjectNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in _node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = (MDL0BoneNode)boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = _node.MatrixNode;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            baseBone.Text = _baseInf.ToString();

            if (comboBox3.SelectedIndex == 0 && _baseInf is MDL0BoneNode)
            {
                int i = 0;
                foreach (MDL0BoneNode s in comboBox2.Items)
                {
                    if (s.Name == baseBone.Text)
                    {
                        comboBox2.SelectedIndex = i;
                        break;
                    }
                    i++;
                }
            }

            modelPanel1.AddTarget(_node);
            Vector3 min, max;

            _node.GetBox(out min, out max);
            modelPanel1.SetCamWithBox(min, max);
        }
Esempio n. 6
0
        private void getBaseInfluence()
        {
            ResourceNode[] boneCache = _externalModel._linker.BoneCache;
            if ((node = (MDL0PolygonNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = (MDL0BoneNode)boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = node.SingleBindInf;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            switch (comboBox3.SelectedIndex)
            {
            case 0:
                label2.Text = "Add base bone \"" + _baseInf + "\" to the children of: ";
                break;

            case 1:
                label2.Text = "With base bone \"" + _baseInf + "\", replace: ";
                break;

            case 2:
                label2.Text = "Merge base bone \"" + _baseInf + "\" with: ";
                break;
            }

            comboBox2.Location = new Drawing.Point(label2.Size.Width + 20, 36);
            //Width = comboBox2.Location.X + 140;
        }
Esempio n. 7
0
    /// <summary>
    /// Constructor
    /// </summary>
    public CreateSessionForm(Peer peerObject, Address addressObject, ConnectWizard connectionWizard)
    {
        //
        // Required for Windows Form Designer support
        //
        InitializeComponent();

        peer = peerObject;
        this.connectionWizard = connectionWizard;
        deviceAddress         = addressObject;
        txtSession.Text       = null;
        this.Text             = connectionWizard.SampleName + " - " + this.Text;
        //Get the default session from the registry if it exists
        Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\DirectX\\SDK\\csDPlay");
        if (regKey != null)
        {
            // Get session name
            txtSession.Text = (string)regKey.GetValue("DirectPlaySessionName", null);

            // Get host migration option
            if (regKey.GetValue("DirectPlayMigrateHost", null) != null)
            {
                migrateHostCheckBox.Checked = ((int)regKey.GetValue("DirectPlayMigrateHost", 1) == 1);
            }


            // Get session signing option
            if (regKey.GetValue("DirectPlaySessionSigning", null) != null)
            {
                if ("Full" == (string)regKey.GetValue("DirectPlaySessionSigning", null))
                {
                    fullSignedRadio.Checked = true;
                }
                else if ("Fast" == (string)regKey.GetValue("DirectPlaySessionSigning", null))
                {
                    fastSignedRadio.Checked = true;
                }
                else
                {
                    notSignedRadio.Checked = true;
                }
            }

            regKey.Close();
        }

        // Set default port value and hide port UI if provider doesn't use them
        Port = connectionWizard.DefaultPort;
        if (!ConnectWizard.ProviderRequiresPort(deviceAddress.ServiceProvider))
        {
            localPortTextBox.Hide();
            localPortLabel.Hide();
        }
    }
Esempio n. 8
0
 private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     lbMsg.Hide();
     lbFio.Hide();
     pbPhoto.Hide();
     cbEmployees.Text = "";
     tbCode.Text      = "";
     tbCode.Focus();
     timer.Enabled  = false;
     timer.Interval = 1500;
 }
Esempio n. 9
0
        /* Shows appropriate message in the currently selected tab
         * ---------------------------------------------------------- */
        private void messageTabs_SelectionChanged(object sender, System.EventArgs e)
        {
            message.Hide();

            message.ForeColor = Color.Black;
            messageTabs.SelectedTab.Controls.Add(message);
            int index = messageTabs.SelectedIndex;

            message.Text = pageCollection[index].Message;
            this.Text    = "About " + this.ProductName + " - " + pageCollection[index].Name;
            UpdateUI(true);

            message.Show();
        }
Esempio n. 10
0
        private void m_btnSave_Click(object sender, System.EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            m_lb.Show();
            m_lb.BringToFront();
            long lngRes = ((clsControlCreatePlan)this.objController).m_lngCreatePlan(this.m_DTPStart.Value, this.m_DTPEnd.Value);

            if (lngRes >= 0)
            {
                this.IsRefresh = true;
            }
            m_lb.Hide();
            this.Cursor = Cursors.Default;
        }
Esempio n. 11
0
        public PlayerInventory()
        {
            InitializeComponent();

            this.equippedItemPositions.Add(new Position(x: 82, y: 10)); // head
            this.equippedItemPositions.Add(new Position(x: 12, y: 80)); // weapon
            this.equippedItemPositions.Add(new Position(x: 82, y: 80)); // chainmail
            this.equippedItemPositions.Add(new Position(x: 152, y: 80)); // gloves
            this.equippedItemPositions.Add(new Position(x: 82, y: 150)); // boots

            this.inventoryItemPositions.Add(new Position(x: 12, y: 220));
            this.inventoryItemPositions.Add(new Position(x: 82, y: 220));
            this.inventoryItemPositions.Add(new Position(x: 152, y: 220));
            this.inventoryItemPositions.Add(new Position(x: 222, y: 220));
            this.inventoryItemPositions.Add(new Position(x: 292, y: 220));
            this.inventoryItemPositions.Add(new Position(x: 12, y: 290));
            this.inventoryItemPositions.Add(new Position(x: 82, y: 290));
            this.inventoryItemPositions.Add(new Position(x: 152, y: 290));
            this.inventoryItemPositions.Add(new Position(x: 222, y: 290));
            this.inventoryItemPositions.Add(new Position(x: 292, y: 290));

            playerStats = new Label();
            playerStats.Left = 250;
            playerStats.Top = 20;
            playerStats.Width = 100;
            playerStats.Height = 150;
            playerStats.BackColor = Color.Transparent;
            playerStats.ForeColor = Color.White;
            playerStats.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
            Controls.Add(playerStats);

            statsBox = new Label();
            statsBox.Width = 104;
            statsBox.Height = 130;
            statsBox.BackColor = Color.Black;
            statsBox.ForeColor = Color.White;
            statsBox.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
            statsBox.TextAlign = ContentAlignment.TopCenter;
            statsBox.BackColor = Color.FromArgb(150, 0, 0, 0);
            Controls.Add(statsBox);
            statsBox.Hide();
        }
Esempio n. 12
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            modelPanel1.ClearTargets();

            _mergeModels = checkBox1.Checked;
            if (_mergeModels)
            {
                label1.Hide();
                comboBox1.Hide();
                _baseInf      = _externalModel._linker.BoneCache[0];
                baseBone.Text = _baseInf.ToString();

                modelPanel1.AddTarget(_externalModel, false);
                modelPanel1.SetCamWithBox(_externalModel.GetBox());
            }
            else
            {
                label1.Show();
                comboBox1.Show();
                GetBaseInfluence();
            }
        }
Esempio n. 13
0
        public EditListView()
        {
            //Action
            ActionCmbBox.Items.Add("");
            //ActionCmbBox.Items.Add("Lock Door Relay 01");
            //ActionCmbBox.Items.Add("Lock Door Relay 02");
            ActionCmbBox.Items.Add("Turn On Alarm Light Relay 01");
            ActionCmbBox.Items.Add("Turn On Alarm Light Relay 02");
            ActionCmbBox.Items.Add("Turn On Siren Relay 01");
            ActionCmbBox.Items.Add("Turn On Siren Relay 02");
            ActionCmbBox.Items.Add("Unlock Door Relay 01");
            ActionCmbBox.Items.Add("Unlock Door Relay 02");
            ActionCmbBox.Items.Add("Display Tag Moving Direction");
            ActionCmbBox.Items.Add("Call Access Tag");
            ActionCmbBox.Items.Add("Call Asset Tag");
            ActionCmbBox.Items.Add("Call Inventory Tag");
            ActionCmbBox.Items.Add("E-mail Event Activity");

            ActionCmbBox.Size     = new System.Drawing.Size(0, 0);
            ActionCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.ActionCmbBox });
            ActionCmbBox.SelectedIndexChanged += new System.EventHandler(this.ActionCmbSelected);
            ActionCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            ActionCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ActionCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ActionCmbBox.BackColor     = Color.SkyBlue;
            ActionCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ActionCmbBox.Hide();

            //Action
            ActionInputCmbBox.Items.Add("");
            ActionInputCmbBox.Items.Add("Input 01 Timeout");
            ActionInputCmbBox.Items.Add("Input 02 Timeout");
            //ActiInputonCmbBox.Items.Add("Lock Door Relay 01");
            //ActiInputonCmbBox.Items.Add("Lock Door Relay 02");
            ActionInputCmbBox.Items.Add("Turn On Alarm Light Relay 01");
            ActionInputCmbBox.Items.Add("Turn On Alarm Light Relay 02");
            ActionInputCmbBox.Items.Add("Turn On Siren Relay 01");
            ActionInputCmbBox.Items.Add("Turn On Siren Relay 02");
            ActionInputCmbBox.Items.Add("Call Access Tag");
            ActionInputCmbBox.Items.Add("Call Asset Tag");
            ActionInputCmbBox.Items.Add("Call Inventory Tag");
            ActionInputCmbBox.Items.Add("E-mail Event Activity");

            ActionInputCmbBox.Size     = new System.Drawing.Size(0, 0);
            ActionInputCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.Add(ActionInputCmbBox);
            ActionInputCmbBox.SelectedIndexChanged += new System.EventHandler(this.ActionInputCmbSelected);
            ActionInputCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            ActionInputCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ActionInputCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ActionInputCmbBox.BackColor     = Color.SkyBlue;
            ActionInputCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ActionInputCmbBox.Hide();


            //Duration
            for (int i = 1; i < 60; i++)
            {
                DurationCmbBox.Items.Add(i + " sec");
            }

            DurationCmbBox.Items.Add("1 min");
            DurationCmbBox.Items.Add("2 min");
            DurationCmbBox.Items.Add("3 min");
            DurationCmbBox.Items.Add("forever");

            DurationCmbBox.Size     = new System.Drawing.Size(0, 0);
            DurationCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.DurationCmbBox });
            DurationCmbBox.SelectedIndexChanged += new System.EventHandler(this.CmbSelected);
            DurationCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            DurationCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            DurationCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            DurationCmbBox.BackColor     = Color.SkyBlue;
            DurationCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            DurationCmbBox.Hide();

            //Reader ID
            ReaderCmbBox.Items.Add("0");

            ReaderCmbBox.Size     = new System.Drawing.Size(0, 0);
            ReaderCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.ReaderCmbBox });
            ReaderCmbBox.SelectedIndexChanged += new System.EventHandler(this.ReaderCmbSelected);
            ReaderCmbBox.Sorted        = true;
            ReaderCmbBox.LostFocus    += new System.EventHandler(HideControlFocusOver);
            ReaderCmbBox.KeyPress     += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            ReaderCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            ReaderCmbBox.BackColor     = Color.SkyBlue;
            ReaderCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            ReaderCmbBox.Hide();


            //FGen ID
            FGenCmbBox.Items.Add("0");
            FGenCmbBox.Text = "0";

            FGenCmbBox.Size     = new System.Drawing.Size(0, 0);
            FGenCmbBox.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.FGenCmbBox });
            FGenCmbBox.Sorted = true;
            FGenCmbBox.SelectedIndexChanged += new System.EventHandler(this.FGenCmbSelected);
            FGenCmbBox.LostFocus            += new System.EventHandler(HideControlFocusOver);
            FGenCmbBox.KeyPress             += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            FGenCmbBox.Font          = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            FGenCmbBox.BackColor     = Color.SkyBlue;
            FGenCmbBox.ForeColor     = Color.White;
            FGenCmbBox.DropDownStyle = ComboBoxStyle.DropDownList;
            FGenCmbBox.Hide();

            //EditBox Location
            LocationLabel.Size     = new System.Drawing.Size(0, 0);
            LocationLabel.Location = new System.Drawing.Point(0, 0);
            this.Controls.AddRange(new System.Windows.Forms.Control[] { this.LocationLabel });
            //LocationLabel.SelectedIndexChanged += new System.EventHandler(this.ActionCmbSelected);
            LocationLabel.LostFocus += new System.EventHandler(HideControlFocusOver);
            LocationLabel.KeyPress  += new System.Windows.Forms.KeyPressEventHandler(HideControlKeyPress);
            LocationLabel.Font       = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            LocationLabel.BackColor  = Color.White;
            //LocationLabel.DropDownStyle = ComboBoxStyle.DropDownList;
            LocationLabel.Hide();


            this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader4 = new System.Windows.Forms.ColumnHeader();
            this.columnHeader5 = new System.Windows.Forms.ColumnHeader();


            this.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                this.columnHeader1,                                                             //action
                this.columnHeader2,                                                             //duration
                this.columnHeader3,                                                             //reader ID
                this.columnHeader4,                                                             //Fgen ID
                this.columnHeader5,                                                             //location
            });
            this.Dock          = System.Windows.Forms.DockStyle.Fill;
            this.Font          = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.FullRowSelect = false;
            this.Name          = "listView1";
            this.Size          = new System.Drawing.Size(0, 0);
            this.TabIndex      = 0;
            this.View          = System.Windows.Forms.View.Details;
            this.MouseDown    += new System.Windows.Forms.MouseEventHandler(this.ListBoxMouseDown);
            this.MouseUp      += new System.Windows.Forms.MouseEventHandler(this.ListBoxMouseUp);
            this.DoubleClick  += new System.EventHandler(this.ListBoxItemDoubleClick);
            this.ItemCheck    += new ItemCheckEventHandler(this.ListViewItemCheck);
            this.GridLines     = true;
            this.CheckBoxes    = false;
            this.View          = View.Details;

            this.Items.Clear();

            for (int i = 0; i < MAX_ROW; i++)
            {
                ListViewItem item = new ListViewItem(""); //action
                //item.Checked = true;
                item.SubItems.Add("");                    //duration
                item.SubItems.Add("");                    //readerid
                item.SubItems.Add("");                    //fgenid
                item.SubItems.Add("");                    //location
                this.Items.Add(item);
            }

            // columnHeader1
            //
            this.columnHeader1.Text  = "Action";
            this.columnHeader1.Width = 220;
            //
            // columnHeader2
            //
            this.columnHeader2.Text  = "Duration";
            this.columnHeader2.Width = 65;
            //
            // columnHeader3
            //
            this.columnHeader3.Text  = "Reader ID";
            this.columnHeader3.Width = 75;
            //
            // columnHeader4
            //
            this.columnHeader4.Text  = "FGen ID";
            this.columnHeader4.Width = 75;
            //
            // columnHeader5
            //
            this.columnHeader5.Text  = "Location";
            this.columnHeader5.Width = 200;


            /*if (GetItemReaderComboBoxEvent != null)
             * {
             *  int rID;
             *  int index = 0;
             *
             *  while ((rID=GetItemReaderComboBoxEvent(index)) > 0)
             *  {
             *      if (index == 0)
             *          ReaderCmbBox.Items.Clear();
             *
             *      if (!ReaderCmbBox.Items.Contains(rID))
             *          ReaderCmbBox.Items.Add(rID);
             *
             *      index += 1;
             *  }
             * }*/

            loadingThread = new Thread(LoadReader);
            loadingThread.Start();
        }
Esempio n. 14
0
        /// <summary>
        /// Иницирует к открытию "ежедневный" либо "итоговый" отчёты
        /// </summary>
        private void btnGo_Click(object sender, System.EventArgs e)
        {
            string   midlist = "", s = "";
            DateTime d1, d2;

            if ((cbAll.Checked == false) && (clbEmpl.CheckedItems.Count == 0))
            {
                MessageBox.Show("Не выбраны сотрудники для формирования отчёта! ", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                return;
            }

            d1 = Convert.ToDateTime(dtpDate1.Text + " " + dtpTime1.Text);
            d2 = Convert.ToDateTime(dtpDate2.Text + " " + dtpTime2.Text);
            if (d2 <= d1)
            {
                MessageBox.Show("Некорректно задан временной диапазон! ", "Сообщение", MessageBoxButtons.OK);
                return;
            }

            lbWait.Show();
            Cursor = Cursors.WaitCursor;
            //список идентификаторов сотрудников
            if ((cbAll.Checked == false) && (clbEmpl.CheckedItems.Count != 0))        //список идентификаторов сотрудников, которые отображаются в отчёте
            {
                for (int i = 0; i < clbEmpl.CheckedItems.Count; i++)
                {
                    s       = clbEmpl.CheckedItems[i].ToString();
                    s       = s.Substring(s.IndexOf('['));
                    midlist = midlist + s;
                }
            }
            //формирование таблицы для отчёта
            if (formReportTable(midlist, d1, d2))
            {
                //выбираем отчёт для формирования
                dsReportSource ds = null;
                ReportClass    cr = null;

                try
                {
                    if (rbDayly.Checked)
                    {
                        cr = new crDayReport();
                    }
                    else
                    {
                        cr = new crTotalReport();
                    }
                    ds = fillReportSource();
                    cr.SetDataSource(ds);
                    string report_dur = "за период с " + Convert.ToString(d1) + " по " + Convert.ToString(d2);
                    cr.SetParameterValue("report_dur", report_dur);

                    fmRep codeRep = new fmRep(cr);
                    Cursor = Cursors.Default;
                    lbWait.Hide();

                    codeRep.ShowDialog();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Не удалось создать отчёт! " + ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
            }
            else
            {
                MessageBox.Show("Не удалось создать таблицу для отчёта! ", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            Cursor = Cursors.Default;
            lbWait.Hide();
        }
Esempio n. 15
0
        private void fmEmplEdit_Load(object sender, System.EventArgs e)
        {
            try
            {
                sql = "SELECT TOP 1 MPHOTO FROM EmplMain where MCODE = '" + emplMcode + "'";
                OleDbDataAdapter sqlDA = new OleDbDataAdapter(sql, con);
                sqlDA.SelectCommand.CommandTimeout = 120;
                sqlDA.Fill(sqlDS, "EmplPhoto");
                byte[] photo = (Convert.IsDBNull(sqlDS.Tables["EmplPhoto"].Rows[0][0])) ?
                               new byte[0] : (byte[])sqlDS.Tables["EmplPhoto"].Rows[0][0];
                if (photo.Length != 0)
                {
                    MemoryStream ms = new MemoryStream(photo);
                    pbPhoto.Image = new Bitmap(ms);
                    lbPhoto.Hide();
                }
                else
                {
                    pbPhoto.Image = null;
                    lbPhoto.Show();
                }

                Refill_Grid();
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.Message, "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }

            if (sqlDS == null)
            {
                MessageBox.Show("Не удалось загрузить данные о выбранном сотруднике!", "Ошибка",
                                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                Close();
            }
            else
            {
                try
                {
                    if (dgCurrent.TableStyles["EmplEdit"] == null)
                    {
                        DataGridTableStyle ts = new DataGridTableStyle();
                        ts.MappingName          = "EmplEdit";
                        ts.AllowSorting         = true;
                        ts.AlternatingBackColor = Color.Honeydew;
                        //ID
                        DataGridTextBoxColumn tb0 = new DataGridTextBoxColumn();
                        tb0.Width       = 40;
                        tb0.MappingName = Convert.ToString(sqlDS.Tables["EmplEdit"].Columns["ID"].ColumnName);
                        tb0.HeaderText  = "ID";
                        tb0.ReadOnly    = true;
                        //время прихода
                        DataGridTextBoxColumn tb1 = new DataGridTextBoxColumn();
                        tb1.Width       = 120;
                        tb1.MappingName = Convert.ToString(sqlDS.Tables["EmplEdit"].Columns["INDATETIME"].ColumnName);
                        tb1.HeaderText  = "Приход";
                        //время ухода
                        DataGridTextBoxColumn tb2 = new DataGridTextBoxColumn();
                        tb2.Width       = 120;
                        tb2.MappingName = Convert.ToString(sqlDS.Tables["EmplEdit"].Columns["OUTDATETIME"].ColumnName);
                        tb2.HeaderText  = "Уход";
                        //времени на рабочем месте
                        DataGridTextBoxColumn tb3 = new DataGridTextBoxColumn();
                        tb3.Width       = 100;
                        tb3.MappingName = Convert.ToString(sqlDS.Tables["EmplEdit"].Columns["DUR"].ColumnName);
                        tb3.HeaderText  = "Отработано";
                        tb3.ReadOnly    = true;

                        ts.GridColumnStyles.Add(tb0);
                        ts.GridColumnStyles.Add(tb1);
                        ts.GridColumnStyles.Add(tb2);
                        ts.GridColumnStyles.Add(tb3);

                        dgCurrent.TableStyles.Add(ts);
                        dgCurrent.ReadOnly = false;
                    }
                    dgCurrent.SetDataBinding(sqlDS, "EmplEdit");
                }
                catch (Exception e2)
                {
                    MessageBox.Show("Ошибка при инициализации таблицы. " + e2.Message, "Ошибка",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
            }
        }
Esempio n. 16
0
        public Battle()
        {
            InitializeComponent();

            this.attackPb.Value = BattleManager.AttackDicePoints;
            this.defendPb.Value = BattleManager.DefendDicePoints;
            this.attackSkillLowPb.Value = BattleManager.AttackSkill1DicePoints;
            this.attackSkillMedPb.Value = BattleManager.AttackSkill2DicePoints;
            this.attackSkillHeavyPb.Value = BattleManager.AttackSkill3DicePoints;
            this.attackBuffPb.Value = BattleManager.AttackBuffDicePoints;
            this.defenceBuffPb.Value = BattleManager.DefenceBuffDicePoints;
            this.healthBuffPb.Value = BattleManager.HealthDicePoints;

            targetBox = new Label();
            targetBox.Left = 500;
            targetBox.Top = 0;
            targetBox.Width = 130;
            targetBox.Height = 68;
            targetBox.Image = Properties.Resources.target_panel;
            targetBox.BackColor = Color.Transparent;
            targetBox.ForeColor = Color.White;
            targetBox.Padding = new Padding(30, 0, 25, 0);
            targetBox.Font = new Font("Microsoft Sans Serif", 8);
            Controls.Add(targetBox);
            targetBox.Hide();

            unitDamage = new Label();
            unitDamage.Width = 150;
            unitDamage.Height = 70;
            unitDamage.AutoSize = true;
            unitDamage.BackColor = Color.Transparent;
            unitDamage.Font = new Font("Microsoft Sans Serif", 35, FontStyle.Bold);
            unitDamage.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(unitDamage);
            unitDamage.Hide();

            mainStatsBox = new Label();
            mainStatsBox.Left = 650;
            mainStatsBox.Top = 670;
            mainStatsBox.Width = 85;
            mainStatsBox.Height = 120;
            mainStatsBox.BackColor = Color.Transparent;
            mainStatsBox.ForeColor = Color.White;
            Controls.Add(mainStatsBox);

            subStatsBox = new Label();
            subStatsBox.Left = 735;
            subStatsBox.Top = 670;
            subStatsBox.Width = 80;
            subStatsBox.Height = 120;
            subStatsBox.BackColor = Color.Transparent;
            subStatsBox.ForeColor = Color.White;
            Controls.Add(subStatsBox);

            dicePointsBox = new Label();
            dicePointsBox.Left = 870;
            dicePointsBox.Top = 590;
            dicePointsBox.Width = 150;
            dicePointsBox.Height = 60;
            dicePointsBox.BackColor = Color.Transparent;
            dicePointsBox.ForeColor = Color.White;
            dicePointsBox.Image = Properties.Resources.dices;
            dicePointsBox.ImageAlign = ContentAlignment.TopLeft;
            dicePointsBox.TextAlign = ContentAlignment.TopRight;
            dicePointsBox.Font = new Font("Microsoft Sans Serif", 27, FontStyle.Bold);
            dicePointsBox.Padding = new Padding(0, 10, 30, 0);
            Controls.Add(dicePointsBox);

            experienceBar = new ProgressBar();
            experienceBar.Location = new Point(294, 739);
            experienceBar.Name = "experienceBar";
            experienceBar.Size = new Size(296, 24);
            experienceBar.TabIndex = 14;
            experienceBar.Maximum = GameEngine.PlayerCharacter.CalculateExperience(GameEngine.PlayerCharacter.Level);
            experienceBar.Value = GameEngine.PlayerCharacter.Experience;
            experienceBar.BackColor = ColorTranslator.FromHtml("#b0b0b1");
            experienceBar.ForeColor = ColorTranslator.FromHtml("#04252d");
            experienceBar.Style = ProgressBarStyle.Continuous;
            Controls.Add(experienceBar);

            characterPicture = new PictureBox();
            characterPicture.Image = GetCharacterImage(GetCharacterClass(GameEngine.PlayerCharacter));
            characterPicture.Width = 250;
            characterPicture.Height = 250;
            characterPicture.BackColor = Color.Transparent;
            characterPicture.Left = 750;
            characterPicture.Top = 200;
            this.Controls.Add(characterPicture);

            playerName.Text = "Player:  " + GameEngine.PlayerCharacter.Name;

            battle.CreateEnemies();
        }
Esempio n. 17
0
        private void GetBaseInfluence()
        {
            if (_node != null)
            {
                modelPanel1.RemoveReference(_node);
            }

            MDL0BoneNode[] boneCache = _externalModel._linker.BoneCache;
            if ((_node = (MDL0ObjectNode)comboBox1.SelectedItem).Weighted)
            {
                int least = int.MaxValue;
                foreach (IMatrixNode inf in _node.Influences)
                {
                    if (inf is MDL0BoneNode && ((MDL0BoneNode)inf).BoneIndex < least)
                    {
                        least = ((MDL0BoneNode)inf).BoneIndex;
                    }
                }

                if (least != int.MaxValue)
                {
                    MDL0BoneNode temp = boneCache[least];
                    _baseInf = (IMatrixNode)temp.Parent;
                }
            }
            else
            {
                _baseInf = _node.MatrixNode;
            }

            if (_baseInf is Influence)
            {
                label2.Hide();
                comboBox2.Hide();
            }
            else if (_baseInf is MDL0BoneNode)
            {
                label2.Show();
                comboBox2.Show();
            }

            baseBone.Text = _baseInf.ToString();

            if (comboBox3.SelectedIndex == 0 && _baseInf is MDL0BoneNode)
            {
                int i = 0;
                foreach (MDL0BoneNode s in comboBox2.Items)
                {
                    if (s.Name == baseBone.Text)
                    {
                        comboBox2.SelectedIndex = i;
                        break;
                    }

                    i++;
                }
            }

            _node.IsRendering = true;
            modelPanel1.ClearTargets();
            modelPanel1.AddTarget(_node, false);
            modelPanel1.SetCamWithBox(_node.GetBox());
        }
Esempio n. 18
0
 public ingred(PictureBox p, Label pos, ProgressBar prg)
 {
     this.p = p;
     this.pos = pos;
     this.prg = prg;
     pos.Hide();
 }
Esempio n. 19
0
File: Sp.cs Progetto: chliam/dam
        private void videoCtrl(PictureBox PlayScreen, Label lblVideo,string screan)
        {
            string mciCommand;
            string alias = "MyAVI";
            if (lblVideo.Tag == null || lblVideo.Tag.ToString() != "正在播放")
            {
                lblVideo.Hide();

                mciCommand = string.Format("open {0}\\video\\video.wmv alias {1} ", Environment.CurrentDirectory, alias);
                mciCommand = mciCommand + " parent " + PlayScreen.Handle.ToInt32() + " style child ";
                LibWrap.mciSendString(mciCommand, null, 0, 0);
                Rectangle r = PlayScreen.ClientRectangle;
                mciCommand = string.Format(" put {0} window at 0 0 {1} {2}", alias, r.Width, r.Height);
                LibWrap.mciSendString(mciCommand, null, 0, 0);
                LibWrap.mciSendString(string.Format(" play {0} repeat", alias), null, 0, 0);

                lblVideo.Tag = "正在播放";
            }
            else
            {
                LibWrap.mciSendString(string.Format("close {0}", alias), null, 0, 0);
                lblVideo.Show();
                lblVideo.Tag = "停止播放";
            }
        }
        private void AddExistingNoteTab(DateTime date, String noteTitle, String noteContent, String providerName, String noteheader)
        {
            TabPage newTab = new TabPage();


            Button      newSignButton          = new System.Windows.Forms.Button();
            Label       newDateValueLabel      = new System.Windows.Forms.Label();
            RichTextBox newAddendumBox         = new System.Windows.Forms.RichTextBox();
            Label       newTitleValueNameLabel = new System.Windows.Forms.Label();
            Button      newAddendumButton      = new System.Windows.Forms.Button();
            Label       newNoteLabel           = new System.Windows.Forms.Label();
            RichTextBox newNoteBox             = new System.Windows.Forms.RichTextBox();
            Label       newDateLabel           = new System.Windows.Forms.Label();
            Label       newNoteTitleLabel      = new System.Windows.Forms.Label();
            Label       newAddendumLabel       = new System.Windows.Forms.Label();
            Button      newExitButton          = new System.Windows.Forms.Button();

            // SignButton1
            //
            newSignButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newSignButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newSignButton.FlatAppearance.BorderSize = 0;
            newSignButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newSignButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newSignButton.Location  = new System.Drawing.Point(437, 49);
            newSignButton.Name      = "newSignButton";
            newSignButton.Size      = new System.Drawing.Size(94, 26);
            newSignButton.TabIndex  = 66;
            newSignButton.Text      = "Sign";
            newSignButton.UseVisualStyleBackColor = false;
            newSignButton.Hide();
            newSignButton.Click += new System.EventHandler(ExistingSignButtonClick);

            //
            // DateValueLabel1
            //
            newDateValueLabel.AutoSize  = true;
            newDateValueLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newDateValueLabel.Location  = new System.Drawing.Point(101, 12);
            newDateValueLabel.Name      = "newDateValueLabel";
            newDateValueLabel.Size      = new System.Drawing.Size(82, 17);
            newDateValueLabel.TabIndex  = 57;
            newDateValueLabel.Text      = date.ToShortDateString();
            newDateValueLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // AddendumBox1
            //
            newAddendumBox.Font         = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            newAddendumBox.Location     = new System.Drawing.Point(7, 314);
            newAddendumBox.Multiline    = true;
            newAddendumBox.Name         = "newAddendumBox";
            newAddendumBox.Size         = new System.Drawing.Size(650, 254);
            newAddendumBox.TabIndex     = 56;
            newAddendumBox.TextChanged += new System.EventHandler(this.AddendumBox_TextChanged);
            newAddendumBox.ScrollBars   = RichTextBoxScrollBars.Vertical;
            newAddendumBox.BorderStyle  = BorderStyle.FixedSingle;

            newAddendumBox.Hide();
            //
            // TitleNameLabel
            //
            newTitleValueNameLabel.AutoSize  = true;
            newTitleValueNameLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newTitleValueNameLabel.Location  = new System.Drawing.Point(101, 38);
            newTitleValueNameLabel.Name      = "newTitleValueNameLabel";
            newTitleValueNameLabel.Size      = new System.Drawing.Size(36, 17);
            newTitleValueNameLabel.TabIndex  = 53;
            newTitleValueNameLabel.Text      = noteTitle;
            newTitleValueNameLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // AddendumButton
            //
            newAddendumButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newAddendumButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newAddendumButton.FlatAppearance.BorderSize = 0;
            newAddendumButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newAddendumButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newAddendumButton.Location  = new System.Drawing.Point(437, 49);
            newAddendumButton.Name      = "newAddendumButton";
            newAddendumButton.Size      = new System.Drawing.Size(94, 26);
            newAddendumButton.TabIndex  = 52;
            newAddendumButton.Text      = "Addendum";
            newAddendumButton.UseVisualStyleBackColor = false;
            newAddendumButton.Click += new System.EventHandler(AddendumButtonClick);
            newAddendumButton.Show();
            //
            // NoteLabel1
            //
            newNoteLabel.AutoSize  = true;
            newNoteLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newNoteLabel.Location  = new System.Drawing.Point(26, 64);
            newNoteLabel.Name      = "newNoteLabel";
            newNoteLabel.Size      = new System.Drawing.Size(42, 17);
            newNoteLabel.TabIndex  = 51;
            newNoteLabel.Text      = "Note:";
            newNoteLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // NoteBox1
            //
            newNoteBox.Font      = new System.Drawing.Font("Bahnschrift Light", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            newNoteBox.Location  = new System.Drawing.Point(6, 100);
            newNoteBox.Multiline = true;
            newNoteBox.Name      = "newNoteBox";
            if (noteContent.Contains("wrote on: "))
            {
                newNoteBox.Text = noteContent;
            }
            else
            {
                newNoteBox.Text = noteheader + "\n" + noteContent.Replace(noteheader, "") + "\n";
            }
            newNoteBox.Size        = new System.Drawing.Size(738, 623);
            newNoteBox.TabIndex    = 50;
            newNoteBox.ScrollBars  = RichTextBoxScrollBars.Vertical;
            newNoteBox.BorderStyle = BorderStyle.FixedSingle;

            //

            //
            // DateLabel1
            //
            newDateLabel.AutoSize  = true;
            newDateLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newDateLabel.Location  = new System.Drawing.Point(26, 12);
            newDateLabel.Name      = "newDateLabel";
            newDateLabel.Size      = new System.Drawing.Size(40, 17);
            newDateLabel.TabIndex  = 47;
            newDateLabel.Text      = "Date: ";
            newDateLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            //
            // NoteTitleLabel1
            //
            newNoteTitleLabel.AutoSize  = true;
            newNoteTitleLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newNoteTitleLabel.Location  = new System.Drawing.Point(26, 38);
            newNoteTitleLabel.Name      = "newNoteTitleLabel";
            newNoteTitleLabel.Size      = new System.Drawing.Size(72, 17);
            newNoteTitleLabel.TabIndex  = 46;
            newNoteTitleLabel.Text      = "Note Title: ";
            newNoteTitleLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;


            // newAddendumLabel
            //
            newAddendumLabel.AutoSize  = true;
            newAddendumLabel.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newAddendumLabel.Location  = new System.Drawing.Point(24, 293);
            newAddendumLabel.Name      = "newAddendumLabel";
            newAddendumLabel.Size      = new System.Drawing.Size(77, 17);
            newAddendumLabel.TabIndex  = 67;
            newAddendumLabel.Text      = "Addendum: ";
            newAddendumLabel.TextAlign = System.Drawing.ContentAlignment.BottomRight;
            newAddendumLabel.Hide();

            //newExitButton

            newExitButton.BackColor    = System.Drawing.SystemColors.ActiveCaption;
            newExitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            newExitButton.FlatAppearance.BorderSize = 0;
            newExitButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
            newExitButton.Font      = new System.Drawing.Font("Bahnschrift Light", 10F);
            newExitButton.Location  = new System.Drawing.Point(550, 49);
            newExitButton.Name      = "ExitButton";
            newExitButton.Size      = new System.Drawing.Size(94, 26);
            newExitButton.TabIndex  = 52;
            newExitButton.Text      = "Exit";
            newExitButton.UseVisualStyleBackColor = false;
            newExitButton.Click += new System.EventHandler(ExitButtonClick);



            newTab.Controls.Add(newExitButton);
            newTab.Controls.Add(newSignButton);
            newTab.Controls.Add(newDateValueLabel);
            newTab.Controls.Add(newAddendumBox);
            newTab.Controls.Add(newTitleValueNameLabel);
            newTab.Controls.Add(newAddendumButton);
            newTab.Controls.Add(newNoteLabel);
            newTab.Controls.Add(newNoteBox);
            newTab.Controls.Add(newDateLabel);
            newTab.Controls.Add(newNoteTitleLabel);
            newTab.Controls.Add(newAddendumLabel);
            newTab.Location = new System.Drawing.Point(4, 22);
            newTab.Padding  = new System.Windows.Forms.Padding(3);
            newTab.Size     = new System.Drawing.Size(669, 584);
            newTab.TabIndex = NewNoteTabControl.TabCount;
            newTab.Text     = noteTitle;
            newTab.UseVisualStyleBackColor = true;

            NewNoteTabControl.TabPages.Add(newTab);
            NewNoteTabControl.SelectedTab = newTab;
        }
Esempio n. 21
0
        //Form Load Event
        private void Display_Load(object sender, EventArgs e)
        {
            string[] args = Environment.GetCommandLineArgs();  //If command line arguments exist, they are stored here
            if (args.Length <= 1) //If there are no command line arguments, open a file dialog for the user
            {
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    if ([email protected](".NC") && [email protected](".nc"))
                    {
                        MessageBox.Show("NOT A .NC FILE" + args);
                        Application.Exit();
                        return;
                    }
                    try
                    {
                        FileStream NcReader = new FileStream(openFileDialog1.FileName, FileMode.Open);
                        NCFIN = new StreamReader(NcReader);
                    }
                    catch (Exception ex)
                    {
                        this.SendToBack();
                        MessageBox.Show(ex.ToString() + " occured.");
                        Application.Exit();
                    }
                }
                else
                {
                    Application.Exit();
                    return;
                }
            }
            else if (args.Length > 1) //If command line arguments are found
            {
                if (args[1] == "/h" || args[1] == "/H")
                {
                    MessageBox.Show("Help:\n\nPossible Arguments:\n  Argument 1: Thisfile.exe\n  Argument 2: NCFILE\n  Argument 3: /G0|/X\n" +
                        "  Argument 4: /PointCheck|/X\n  Argument 5: /RadiusCheck|/X\n  Argument 6: /OriginCheck|/X\n  Argument 7: /NoFBB\n  " +
                        "Example: >Display.exe Test /G0 /X /RadiusCheck /OriginCheck /NoFBB");
                    Application.Exit();
                }

                if (File.Exists(args[1] + ".NC")) //If an NC file exists
                {
                    args[1] += ".NC";
                }
                // The following is not right but I'm not fixing it now.
                else if (!args[1].Contains(".NC") && !args[1].Contains(".nc"))  //If an NC file does not exist
                {
                    MessageBox.Show("NOT A .NC FILE or file not found. " + String.Join(", ", args));
                    Application.Exit();
                    return;
                }
                else
                {
                    MessageBox.Show("FILE DOES NOT EXIST. " + String.Join(", ", args));
                    Application.Exit();
                    return;
                }
                try
                {
                    FileStream NcReader = new FileStream(args[1], FileMode.Open);
                    NCFIN = new StreamReader(NcReader);
                }
                catch (Exception ex)
                {
                    this.SendToBack();
                    MessageBox.Show(ex.ToString() + " occured.");
                    Application.Exit();
                }
            }

            //If the user enters /NoFBB as the 7th argument, fast burn bridges are not shown
            if (args.Length > 6)
            {
                if (args[6] == "/NoFBB")
                    ShowFBB = false;
            }

            try
            {
                Read_And_Parse();
            }
            catch (Exception ex)
            {
                this.SendToBack();
                MessageBox.Show("Exception " + ex.ToString() + " occurred. \n\nThis error is generally caused by a bad NC command and sometimes a blank line in the NC Code.  Please take a look at the NC Code.");
                Application.Exit();
            }

            //Title the Display window as (Display - [NCFile])
            if (args.Length > 1)
                this.Text = "File: " + args[1].Substring(0, args[1].Length - 3);
            else
                this.Text = "File: " + Path.GetFileNameWithoutExtension(@openFileDialog1.FileName);

            FILENAME = this.Text;

            try
            {
                Scale_Window();
            }
            catch (Exception ex)
            {
                this.SendToBack();
                MessageBox.Show("Exception " + ex.ToString() + " occurred. \n\nThis error is generally caused by a bad NC command and sometimes a blank line in the NC Code.  Please take a look at the NC Code.");
                Application.Exit();
            }

            Graphics g = Graphics.FromImage(mainCanvas);
            g.Clear(Color.Black);

            //Sets the position of the last BURN and the position of the second to last BURN (Used for coloring the last and second to last line)
            try
            {
                for (int i = NCList.Count - 1; i >= 0; i--)
                {
                    if ((NCList[i].ContainsX || NCList[i].ContainsY) && (NCList[i].G != "0" && NCList[i].G != "00"))
                    {
                        Last = NCList[i].LineNumber;
                        for (int j = i - 1; j > 0; j--)
                        {
                            if (NCList[j].ContainsX || NCList[j].ContainsY && (NCList[j].G != "0" && NCList[j].G != "00"))
                            {
                                SecondToLast = NCList[j].LineNumber;
                                break;
                            }
                        }
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                this.SendToBack();
                MessageBox.Show("Exception " + ex.ToString() + " occurred. \n\nThis error is generally caused by a bad NC command and sometimes a blank line in the NC Code.  Please take a look at the NC Code.");
                Application.Exit();
            }

            //Sets the X and Y back to the origin and draws the design
            X = Math.Abs(XMIN);
            Y = Math.Abs(YMAX);
            G0Show = false;
            // MessageBox.Show("Count of NCList = " + NCList.Count);
            try
            {
                for (int j = 0; j < NCList.Count; j++)
                    draw_design(j);
            }
            catch (Exception ex)
            {
                this.SendToBack();
                MessageBox.Show("Exception " + ex.ToString() + " occurred. \n\nThis error is generally caused by a bad NC command and sometimes a blank line in the NC Code.  Please take a look at the NC Code.");
                Application.Exit();
            }

            // Draw_Meta();

            G0CanvasCopy = new TemporaryFile();
            //Saves the NO G0 canvas to a temporary file
            mainCanvas.Save(@G0CanvasCopy.FilePath);
            G0Show = true;

            ArcDirection = true;
            for (int j = 0; j < NCList.Count; j++)
                draw_design(j);
            //Saves the Arc Direction canvas to a temorary file
            ArcDirectionCanvasCopy = new TemporaryFile();
            mainCanvas.Save(@ArcDirectionCanvasCopy.FilePath);
            ArcDirection = false;

            for (int j = 0; j < NCList.Count; j++)
                draw_design(j);

            #region Dynamic Labels
            /*******************************************
            * CREATE DYNAMIC LABELS
            */
            ProgramDetails = new Label();
            ProgramDetails.Text = "CNC (.NC) DISPLAY BY ZACH SAMUELS\n" + String.Format("{0, 30}", "VERSION ") + Constants.Version;
            ProgramDetails.Location = new Point((int)(SCREENWIDTH * .75), 10);
            ProgramDetails.AutoSize = true;
            ProgramDetails.Font = new Font("Times New Roman", 9.0F);
            this.Controls.Add(ProgramDetails);
            RainbowTimer.Start();

            Label Controls = new Label();
            Controls.Text = "Controls:\nD - Redraw the object\nT - Trace the design\nG - Make G0 Moves Transparent\nA - Show Arc Directions\n" +
                "Z - Open zoom window\nL - Select a line from line number\nN - Add Notes\nP - Print\nV - Print Preview\nO - Open new file (If not opened from command)\nX - Stop all commands\nESC - Quit";
            Controls.Location = new Point((int)(SCREENWIDTH * .75), 60);
            Controls.AutoSize = true;
            Controls.Font = new Font("Times New Roman", 9.0F);
            Controls.ForeColor = Color.White;
            this.Controls.Add(Controls);

            GCODE = new Label();
            GCODE.Text = "GCODE:\nSpeed:\nPoint:\nLine Number:";
            GCODE.Location = new Point((int)(SCREENWIDTH * .75), 270);
            GCODE.AutoSize = true;
            GCODE.ForeColor = Color.OrangeRed;
            GCODE.Font = new Font("Times New Roman", 9.0F);
            this.Controls.Add(GCODE);

            /// NOTE: DUE TO THE DESIGN BEING DRAW TO 3 FILES, POINTINCHES MUST BE DIVIDED BY 3 ///
            Inch_Calculator = new Label();
            Inch_Calculator.Font = new Font("Times New Roman", 9.0F);
            Inch_Calculator.Location = new Point((int)(SCREENWIDTH * .75), 440);
            Inch_Calculator.Text = "Inch Calculator\n\nG0 Inches: " + (PointInches["G0"]/3).ToString("0.0");
            double TotalInches = 0;
            foreach (string Key in PointInches.Keys)
            {
                if (Key != "G0" && PointInches[Key] != 0)
                {
                    Burn_Inches += Key + " inches: " + (PointInches[Key]/3).ToString("0.0") + "\n";
                    Inch_Calculator.Text += "\n" + Key + ": " + (PointInches[Key]/3).ToString("0.0");
                    TotalInches += PointInches[Key]/3;
                }
            }
            TotalInches += PointInches["G0"]/3;
            Inch_Calculator.Text += "\nTotal Inches Moved: " + TotalInches.ToString("0.0") + "\nEfficiency Ratio Burn/Travel: " +
                (((TotalInches - PointInches["G0"]/3) / TotalInches) * 100).ToString("0.0") +
                "%\n\nSize of Design: " + (XMAX - XMIN).ToString("0.0") + " X " + (YMAX - YMIN).ToString("0.0");
            SizeDesign = (XMAX - XMIN).ToString("0.0") + " x " + (YMAX - YMIN).ToString("0.0");

            Inch_Calculator.AutoSize = true;
            Inch_Calculator.ForeColor = Color.White;
            Inch_Calculator.Font = new Font("Times New Roman", 9.0F);
            this.Controls.Add(Inch_Calculator);

            int InchColorY = 620;
            InchColor = new Label[11];
            for (int i = 0; i < 11; i++)
                InchColor[i] = new Label();

            InchColor[0].Text = "G0 Move";
            InchColor[0].ForeColor = Color.BlueViolet;
            InchColor[0].Location = new Point((int)(SCREENWIDTH * .75), InchColorY);

            InchColor[1].Text = "Etching";
            InchColor[1].ForeColor = Color.Blue;
            InchColor[1].Location = new Point((InchColor[0].Location.X + 60), InchColorY);

            InchColor[2].Text = "2 Point";
            InchColor[2].ForeColor = Color.Green;
            InchColor[2].Location = new Point((InchColor[1].Location.X + 50), InchColorY);

            InchColor[3].Text = "3 Point";
            InchColor[3].ForeColor = Color.Cyan;
            InchColor[3].Location = new Point((InchColor[0].Location.X), InchColorY + 20);

            InchColor[4].Text = "1 Pass";
            InchColor[4].ForeColor = Color.WhiteSmoke;
            InchColor[4].Location = new Point((InchColor[3].Location.X + 50), InchColorY + 20);

            InchColor[5].Text = "1.5 Point";
            InchColor[5].ForeColor = Color.LightCyan;
            InchColor[5].Location = new Point((InchColor[4].Location.X + 50), InchColorY + 20);

            InchColor[6].Text = "Buffer";
            InchColor[6].ForeColor = Color.LightBlue;
            InchColor[6].Location = new Point((InchColor[0].Location.X), InchColorY + 40);

            InchColor[7].Text = "Snug";
            InchColor[7].ForeColor = Color.Gray;
            InchColor[7].Location = new Point((InchColor[6].Location.X + 50), InchColorY + 40);

            InchColor[8].Text = "Wide";
            InchColor[8].ForeColor = Color.LightGreen;
            InchColor[8].Location = new Point((InchColor[7].Location.X + 50), InchColorY + 40);

            InchColor[9].Text = "Pulsing";
            InchColor[9].ForeColor = Color.Salmon;
            InchColor[9].Location = new Point((InchColor[0].Location.X), InchColorY + 60);

            if (ShowFBB == true)
            {
                InchColor[10].Text = "FBB";
                InchColor[10].ForeColor = Color.Red;
                InchColor[10].Location = new Point((InchColor[9].Location.X + 50), InchColorY + 60);
            }

            foreach (Label l in InchColor)
            {
                l.AutoSize = true;
                l.Font = new Font("Times New Roman", 9.0F);
                this.Controls.Add(l);
            }

            drawingBarLabel = new Label();
            drawingBarLabel.Text = "Slow Down/Speed Up Drawing";
            drawingBarLabel.Location = new Point((int)(SCREENWIDTH * .75), 360);
            drawingBarLabel.AutoSize = true;
            drawingBarLabel.ForeColor = Color.White;
            drawingBarLabel.Font = new Font("Times New Roman", 9.0F);
            drawingBarLabel.Hide();
            this.Controls.Add(drawingBarLabel);

            drawingBar.Location = new Point((int)(SCREENWIDTH * .75), 375);
            drawingBar.Width = 300;
            drawingBar.TickStyle = TickStyle.None;
            drawingBar.Hide();
            /*
             * ******************************************/
            #endregion

            this.BackColor = Color.Black;
            this.ForeColor = Color.Black;
            this.Location = new Point(0, 0);

            //Saves the canvas to a temporary file
            CanvasCopy = new TemporaryFile();
            mainCanvas.Save(@CanvasCopy.FilePath);

            ArgsCommands(args);
            full_maximize(sender, e);

            this.Refresh(); //Refreshes the form
            g.Dispose(); //Releases the resources used by Graphics g
            this.TopMost = true;
            this.Activate();
        }
Esempio n. 22
0
 private void txtDoctor_Leave(object sender, System.EventArgs e)
 {
     label3.Hide();
 }
Esempio n. 23
0
 public void led(int num, Label lbl1, Label lbl2, Label lbl3, Label lbl4, Label lbl5, Label lbl6, Label lbl7)
 {
     switch (num)
     {
         case 0:
             lbl1.Show();
             lbl2.Show();
             lbl3.Show();
             lbl4.Show();
             lbl5.Show();
             lbl6.Show();
             lbl7.Hide();
             break;
         case 1:
             lbl1.Hide();
             lbl2.Hide();
             lbl3.Hide();
             lbl4.Hide();
             lbl5.Show();
             lbl6.Show();
             lbl7.Hide();
             break;
         case 2:
             lbl1.Show();
             lbl2.Show();
             lbl3.Hide();
             lbl4.Show();
             lbl5.Show();
             lbl6.Hide();
             lbl7.Show();
             break;
         case 3:
             lbl1.Show();
             lbl2.Hide();
             lbl3.Hide();
             lbl4.Show();
             lbl5.Show();
             lbl6.Show();
             lbl7.Show();
             break;
         case 4:
             lbl1.Hide();
             lbl2.Hide();
             lbl3.Show();
             lbl4.Hide();
             lbl5.Show();
             lbl6.Show();
             lbl7.Show();
             break;
         case 5:
             lbl1.Show();
             lbl2.Hide();
             lbl3.Show();
             lbl4.Show();
             lbl5.Hide();
             lbl6.Show();
             lbl7.Show();
             break;
         case 6:
             lbl1.Show();
             lbl2.Show();
             lbl3.Show();
             lbl4.Show();
             lbl5.Hide();
             lbl6.Show();
             lbl7.Show();
             break;
         case 7:
             lbl1.Hide();
             lbl2.Hide();
             lbl3.Hide();
             lbl4.Show();
             lbl5.Show();
             lbl6.Show();
             lbl7.Hide();
             break;
         case 8:
             lbl1.Show();
             lbl2.Show();
             lbl3.Show();
             lbl4.Show();
             lbl5.Show();
             lbl6.Show();
             lbl7.Show();
             break;
         case 9:
             lbl1.Hide();
             lbl2.Hide();
             lbl3.Show();
             lbl4.Show();
             lbl5.Show();
             lbl6.Show();
             lbl7.Show();
             break;
     }
 }
Esempio n. 24
0
        public ShopInventory()
        {
            InitializeComponent();

            this.shopItemsPossitions.Add(new Position(12, 40));
            this.shopItemsPossitions.Add(new Position(82, 40));
            this.shopItemsPossitions.Add(new Position(152, 40));
            this.shopItemsPossitions.Add(new Position(222, 40));
            this.shopItemsPossitions.Add(new Position(292, 40));
            this.shopItemsPossitions.Add(new Position(12, 110));
            this.shopItemsPossitions.Add(new Position(82, 110));
            this.shopItemsPossitions.Add(new Position(152, 110));
            this.shopItemsPossitions.Add(new Position(222, 110));
            this.shopItemsPossitions.Add(new Position(292, 110));
            this.shopItemsPossitions.Add(new Position(12, 180));
            this.shopItemsPossitions.Add(new Position(82, 180));
            this.shopItemsPossitions.Add(new Position(152, 180));
            this.shopItemsPossitions.Add(new Position(222, 180));
            this.shopItemsPossitions.Add(new Position(292, 180));
            this.shopItemsPossitions.Add(new Position(12, 250));
            this.shopItemsPossitions.Add(new Position(82, 250));
            this.shopItemsPossitions.Add(new Position(152, 250));
            this.shopItemsPossitions.Add(new Position(222, 250));
            this.shopItemsPossitions.Add(new Position(292, 250));
            this.shopItemsPossitions.Add(new Position(12, 320));
            this.shopItemsPossitions.Add(new Position(82, 320));
            this.shopItemsPossitions.Add(new Position(152, 320));
            this.shopItemsPossitions.Add(new Position(222, 320));
            this.shopItemsPossitions.Add(new Position(292, 320));

            this.inventoryPossitions.Add(new Position(378, 40));
            this.inventoryPossitions.Add(new Position(448, 40));
            this.inventoryPossitions.Add(new Position(378, 110));
            this.inventoryPossitions.Add(new Position(448, 110));
            this.inventoryPossitions.Add(new Position(378, 180));
            this.inventoryPossitions.Add(new Position(448, 180));
            this.inventoryPossitions.Add(new Position(378, 250));
            this.inventoryPossitions.Add(new Position(448, 250));
            this.inventoryPossitions.Add(new Position(378, 320));
            this.inventoryPossitions.Add(new Position(448, 320));

            //name, price, picture, def, attk, hit, str, dex, vit, int, lvl
            this.shopItems.Add(new Weapon("Lightnig Dagger", 45, Pictures.RareDager, 0, 5, 0, 0, 0, 0, 10, 4, "This dagger is created for mage users."));
            this.shopItems.Add(new Weapon("Big Sword", 100, Pictures.RareSword, 0, 22, 0, 0, 10, 0, 0, 8, "Big sword for heavy strikes."));
            this.shopItems.Add(new Weapon("Iron Sword", 5, Pictures.BasickSword, 0, 7, 0, 1, 0, 0, 0, 2, "Basic battle equipment."));
            this.shopItems.Add(new Helmet("Iron-horn Helm", 20, Pictures.WarriorHelmet, 2, 0, 3, 1, 0, 1, 0, 3, "Basic - but stylish."));
            this.shopItems.Add(new Gloves("Fighter Gloves", 15, Pictures.WarriorsGloves, 1, 2, 1, 0, 1, 0, 0, 1, "Good for melee characters."));
            this.shopItems.Add(new Boots("Armored Boots", 10, Pictures.WarriorBoots, 2, 2, 0, 0, 0, 1, 0, 2, "Heavy and slow."));
            this.shopItems.Add(new Chainmail("Chainmail", 25, Pictures.WarriorChainmail, 2, 0, 0, 0, 1, 1, 0, 1, "Chainmail armor makes you more agile."));
            this.shopItems.Add(new Potion("Small Health Potion", 20, Pictures.HealingPotion, 0, 0, 0, 0, 0, 0, 0, 1, "Return + 10hp"));
            this.shopItems.Add(new Scroll("Teleport Scroll", 0, Pictures.Scroll, 0, 0, 0, 0, 0, 0, 0, 1, "Use to teleport to location."));

            this.shopItems.Add(new Weapon("Stone Axe", 35, Pictures.BasickAxe, 0, 7, 0, 0, 3, 0, 0, 4, "Made from solid granit."));
            this.shopItems.Add(new Weapon("Golden Staff", 75, Pictures.RareStaff, 0, 1, 0, 0, 0, 2, 4, 5, "Powered by the sun."));
            this.shopItems.Add(new Helmet("Wizards Hat", 50, Pictures.MageHelmet, 2, 0, 1, 0, 0, 1, 2, 3, "No wizard go out without his hat."));
            this.shopItems.Add(new Gloves("Assassin Gloves", 15, Pictures.RogueGLoves, 1, 0, 3, 0, 1, 0, 1, 3, "Deadly in the right hands."));
            this.shopItems.Add(new Boots("Golden Sandals", 170, Pictures.RogueBoots, 1, 1, 1, 1, 1, 1, 1, 1, "One hell of a quality item."));
            this.shopItems.Add(new Chainmail("Wool Robe", 25, Pictures.MageChainmail, 2, 0, 0, 0, 2, 1, 0, 1, "Your best friend in cold winter nights."));

            this.shopItems.Add(new Weapon("Sacura Staff", 45, Pictures.MidStaff, 0, 7, 0, 0, 0, 1, 2, 4, "Eastern mistery."));
            this.shopItems.Add(new Weapon("Colibri", 55, Pictures.MidDager, 0, 8, 0, 1, 0, 0, 0, 2, "Dual strike - very fast"));

            statsBox = new Label();
            statsBox.Width = 104;
            statsBox.Height = 140;
            statsBox.BackColor = Color.Black;
            statsBox.ForeColor = Color.White;
            statsBox.Font = new Font("Microsoft Sans Serif", 9, FontStyle.Bold);
            statsBox.TextAlign = ContentAlignment.TopCenter;
            statsBox.BackColor = Color.FromArgb(150, 0, 0, 0);
            Controls.Add(statsBox);
            statsBox.Hide();
        }
Esempio n. 25
0
        void TrabajarConEncuesta(object sender, EventArgs e)
        {
            if (RBeditar.Checked == false && RBeliminar.Checked == false && RBmostrar.Checked == false)
            {
                MessageBox.Show("Debe seleccionar una opcion");
            }
            else
            {
                if (listaPublicaciones.SelectedRows.Count > 0 && RBeliminar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;

                    usuarioNL usuarioNL = new usuarioNL();
                    usuarioNL.borrarPublicacion(valor);
                    listaPublicaciones.Columns.Clear();
                    listaPublicaciones.DataSource = "";
                    CargarEncuesta();

                    MessageBox.Show("Eliminar!!!");
                }

                else if (listaPublicaciones.SelectedRows.Count > 0 && RBeditar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;

                    usuarioNL nl = new usuarioNL();

                    // Elementos ocultar
                    RBeditar.Hide();
                    RBeliminar.Hide();
                    RBmostrar.Hide();

                    lbContenidoTitulo.Hide();
                    lbContenido.Hide();
                    btnTrabajarPublicaciones.Hide();
                    listaPublicaciones.Hide();
                    btnAgregar.Hide();

                    //Mostrados
                    txtTituloUpdate.Show();
                    txtTituloUpdate.Text  = nl.CargarDataPublicacion(valor).titulo.ToString();
                    txtContenido.ReadOnly = false;

                    btnGuardarEdicion.Show();
                    btnCancelar.Show();
                }

                else if (listaPublicaciones.SelectedRows.Count > 0 && RBmostrar.Checked == true)
                {
                    int filaSeleccionada = listaPublicaciones.CurrentRow.Index;


                    usuarioNL nl = new usuarioNL();

                    lbContenidoFecha.Text    = "";
                    lbContenidoFecha.Text    = nl.CargarDataPublicacion(valor).fecha.ToString();
                    lbContenidoFecha.Visible = true;

                    lbContenidoTitulo.Text    = "";
                    lbContenidoTitulo.Text    = nl.CargarDataPublicacion(valor).titulo.ToString();
                    lbContenidoTitulo.Visible = true;

                    txtContenido.Text = "";
                    txtContenido.Text = nl.CargarDataPublicacion(valor).contenido.ToString();

                    RBeditar.Visible = true;
                }

                else
                {
                    MessageBox.Show("Debe seleccionar la columna pulsando en la columna a la izquierda del todo");
                }
            }
        }
        private void AddControls()
        {
            ToolStrip toolStrip = new ToolStrip();
            Controls.Add(toolStrip);

            ToolStripLabel folderLabel = new ToolStripLabel();
            folderLabel.Text = "Folder";
            toolStrip.Items.Add(folderLabel);

            folderComboBox = new ToolStripComboBox();
            folderComboBox.AutoSize = false;
            SetComboBoxItems(folderComboBox, settings.folderPaths);
            folderComboBox.SelectedIndexChanged += FolderComboBox_SelectedIndexChanged;
            toolStrip.Items.Add(folderComboBox);

            ToolStripLabel songLabel = new ToolStripLabel();
            songLabel.Text = "Song";
            toolStrip.Items.Add(songLabel);

            songComboBox = new ToolStripComboBox();
            songComboBox.AutoSize = false;
            songComboBox.Width = 25;
            toolStrip.Items.Add(songComboBox);
            UpdateSongComboBox();

            ToolStripButton showSongButton = new ToolStripButton();
            showSongButton.Text = "Show song";
            showSongButton.Click += ShowSongButton_Click;
            toolStrip.Items.Add(showSongButton);

            toolStrip.Items.Add(new ToolStripSeparator());

            ToolStripButton showHelpButton = new ToolStripButton();
            showHelpButton.Text = "Show help";
            showHelpButton.Click += ShowHelpButton_Click;
            toolStrip.Items.Add(showHelpButton);

            ToolStripButton launchPlayerButton = new ToolStripButton();
            launchPlayerButton.Text = "Launch player";
            launchPlayerButton.Click += LaunchPlayerButton_Click;
            toolStrip.Items.Add(launchPlayerButton);

            toolStrip.Items.Add(new ToolStripSeparator());

            ToolStripButton addFolderButton = new ToolStripButton();
            addFolderButton.Text = "Add folder";
            addFolderButton.Click += AddFolderButton_Click;
            toolStrip.Items.Add(addFolderButton);

            ToolStripButton changePlayerButton = new ToolStripButton();
            changePlayerButton.Text = "Change player";
            changePlayerButton.Click += ChangePlayerButton_Click;
            toolStrip.Items.Add(changePlayerButton);

            ToolStripButton changeInputButton = new ToolStripButton();
            changeInputButton.Text = "Change input";
            changeInputButton.Click += ChangeInputButton_Click;
            toolStrip.Items.Add(changeInputButton);

            pictureBox = new PictureBox();
            pictureBox.BackColor = Color.White;
            pictureBox.Size = new Size(Size.Width, Size.Height - toolStrip.Height);
            pictureBox.Location = new Point(0, toolStrip.Height);
            Controls.Add(pictureBox);

            folderSwitchingLabel = new Label();
            folderSwitchingLabel.Text = ("Press left or right to change a folder and select to confirm");
            folderSwitchingLabel.TextAlign = ContentAlignment.MiddleCenter;
            folderSwitchingLabel.Size = Size;
            folderSwitchingLabel.Hide();
            Controls.Add(folderSwitchingLabel);

            exitPressedLabel = new Label();
            exitPressedLabel.Text = ("Press stop to exit or play to continue");
            exitPressedLabel.TextAlign = ContentAlignment.MiddleCenter;
            exitPressedLabel.Size = Size;
            exitPressedLabel.Hide();
            Controls.Add(exitPressedLabel);

            LoadPages();
        }
Esempio n. 27
0
        public Form1()
        {
            InitializeComponent();

            Q1 = new Label();
            Controls.Add(Q1);
            Q1.Text = "Выберите тип минимизируемой функции:";
            Q1.Top = 10;
            Q1.Left = 10;
            Q1.BorderStyle = BorderStyle.FixedSingle;
            Q1.AutoSize = true;
            Q1.Padding = new Padding(5, 5, 5, 5);

            fselector = new GroupBox();
            Controls.Add(fselector);
            fselector.Top = Q1.Bottom + 5;
            fselector.Left = 10;

            rb1 = new RadioButton();
            rb1.Text = "Polynom";
            rb1.Location = new Point(fselector.Left + 5, 10/*fselector.Top + 5*/);
            rb1.AutoSize = true;

            rb2 = new RadioButton();
            //Controls.Add(rb2);
            rb2.Text = "Exponent";
            rb2.Location = new Point(fselector.Left + 5, rb1.Bottom + 5);
            rb2.AutoSize = true;

            fselector.Controls.Add(rb1);
            fselector.Controls.Add(rb2);
            fselector.Width = Math.Max(rb1.Right, rb2.Right) + 5;
            fselector.Height = rb2.Bottom + 5;

            Q2 = new Label();
            Controls.Add(Q2);
            Q2.Text = "Введите параметры выбранной функции\n(через пробел):";
            Q2.BorderStyle = BorderStyle.FixedSingle;
            Q2.Height = Q1.Height + 15;
            Q2.Width = Q1.Width;
            Q2.Padding = new Padding(5, 5, 5, 5);
            Q2.Left = 10;
            Q2.Top = fselector.Bottom + 10;

            par_getter = new TextBox();
            Controls.Add(par_getter);
            par_getter.Left = 10;
            par_getter.Top = Q2.Bottom + 5;
            par_getter.Width = Q2.Width;
            par_getter.MouseLeave += SetFunc;

            FShow = new Label();
            FShow.Tag = "Функция: ";
            FShow.Text = "Функция: ";
            Controls.Add(FShow);
            FShow.Size = Q1.Size;
            FShow.BorderStyle = BorderStyle.FixedSingle;
            FShow.Padding = new Padding(5, 5, 5, 5);
            FShow.Left = 10;
            FShow.Top = par_getter.Bottom + 5;

            QEps = new Label();
            Controls.Add(QEps);
            QEps.Text = "Введите границы промежутка и точность";
            QEps.Size = Q1.Size;
            QEps.Left = 10;
            QEps.BorderStyle = BorderStyle.FixedSingle;
            QEps.Padding = new Padding(5, 5, 5, 5);
            QEps.Top = FShow.Bottom + 5;

            basepars = new TextBox[3];
            basepars[0] = new TextBox();
            Controls.Add(basepars[0]);
            basepars[1] = new TextBox();
            Controls.Add(basepars[1]);
            basepars[2] = new TextBox();
            Controls.Add(basepars[2]);
            foreach (TextBox tb in basepars)
            {
                tb.Width = QEps.Width / 3 - 8;
                tb.Top = QEps.Bottom + 5;
                tb.MouseClick += TextClear;
            }
            basepars[0].Left = 10;
            basepars[1].Left = basepars[0].Right + 12;
            basepars[2].Left = QEps.Right - basepars[2].Width;
            basepars[0].Text = "a";
            basepars[1].Text = "b";
            basepars[2].Text = "c";

            Execute = new Button();
            Controls.Add(Execute);
            Execute.Left = 5;
            Execute.Text = "Execute";
            Execute.Top = basepars[0].Bottom + 15;
            Execute.AutoSize = true;
            Execute.MouseClick += ProcessMethod;
            Execute.Padding = new Padding(5, 5, 5, 5);

            Ans = new Label();
            Controls.Add(Ans);
            //Ans.Visible = false;
            Ans.Top = Execute.Top;
            Ans.BorderStyle = BorderStyle.FixedSingle;
            Ans.Tag = "Answer: ";
            Ans.Text = "Answer";
            Ans.Left = Execute.Right + 10;
            Ans.Width = QEps.Right - Ans.Left;
            Ans.Height = Execute.Height;
            Ans.TextAlign = ContentAlignment.MiddleCenter;

            img = new PictureBox();
            Controls.Add(img);
            img.BorderStyle = BorderStyle.FixedSingle;
            img.Left = Q1.Right + 20;
            img.Width = 300;
            img.Top = Q1.Top;
            img.Height = 270;

            Draw = new Button();
            Controls.Add(Draw);
            Draw.BringToFront();
            Draw.Text = "Draw";
            Draw.Padding = new Padding(5, 5, 5, 5);
            Draw.AutoSize = true;
            Draw.Left = img.Left;
            Draw.Top = img.Bottom+5;
            Draw.Enabled = false;
            Draw.MouseClick += SetGraphics;
            Draw.MouseClick += IncludeDescr;

            ImgDescr = new Label();
            Controls.Add(ImgDescr);
            ImgDescr.Text = "Красные точки - середины текущих отрезков.\nСиние точки - 1/4 и 3/4 текущего отрезка.";
            ImgDescr.BorderStyle = BorderStyle.FixedSingle;
            ImgDescr.Padding = new Padding(0, 0, 0, 0);
            ImgDescr.Font = new Font("Arial", (float)6.75);
            ImgDescr.TextAlign = ContentAlignment.TopCenter;
            ImgDescr.Left = Draw.Right + 5;
            ImgDescr.Top = Draw.Top;
            ImgDescr.Width = 295 - Draw.Width;
            ImgDescr.Height = Draw.Height;
            ImgDescr.Hide();

            this.Size = new Size(590, 360);
            this.Text = "Минимизация одномерной функции: метод деления пополам";
        }
Esempio n. 28
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //フォームの初期化
            this.Text = "Route_Search";
            this.FormBorderStyle = FormBorderStyle.FixedSingle;

            //ラベルの初期化
            label1 = new Label();
            label1.Text = "このプログラムは\n迷路探索プログラムです。\n探索の様子を表す木構造と\n迷路の回答を表示します。";
            label1.Font = new Font("メイリオ", 15, FontStyle.Bold);
            label1.Location = new Point(15, 69);
            label1.AutoSize = true;
            label1.TextAlign = ContentAlignment.MiddleCenter;
            this.Controls.Add(label1);
            label1.Click += new EventHandler(label1_Click);

            label2 = new Label();
            label2.Text = "テキストボックスに\nデータを入力してく\nださい。\n・0:走行可能\n・1:走行不可能\n・2:スタート\n・3:ゴール\n" +
                "[例]\n2, 0, 0  左のように数字\n0, 1, 0  の間に\",\"を入れ\n0, 0, 3  てください";
            label2.Font = new Font("メイリオ", 7, FontStyle.Bold);
            label2.Location = new Point(170, 50);
            label2.AutoSize = true;;
            this.Controls.Add(label2);
            label2.Click += new EventHandler(label1_Click);
            label2.Hide();

            label3 = new Label();
            label3.Font = new Font("メイリオ", 10, FontStyle.Bold);
            label3.Location = new Point(10, 430);
            label3.BackColor = Color.Gainsboro;
            label3.BorderStyle = BorderStyle.Fixed3D;
            label3.AutoSize = true; ;
            this.Controls.Add(label3);
            label3.Hide();

            label4 = new Label();
            label4.Font = new Font("メイリオ", 10, FontStyle.Bold);
            label4.Location = new Point(10, 430);
            label4.BackColor = Color.Gainsboro;
            label4.BorderStyle = BorderStyle.Fixed3D;
            label4.AutoSize = true; ;
            this.Controls.Add(label4);
            label4.Hide();

            //ボタンの初期化
            bt1.Text = "ファイル入力";
            bt1.Location = new Point(20, 100);
            bt1.Size = new Size(112, 60);
            bt1.Font = new Font("メイリオ", 9, FontStyle.Bold);
            bt1.Click += new EventHandler(bt1_Click);
            this.Controls.Add(bt1);
            bt1.Hide();

            bt2.Text = "キーボード入力";
            bt2.Location = new Point(152, 100);
            bt2.Size = new Size(112, 60);
            bt2.Font = new Font("メイリオ", 9, FontStyle.Bold);
            bt2.Click += new EventHandler(bt2_Click);
            this.Controls.Add(bt2);
            bt2.Hide();

            bt3.Text = "参照";
            bt3.Size = new Size(50, 25);
            bt3.Location = new Point(225, 50);
            bt3.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt3.Click += new EventHandler(bt3_Click);
            this.Controls.Add(bt3);
            bt3.Hide();

            bt4.Text = "表示";
            bt4.Size = new Size(70, 35);
            bt4.Location = new Point(210, 220);
            bt4.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt4.Click += new EventHandler(bt4_Click);
            this.Controls.Add(bt4);
            bt4.Hide();

            bt5.Text = "表示";
            bt5.Size = new Size(70, 35);
            bt5.Location = new Point(210, 220);
            bt5.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt5.Click += new EventHandler(bt5_Click);
            this.Controls.Add(bt5);
            bt5.Hide();

            bt6.Text = "データの変更";
            bt6.Size = new Size(110, 35);
            bt6.Location = new Point(360, 425);
            bt6.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt6.Click += new EventHandler(bt6_Click);
            this.Controls.Add(bt6);
            bt6.Hide();

            bt7.Text = "深さ優先探索";
            bt7.Size = new Size(110, 35);
            bt7.Location = new Point(230, 10);
            bt7.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt7.Click += new EventHandler(bt7_Click);
            this.Controls.Add(bt7);
            bt7.Hide();

            bt8.Text = "幅優先探索";
            bt8.Size = new Size(110, 35);
            bt8.Location = new Point(360, 10);
            bt8.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt8.Click += new EventHandler(bt8_Click);
            this.Controls.Add(bt8);
            bt8.Hide();

            bt9.Text = "戻る";
            bt9.Size = new Size(70, 35);
            bt9.Location = new Point(130, 220);
            bt9.Font = new Font("メイリオ", 10, FontStyle.Bold);
            bt9.Click += new EventHandler(bt9_Click);
            this.Controls.Add(bt9);
            bt9.Hide();

            //テキストボックスの初期化
            tb.Location = new Point(15, 50);
            tb.Font = new Font("MS UI Gothic", 13);
            this.Controls.Add(tb);
            tb.Hide();
        }