コード例 #1
0
        void AdaugareNeuroni_Ascunse(int straturi, List <int> valori)
        {
            for (int i = 0; i < straturi; i++)
            {
                int y = 17;

                List <CircularButton> List = new List <CircularButton>();


                for (int l = 0; l < valori[i]; l++)
                {
                    CircularButton cb = new CircularButton();

                    cb.Height    = 51;
                    cb.Width     = 58;
                    cb.FlatStyle = FlatStyle.Flat;
                    cb.FlatAppearance.BorderColor = Color.Red;
                    cb.FlatAppearance.BorderSize  = 0;
                    cb.BackColor = Color.Red;
                    cb.Click    += new EventHandler(OnClick_Ascuns);
                    //   cb.Text = "" + i + "," + l;


                    cb.Location = new Point(240 + (i * 140), y);
                    panel1.Controls.Add(cb);

                    List.Add(cb);

                    y += 71;
                }
                Lista_de_Liste.Add(List);
            }
        }
コード例 #2
0
        void AdaugareNeuroni_Iesire(int neuroni)
        {
            int y = 17;

            for (int i = 0; i < neuroni; i++)
            {
                CircularButton cb = new CircularButton();
                cb.Height    = 51;
                cb.Width     = 58;
                cb.FlatStyle = FlatStyle.Flat;
                cb.FlatAppearance.BorderColor = Color.Red;
                cb.FlatAppearance.BorderSize  = 0;
                cb.BackColor = Color.Red;

                cb.Location = new Point(670, y);
                cb.Click   += new EventHandler(OnClick_Iesire);
                //  cb.Text = i.ToString();

                NumericUpDown nr = new NumericUpDown();
                nr.Increment     = 0;
                nr.Value         = 0;
                nr.Width         = 80;
                nr.Height        = 25;
                nr.ReadOnly      = true;
                nr.DecimalPlaces = 5;
                nr.Location      = new Point(740, y + 15);

                panel1.Controls.Add(cb);
                panel1.Controls.Add(nr);
                iesire.Add(cb);
                semnale_iesire.Add(nr);

                y += 71;
            }
        }
コード例 #3
0
        void AdaugareNeuroni_Intrare(int neuroni)
        {
            int y = 17;

            for (int i = 0; i < neuroni; i++)
            {
                CircularButton cb = new CircularButton();
                cb.Height    = 51;
                cb.Width     = 58;
                cb.FlatStyle = FlatStyle.Flat;
                cb.FlatAppearance.BorderColor = Color.Red;
                cb.FlatAppearance.BorderSize  = 0;
                cb.BackColor = Color.Red;
                cb.Location  = new Point(100, y);

                NumericUpDown nr = new NumericUpDown();
                nr.Minimum       = -100;
                nr.Maximum       = 100;
                nr.Increment     = (decimal)0.01;
                nr.Value         = 0;
                nr.Width         = 80;
                nr.Height        = 25;
                nr.DecimalPlaces = 2;
                nr.Location      = new Point(5, y + 15);
                nr.ValueChanged += new EventHandler(Value_Change);

                panel1.Controls.Add(cb);
                panel1.Controls.Add(nr);
                intrare.Add(cb);
                semnale_intrare.Add(nr);

                y += 71;
            }
        }
コード例 #4
0
 private void ChangeColor(CircularButton c)
 {
     if (turn)
     {
         c.BackColor      = Color.Red;
         turn             = false;
         label1.ForeColor = Color.Black;
         label3.ForeColor = Color.Black;
         label2.ForeColor = Color.Yellow;
         label4.ForeColor = Color.Yellow;
     }
     else
     {
         c.BackColor      = Color.Yellow;
         turn             = true;
         label2.ForeColor = Color.Black;
         label4.ForeColor = Color.Black;
         label1.ForeColor = Color.Red;
         label3.ForeColor = Color.Red;
     }
     r.CheckRows(gameBoard, this);
     r.CheckColumns(gameBoard, this);
     r.CheckDiagonals(gameBoard, this);
     r.CheckTie(gameBoard, this);
     c.Enabled = false;
 }
