/// <summary>
 /// The AssignChartExpanders
 /// </summary>
 /// <param name="panel1">The panel1<see cref="ExpandCollapsePanel" /></param>
 /// <param name="panel2">The panel2<see cref="ExpandCollapsePanel" /></param>
 private void AssignChartExpanders(ExpandCollapsePanel panel1, ExpandCollapsePanel panel2)
 {
     try
     {
         Expander1 = panel1;
         Expander2 = panel2;
     }
     catch (Exception ex)
     {
         new Error(ex).ShowDialog();
     }
 }
Example #2
0
        private void CrearExpandible(string text, string n)
        {
            CustomerPredictionPane c1 = new CustomerPredictionPane();

            c1.setText(text);
            c1.Height -= 50;
            c1.Width  -= 50;
            ExpandCollapsePanel ex = new ExpandCollapsePanel();

            ex.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
            ex.ButtonSize  = MakarovDev.ExpandCollapsePanel.ExpandCollapseButton.ExpandButtonSize.Normal;
            ex.ButtonStyle = MakarovDev.ExpandCollapsePanel.ExpandCollapseButton.ExpandButtonStyle.MagicArrow;
            ex.Controls.Add(c1);
            ex.ExpandedHeight = 405;
            ex.IsExpanded     = false;
            ex.Location       = new System.Drawing.Point(3, 3);
            ex.Name           = n;
            ex.Size           = new System.Drawing.Size(1000, 376);
            ex.TabIndex       = 1;
            ex.Text           = "Codigo: " + n;
            ex.UseAnimation   = false;
            ex.ButtonStyle    = ExpandCollapseButton.ExpandButtonStyle.MagicArrow;
            customerPane1.addControlToTheAdvanceControl(ex);
        }
Example #3
0
 public void addControlToTheAdvanceControl(ExpandCollapsePanel ad)
 {
     advancedFlowLayoutPanel1.Controls.Add(ad);
 }
Example #4
0
 public MyButton(int taskTaskId, ExpandCollapsePanel ecp)
 {
     id  = taskTaskId;
     ecp = panel;
 }
Example #5
0
 public MyButton(ExpandCollapsePanel panel)
 {
     this.panel = panel;
 }