コード例 #5
0
        private void DrawUser(int i, string username, bool online)
        {
            CircularButton cb = new CircularButton();

            cb.FlatStyle = FlatStyle.Flat;
            cb.FlatAppearance.BorderSize = 0;
            cb.Size     = new Size(10, 10);
            cb.TabStop  = false;
            cb.Location = new Point(15, 57 + i * 25);

            // Draws username
            Label temp = new Label();

            temp.Size        = new Size(70, 15);
            temp.Location    = new Point(28, 55 + i * 25);
            temp.BackColor   = Color.DarkGray;
            temp.BorderStyle = BorderStyle.None;
            temp.Text        = username;

            if (online)
            {
                if (selectingGroupChat)
                {
                    temp.Click += UserLabelGroupChatClick;
                }
                else
                {
                    temp.DoubleClick += UserDoubleClick;
                }

                cb.BackColor = Color.Green;
            }
            else
            {
                cb.BackColor = Color.Gray;
            }

            this.PUsers.Controls.Add(cb);
            this.PUsers.Controls.Add(temp);
        }
コード例 #6
0
        private void DrawChatRoomPanel()
        {
            if (InvokeRequired)
            {
                BeginInvoke((MethodInvoker) delegate { DrawChatRoomPanel(); });
            }
            else
            {
                PChatRooms.Controls.Clear();

                const int heightSpacing = 45;
                const int widthSpacing  = 45;

                int i = 0;
                foreach (KeyValuePair <int, ChatRoom> entry in _chatRooms)
                {
                    // do something with entry.Value or entry.Key

                    CircularButton cb = new CircularButton();
                    cb.FlatStyle = FlatStyle.Flat;
                    cb.FlatAppearance.BorderSize = 0;
                    cb.TabStop   = false;
                    cb.ForeColor = Color.White;
                    cb.BackColor = Color.RoyalBlue;
                    cb.Text      = $"Chat{Environment.NewLine}{i + 1}";
                    cb.Size      = new Size(40, 40);
                    cb.Location  = new Point(25 + widthSpacing * (i / 3), 25 + heightSpacing * (i % 3));
                    cb.Name      = $"{entry.Key}";
                    cb.Click    += Cb_Click;

                    PChatRooms.Controls.Add(cb);

                    i++;
                }
            }
        }
コード例 #7
0
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            Pen      pen = new Pen(Color.Red, 2);
            Graphics gr  = e.Graphics;


            // STRAT INTRARE

            for (int u = 0; u < intrare.Count; u++)
            {
                List <CircularButton> Listx = Lista_de_Liste[0];

                CircularButton cb1 = intrare[u];
                Point          p1  = cb1.Location;

                for (int o = 0; o < Listx.Count; o++)
                {
                    CircularButton cb2 = Listx[o];
                    Point          p2  = cb2.Location;

                    gr.DrawLine(pen, p1.X + 55, p1.Y + 23, p2.X, p2.Y + 22);
                }
            }


            // STRAT ASCUNS

            for (int i = 0; i < Lista_de_Liste.Count - 1; i++)
            {
                for (int j = 0; j < Lista_de_Liste[i].Count; j++)
                {
                    List <CircularButton> List1 = Lista_de_Liste[i];
                    CircularButton        cb1   = List1[j];
                    Point p1 = cb1.Location;
                    for (int k = 0; k < Lista_de_Liste[i + 1].Count; k++)
                    {
                        List <CircularButton> List2 = Lista_de_Liste[i + 1];

                        CircularButton cb2 = List2[k];
                        Point          p2  = cb2.Location;
                        gr.DrawLine(pen, p1.X + 55, p1.Y + 23, p2.X, p2.Y + 22);
                    }
                }
            }

            // STRAT IESIRE
            List <CircularButton> List = Lista_de_Liste[Lista_de_Liste.Count - 1];

            for (int l = 0; l < List.Count; l++)
            {
                CircularButton cb1 = List[l];
                Point          p1  = cb1.Location;
                for (int k = 0; k < iesire.Count; k++)
                {
                    CircularButton cb2 = iesire[k];
                    Point          p2  = cb2.Location;

                    gr.DrawLine(pen, p1.X + 55, p1.Y + 23, p2.X, p2.Y + 22);
                }
            }
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TicketForm3_2_PriorityLane));
     this.ticketForm3_2BackBtn = new System.Windows.Forms.Button();
     this.ticketForm3_2CollegeBtn = new DLSLQueueingApp.CircularButton();
     this.ticketForm3_2OthersBtn = new DLSLQueueingApp.CircularButton();
     this.animationTimer = new System.Windows.Forms.Timer(this.components);
     this.SuspendLayout();
     //
     // ticketForm3_2BackBtn
     //
     this.ticketForm3_2BackBtn.FlatAppearance.BorderSize = 0;
     this.ticketForm3_2BackBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
     this.ticketForm3_2BackBtn.Font = new System.Drawing.Font("Times New Roman", 22F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ticketForm3_2BackBtn.ForeColor = System.Drawing.Color.White;
     this.ticketForm3_2BackBtn.Location = new System.Drawing.Point(150, 470);
     this.ticketForm3_2BackBtn.Name = "ticketForm3_2BackBtn";
     this.ticketForm3_2BackBtn.Size = new System.Drawing.Size(230, 84);
     this.ticketForm3_2BackBtn.TabIndex = 13;
     this.ticketForm3_2BackBtn.Text = "⮜- BACK";
     this.ticketForm3_2BackBtn.UseVisualStyleBackColor = true;
     this.ticketForm3_2BackBtn.Click += new System.EventHandler(this.ticketForm3_2BackBtn_Click);
     //
     // ticketForm3_2CollegeBtn
     //
     this.ticketForm3_2CollegeBtn.Font = new System.Drawing.Font("Times New Roman", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ticketForm3_2CollegeBtn.ForeColor = System.Drawing.Color.White;
     this.ticketForm3_2CollegeBtn.Location = new System.Drawing.Point(500, 550);
     this.ticketForm3_2CollegeBtn.Name = "ticketForm3_2CollegeBtn";
     this.ticketForm3_2CollegeBtn.Size = new System.Drawing.Size(900, 180);
     this.ticketForm3_2CollegeBtn.TabIndex = 14;
     this.ticketForm3_2CollegeBtn.Text = "COLLEGE";
     this.ticketForm3_2CollegeBtn.UseVisualStyleBackColor = true;
     this.ticketForm3_2CollegeBtn.Click += new System.EventHandler(this.ticketForm3_2CollegeBtn_Click);
     //
     // ticketForm3_2OthersBtn
     //
     this.ticketForm3_2OthersBtn.Font = new System.Drawing.Font("Times New Roman", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.ticketForm3_2OthersBtn.ForeColor = System.Drawing.Color.White;
     this.ticketForm3_2OthersBtn.Location = new System.Drawing.Point(500, 800);
     this.ticketForm3_2OthersBtn.Name = "ticketForm3_2OthersBtn";
     this.ticketForm3_2OthersBtn.Size = new System.Drawing.Size(900, 180);
     this.ticketForm3_2OthersBtn.TabIndex = 15;
     this.ticketForm3_2OthersBtn.Text = "OTHERS";
     this.ticketForm3_2OthersBtn.UseVisualStyleBackColor = true;
     this.ticketForm3_2OthersBtn.Click += new System.EventHandler(this.ticketForm3_2OthersBtn_Click);
     //
     // animationTimer
     //
     this.animationTimer.Interval = 1;
     this.animationTimer.Tick += new System.EventHandler(this.animationTimer_Tick);
     //
     // TicketForm3_2
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.ClientSize = new System.Drawing.Size(1946, 1106);
     this.Controls.Add(this.ticketForm3_2OthersBtn);
     this.Controls.Add(this.ticketForm3_2CollegeBtn);
     this.Controls.Add(this.ticketForm3_2BackBtn);
     this.DoubleBuffered = true;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name = "TicketForm3_2";
     this.Text = "DLSL Queueing App";
     this.Load += new System.EventHandler(this.TicketForm3_2_Load);
     this.ResumeLayout(false);
 }