Example #6
0
        public void setnewCom(Task task)
        {
            //            Panel panF1 = new  Panel();
            ecp             = new ExpandCollapsePanel();
            ecp.ButtonStyle = ExpandCollapseButton.ExpandButtonStyle.Triangle;
            ecp.ButtonSize  = ExpandCollapseButton.ExpandButtonSize.Small;
            ecp.Width       = 510;
            ecp.Height      = 400;
            ecp.BorderStyle = BorderStyle.FixedSingle;

            //            ecp.AutoScroll = true;

            ecp.Visible = true;
            //
            ecp.Font = new Font(FontFamily.GenericSansSerif, 9f, FontStyle.Bold);

            ecp.UseAnimation = false; // disable animation for immediately collapsing
            ecp.IsExpanded   = false; // collapse all panels
                                      //            ecp.UseAnimation = true; // enable animation for further user clicks

            // set up
            ecp.Text = task.TaskName;
            Label          taskID   = new Label();
            TextBox        taskName = new TextBox();
            DateTimePicker date     = new DateTimePicker();
            DateTimePicker timeFrom = new DateTimePicker();
            DateTimePicker timeTo   = new DateTimePicker();

            timeFrom.Format       = DateTimePickerFormat.Custom;
            timeTo.Format         = DateTimePickerFormat.Custom;
            timeFrom.CustomFormat = "HH:mm";
            timeTo.CustomFormat   = "HH:mm";


            TextBox     location  = new TextBox();
            TextBox     detail    = new TextBox();
            RadioButton p1        = new RadioButton();
            RadioButton p2        = new RadioButton();
            RadioButton p3        = new RadioButton();
            RadioButton p4        = new RadioButton();
            RadioButton p5        = new RadioButton();
            ComboBox    timeTag   = new ComboBox();
            CheckBox    isFullDay = new CheckBox();
            ComboBox    category  = new ComboBox();

            MyButton bt_close = new MyButton(ecp);

            bt_close.Text = "Close";

            MyButton bt_edit = new MyButton(task.TaskID, taskName, timeFrom, timeTo, location, detail, p1, p2, p3, p4, p5, timeTag, category, isFullDay, date);

            bt_edit.Text = "Edit";
            MyButton bt_dele = new MyButton(task.TaskID, ecp);

            bt_dele.Text = "Delete";
            GroupBox groupBox = new GroupBox();

            /*int id, TextBox taskName, TextBox timeFrom, TextBox timeTo, TextBox loction, TextBox detail, RadioButton p1, RadioButton p2, RadioButton p3, RadioButton p4, RadioButton p5, ComboBox timeTag, ComboBox category, CheckBox isFullDay, DateTimePicker date)
             */
            // label
            Label t = new Label();

            t.Text = "To";


            Label lbName = new Label();

            lbName.Text = "Name";
            Label lbDate = new Label();

            lbDate.Text = "Date";
            Label lbTime = new Label();

            lbTime.Text = "Time";
            Label lbloc = new Label();

            lbloc.Text = "Location";
            Label lbDetail = new Label();

            lbDetail.Text = "Detail";
            Label lbPrio = new Label();

            lbPrio.Text = "Priority";
            Label lbTag = new Label();

            lbTag.Text = "Tag";
            Label lbCate = new Label();

            lbCate.Text = "Category";
            ecp.Controls.Add(t);
            ecp.Controls.Add(lbName);
            ecp.Controls.Add(lbDate);
            ecp.Controls.Add(lbTime);
            ecp.Controls.Add(lbloc);
            ecp.Controls.Add(lbDetail);
            ecp.Controls.Add(lbPrio);
            ecp.Controls.Add(lbTag);
            ecp.Controls.Add(lbCate);



            groupBox.Controls.Add(p1);
            groupBox.Controls.Add(p2);
            groupBox.Controls.Add(p3);
            groupBox.Controls.Add(p4);
            groupBox.Controls.Add(p5);

            //
            int  nextY = 45;
            int  nextX = 130;
            int  w     = 250;
            int  h     = 25;
            Size s     = new Size(w, h);
            int  tab   = 50;

            Font f = new Font("Microsoft Sans Serif", 8, FontStyle.Bold);

            //
            ecp.Controls.Add(date);
            ecp.Controls.Add(taskID);
            ecp.Controls.Add(taskName);
            ecp.Controls.Add(timeFrom);
            ecp.Controls.Add(timeTo);
            ecp.Controls.Add(location);
            ecp.Controls.Add(detail);
            ecp.Controls.Add(p1);
            ecp.Controls.Add(p2);
            ecp.Controls.Add(p3);
            ecp.Controls.Add(p4);
            ecp.Controls.Add(p5);
            ecp.Controls.Add(timeTag);
            ecp.Controls.Add(isFullDay);
            ecp.Controls.Add(category);
            ecp.Controls.Add(bt_close);
            ecp.Controls.Add(bt_dele);
            ecp.Controls.Add(bt_edit);

            //            // id
            //            taskID.Text = task.TaskID.ToString();
            //            taskID.Location = new Point(nextX, nextY);
            //            nextY += 30;
            //            // name
            int temp = nextX - 100;

            lbName.Location   = new Point(temp, nextY);
            taskName.Text     = task.TaskName;
            taskName.Location = new Point(nextX, nextY);
            taskName.Font     = f;
            taskName.AutoSize = false;
            taskName.Size     = s;
            taskName.Enabled  = false;
            nextY            += 30;
            //date
            lbDate.Location = new Point(temp, nextY);

            date.Value    = task.Date;
            date.Location = new Point(nextX, nextY);
            date.Font     = f;
            date.Size     = s;
            date.Enabled  = false;
            nextY        += 30;
            //from
            lbTime.Location = new Point(temp, nextY);

            timeFrom.Text     = task.TimeFrom;
            timeFrom.Font     = f;
            timeFrom.Enabled  = false;
            timeFrom.Size     = new Size(60, h);
            timeFrom.Location = new Point(nextX, nextY);
            //
            t.Location = new Point(nextX + 60, nextY);
            t.Size     = new Size(30, 25);
            // to
            timeTo.Text     = task.TimeTo;
            timeTo.Font     = f;
            timeTo.Enabled  = false;
            timeTo.Size     = new Size(60, 25);
            timeTo.Location = new Point(nextX + 90, nextY);

            isFullDay.Text     = "Full Day";
            isFullDay.Location = new Point(nextX + 180, nextY);
            isFullDay.Size     = s;
            isFullDay.Enabled  = false;
            isFullDay.Font     = f;
            nextY += 30;
            // loc
            lbloc.Location = new Point(temp, nextY);

            location.Text    = task.Location;
            location.Size    = s;
            location.Font    = f;
            location.Enabled = false;

            location.Location = new Point(nextX, nextY);
            nextY            += 30;

            // detail
            lbDetail.Location = new Point(temp, nextY);

            detail.Text = task.Detail;
            detail.Size = new Size(250, 70);

            detail.Font      = f;
            detail.Multiline = true;
            detail.Location  = new Point(nextX, nextY);
            detail.Enabled   = false;
            nextY           += 100;

            // p
            lbPrio.Location = new Point(temp, nextY);

            p1.Text     = 1.ToString();
            p1.Location = new Point(nextX, nextY);
            checkPriority(task, p1);
            p1.Enabled  = false;
            p1.AutoSize = true;
            p1.Font     = f;

            p2.Text     = 2.ToString();
            p2.Location = new Point(nextX + tab, nextY);
            checkPriority(task, p2);
            p2.Enabled  = false;
            p2.AutoSize = true;
            p2.Font     = f;


            p3.Text     = 3.ToString();
            p3.Location = new Point(nextX + tab * 2, nextY);
            checkPriority(task, p3);
            p3.Enabled  = false;
            p3.AutoSize = true;
            p3.Font     = f;

            p4.Text     = 4.ToString();
            p4.Location = new Point(nextX + tab * 3, nextY);
            checkPriority(task, p4);
            p4.Enabled  = false;
            p4.AutoSize = true;
            p4.Font     = f;

            p5.Text     = 5.ToString();
            p5.Location = new Point(nextX + tab * 4, nextY);
            p5.AutoSize = true;
            checkPriority(task, p5);
            p5.Enabled = false;

            p5.Font = f;
            nextY  += 30;

            //


            //
            lbCate.Location = new Point(temp, nextY);

            category.DataSource    = db.getAllCategory();
            category.DisplayMember = "categoryName";
            category.ValueMember   = "categoryID";
            timeTag.DataSource     = db.GetAllTimeTags(1);
            timeTag.DisplayMember  = "TimeTagName";
            timeTag.ValueMember    = "TimeTagID";
            category.Text         += task.CategoryID;

            category.Size     = new Size(100, h);
            category.Font     = f;
            category.Enabled  = false;
            category.Location = new Point(nextX, nextY);
            //
            lbTag.Location = new Point(nextX + 110, nextY);
            lbTag.Size     = new Size(45, 25);
            //
            timeTag.Text     = task.TimeTagID.ToString();
            timeTag.Location = new Point(nextX + 170, nextY);
            timeTag.Font     = f;
            timeTag.Enabled  = false;
            timeTag.Size     = new Size(80, h);

            nextY += 30;
            nextY += 30;
            // xu ly ui



            bt_close.Location = new Point(nextX + w, nextY);
            bt_edit.Location  = new Point(nextX + w - bt_close.Width - 10, nextY);
            bt_dele.Location  = new Point(nextX + w - bt_close.Width - 10 - bt_edit.Width - 10, nextY);
            bt_close.panel    = ecp;
            // close event
            bt_close.Click += new EventHandler(Button_Close_Click);
            // dele event
            bt_dele.Click += new EventHandler(Button_Dele_Click);
            // edit event
            bt_edit.Click += new EventHandler(Button_Edit_Click);



            pMyTask.Controls.Add(ecp);
        }