示例#1
0
文件: Node.cs 项目: LamHV155/MindMap
        public Node(int id, string label, Point location, Size size, Board board, Color bcolor, Color fcolor, mPath path, float size2, string font, int textsise, string shape, Node parent) : base()
        {
            SetStyle(ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true);

            this.id = id;
            if (parent is null)
            {
                this.parent = this;
            }
            else
            {
                this.parent = parent;
            }
            this.Location          = location;
            this.curLocation       = location;
            this.curParentLocation = this.parent.Location;
            this.Size      = size;
            this.board     = board;
            this.BackColor = bcolor;

            this.ForeColor = fcolor;
            this.path      = path;
            this.Font      = new Font(font, textsise);
            this.Text      = label;
            this.FlatStyle = FlatStyle.Flat;
            this.shape     = shape;
            this.size      = size2;

            this.LocationChanged        += Node_LocationChanged;
            this.parent.LocationChanged += Parent_LocationChanged;
            this.parent.Disposed        += Parent_Disposed;
            this.DoubleClick            += Node_DoubleClick;
            this.SizeChanged            += Node_SizeChanged;
            cShape();

            drawPath(this.Location, this.parent.Location, Color.Black, this.path.size);
            ControlExtension.Draggable(this, true);
        }
        //when add Node button click
        private void btnAddNode_Click(object sender, EventArgs e)
        {
            if (textBoxNodeName.Text.Trim() != "")
            {
                int    t         = this.NodeCount + 1;
                String nodeName  = "label" + t.ToString();
                Label  nodeLabel = (Label)this.Controls.Find(nodeName, true)[0];
                int    col       = NodeCount % 10;
                int    row       = NodeCount / 10;

                //set initial location
                int startX = 100;
                int startY = 300;
                nodeLabel.Location = new Point(startX + (40 * col), startY + (50 * row));
                nodeLabel.Text     = textBoxNodeName.Text;
                nodeLabel.Visible  = true;
                ControlExtension.Draggable(nodeLabel, true);
                this.NodeCount++;


                //add event to newNode
                nodeLabel.Move        += new EventHandler(refreshWhenMove);
                nodeLabel.DoubleClick += new EventHandler(nodeLabelDoubleClick);
                nodeLabel.Click       += new EventHandler(nodeLabelClick);
                //load ComboBox
                loadComboBox();

                //set text on comboBox
                t = this.NodeCount + 1;
                textBoxNodeName.Text = t.ToString();
            }
            else
            {
                MessageBox.Show("กรุณากรอกชื่อโหนด");
            }
        }
示例#3
0
        public void CrearPanel(ref Panel panel)                                                //permite crear un panel con una clase
        {
            MenuItem[] menuItems = new MenuItem[] { new MenuItem("Modificar", MenuItem_Click), //hacemos esto para definir como se comportaran luego
                                                    new MenuItem("Reiniciar", MenuItem_Click), new MenuItem("Exit", MenuItem_Click) };
            ContextMenu buttonMenu = new ContextMenu(menuItems);

            panel.Location = new System.Drawing.Point(570, 370);
            panel.Name     = "Panel " + paneles.Count;//se poodria cambiar por parametro aunque no me parecee necesario
            panel.Size     = new System.Drawing.Size(228, 201);
            Figura_Clase fig = new Figura_Clase(panel.Size);

            Formas.Formas.Add(fig);
            panel.BackgroundImage = Image.FromFile(Formas.GetNewBackground());
            panel.BackColor       = Color.LightBlue;
            panel.ContextMenu     = buttonMenu;
            panel.Click          += PointForRelation;//Se guarda en los puntos para utilizarlos en relaciones
            panel.MouseClick     += PnlMouseDown;
            panel.MouseMove      += PnlMouseMove;
            panel.MouseUp        += PnlMouseUp;
            ControlExtension.Draggable(panel, true);
            fig.Contenedor = panel;
            //Controls.Add(panel);
            masterPanel.Controls.Add(panel);
        }
示例#4
0
 private void Btn_layoutEditor_Click(object sender, EventArgs e)
 {
     if (inEditMode)
     {
         inEditMode            = false;
         btn_layoutEditor.Text = "Edit";
         enableShowHideControls(false);
         changeMoveCursor(false);
         ControlExtension.Draggable(RG_student, false);
         ControlExtension.Draggable(panel_serviceStatus, false);
         ControlExtension.Draggable(classPresentChart, false);
         saveControlsProperty();
     }
     else
     {
         inEditMode            = true;
         btn_layoutEditor.Text = "Save";
         enableShowHideControls(true);
         changeMoveCursor(true);
         ControlExtension.Draggable(RG_student, true);
         ControlExtension.Draggable(panel_serviceStatus, true);
         ControlExtension.Draggable(classPresentChart, true);
     }
 }
示例#5
0
        //Git Medřický
        // můj nový řádek

        public Command()
        {
            InitializeComponent();
            ControlExtension.Draggable(this, true);
        }
示例#6
0
 private void PhotoViewer_Load(object sender, EventArgs e)
 {
     finestraImmagine.Image = new Bitmap(Cartella.programmaCompleto);
     ControlExtension.Draggable(panelImmagini, true);
 }
示例#7
0
 private void BasicClientDownload_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(this, true);
 }
示例#8
0
 public Login()
 {
     InitializeComponent();
     LoadSettings();
     ControlExtension.Draggable(this, true);
 }
示例#9
0
 private void ChkDrag_CheckedChanged(object sender, EventArgs e)
 {
     ControlExtension.Draggable(BtnDrag, ChkDrag.Checked);
     ControlExtension.Draggable(ChkDrag, ChkDrag.Checked);
     ControlExtension.Draggable(LblDrag, ChkDrag.Checked);
 }
示例#10
0
 private void Login_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(this, true);
 }
示例#11
0
 /// <summary>
 /// Error message
 /// </summary>
 /// <param name="htmlHelper">HtmlHelper</param>
 /// <param name="textOrHtml">text or html</param>
 /// <param name="isHtml">indicates the textOrHtml is html or plain text</param>
 /// <param name="htmlAttributes">html attributes</param>
 /// <returns>MvcHtmlString</returns>
 public static MvcHtmlString ErrorMessage(this HtmlHelper htmlHelper, string textOrHtml, bool isHtml = false, object htmlAttributes = null)
 {
     return(ControlExtension.Message(htmlHelper, MessageType.Error, textOrHtml, isHtml, htmlAttributes));
 }
 public void setDraggable(bool enable)
 {
     ControlExtension.Draggable(label_keyboard, enable);
     ControlExtension.Draggable(pictureBox_mouse, enable);
 }
示例#13
0
 public Form3_1(Login l)
 {
     InitializeComponent();
     this.l = l;
     ControlExtension.Draggable(this, true);
 }
示例#14
0
        public void GorevYukle(GroupBox[,] groupGorev, ComboBox[,] comboGorev, ComboBox[,] comboGorevli, RichTextBox[,] txtGorevAciklama, DateTimePicker[,] dateSonTeslim, JButton[,] silButonlari, EventHandler Sil, EventHandler Kilitle, MouseEventHandler TasiKonum, int Top, string aciklama, string gorevTipi, Color renk)
        {
            for (int i = 0; i < 15; i++)
            {
                for (int k = 0; k < 1; k++)
                {
                    groupGorev[i, k]              = new GroupBox();
                    dateSonTeslim[i, k]           = new DateTimePicker();
                    txtGorevAciklama[i, k]        = new RichTextBox();
                    comboGorevli[i, k]            = new ComboBox();
                    comboGorev[i, k]              = new ComboBox();
                    labelGorevTipi[i, k]          = new Label();
                    labelGorevliAdi[i, k]         = new Label();
                    silButonlari[i, k]            = new JButton();
                    kilitButonlari[i, k]          = new JButton();
                    labelGorevTipi[i, k].Text     = "Görev Tipi:";
                    labelGorevliAdi[i, k].Text    = "Görevli Kişi";
                    groupGorev[i, k].Left         = 8;
                    groupGorev[i, k].Top          = Top;
                    groupGorev[i, k].Width        = 220;
                    groupGorev[i, k].Height       = 180;
                    comboGorevli[i, k].Width      = 100;
                    dateSonTeslim[i, k].Width     = 199;
                    txtGorevAciklama[i, k].Width  = 200;
                    txtGorevAciklama[i, k].Height = 50;
                    txtGorevAciklama[i, k].Text   = aciklama + Environment.NewLine;
                    groupGorev[i, k].Text         = gorevTipi;
                    groupGorev[i, k].ForeColor    = renk;
                    groupGorev[i, k].Font         = new Font(this.Font.FontFamily, 9);
                    silButonlari[i, k].i          = i;
                    silButonlari[i, k].k          = k;
                    silButonlari[i, k].Size       = new Size(20, 20);
                    silButonlari[i, k].Text       = "x";
                    silButonlari[i, k].Click     += Sil;
                    kilitButonlari[i, k].i        = i;
                    kilitButonlari[i, k].k        = k;
                    kilitButonlari[i, k].Size     = new Size(20, 20);
                    kilitButonlari[i, k].Text     = "ª";
                    kilitButonlari[i, k].Click   += Kilitle;
                    butonAciklama.SetToolTip(silButonlari[i, k], "Bu story'yi silmek için tıklayınız.");
                    butonAciklama.SetToolTip(kilitButonlari[i, k], "Bu story'yi kilitlemek için tıklayınız.");
                    groupGorev[i, k].MouseUp += TasiKonum;

                    Point comboGorevYer     = new Point(110, 30);
                    Point dateYer           = new Point(10, 150);
                    Point labelGorevTipiYer = new Point(10, 33);
                    Point lblGorevliYer     = new Point(10, 60);
                    Point comboGorevliYer   = new Point(110, 60);
                    Point richYer           = new Point(10, 90);
                    Point silButonP         = new Point(200, 5);
                    Point kilitButonP       = new Point(180, 5);

                    dateSonTeslim[i, k].Location    = dateYer;
                    txtGorevAciklama[i, k].Location = richYer;
                    comboGorevli[i, k].Location     = comboGorevliYer;
                    labelGorevTipi[i, k].Location   = labelGorevTipiYer;
                    labelGorevliAdi[i, k].Location  = lblGorevliYer;
                    comboGorev[i, k].Location       = comboGorevYer;
                    comboGorev[i, k].Width          = 100;
                    silButonlari[i, k].Location     = silButonP;
                    kilitButonlari[i, k].Location   = kilitButonP;

                    //GroupBox içerisine görevleri include ediyoruz.
                    groupGorev[i, k].Controls.Add(labelGorevTipi[i, k]);
                    groupGorev[i, k].Controls.Add(txtGorevAciklama[i, k]);
                    groupGorev[i, k].Controls.Add(comboGorevli[i, k]);
                    groupGorev[i, k].Controls.Add(labelGorevliAdi[i, k]);
                    groupGorev[i, k].Controls.Add(comboGorev[i, k]);
                    groupGorev[i, k].Controls.Add(dateSonTeslim[i, k]);
                    groupGorev[i, k].Controls.Add(silButonlari[i, k]);
                    groupGorev[i, k].Controls.Add(kilitButonlari[i, k]);

                    //En son GroupBox'u Forma ekleyip kaydırılabilir yapıyoruz.
                    this.Controls.Add(groupGorev[i, k]);
                    ControlExtension.Draggable(groupGorev[i, k], true);
                }
            }
        }
示例#15
0
        /// <summary>
        /// Creates the Rule Block element.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public Control CreateElement(string name, Point?location = null)
        {
            Panel panel = new Panel();

            panel.Width       = 150;
            panel.Height      = 50;
            panel.MinimumSize = new Size(150, 50);
            panel.Name        = "panelRuleBlock" + name;

            panel.BackColor = Color.DarkGray;
            panel.ForeColor = Color.DimGray;

            panel.BorderStyle = BorderStyle.None;
            panel.Tag         = name;

            panel.Font     = new Font("Arial", 8, FontStyle.Bold);
            panel.Location = location ?? new Point(250, 10);

            ControlExtension.Draggable(panel, true);

            Label variable = new Label();

            //variable.BackColor = Color.Gainsboro;
            //variable.ForeColor = Color.DimGray;

            variable.BorderStyle = BorderStyle.FixedSingle;
            variable.Enabled     = false;

            variable.Text      = name;
            variable.TextAlign = ContentAlignment.TopCenter;
            //variable.Name = "labelRuleBlock" + name;

            //variable.Width = 110;
            //variable.Height = 30;

            //variable.Font = new Font("Arial", 8, FontStyle.Bold);
            //variable.Location = new Point(250, 10);

            variable.Dock = DockStyle.Fill;


            Label variableAggregation = new Label();

            variableAggregation.BorderStyle = BorderStyle.None;
            variableAggregation.Enabled     = false;

            variableAggregation.Text      = "Min/Max";
            variableAggregation.TextAlign = ContentAlignment.BottomRight;
            //variable.Name = "labelRuleBlock" + name;

            //variable.Width = 110;
            //variable.Height = 30;

            //variable.Font = new Font("Arial", 8, FontStyle.Bold);
            //variable.Location = new Point(250, 10);

            variableAggregation.Dock = DockStyle.Bottom;
            variable.Controls.Add(variableAggregation);

            panel.Controls.Add(variable);

            return(panel);
        }
示例#16
0
 private void FormEmailSender_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(this, true);
 }
示例#17
0
 private void MakeDraggable(object sender, EventArgs e)
 {
     ControlExtension.Draggable((Control)sender, true);
 }
示例#18
0
 private void ScrumTable_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(pnlNotStarted, true);
     ControlExtension.Draggable(pnlInProgress, true);
     ControlExtension.Draggable(pnlDone, true);
 }
示例#19
0
 /// <summary>
 /// H5
 /// </summary>
 /// <param name="htmlHelper">HtmlHelper</param>
 /// <param name="text">text</param>
 /// <param name="htmlAttributes">html attributes</param>
 /// <returns>MvcHtmlString</returns>
 public static MvcHtmlString H5(this HtmlHelper htmlHelper, string text, object htmlAttributes = null)
 {
     return(ControlExtension.Header(htmlHelper, HeadLevel.h5, text, htmlAttributes));
 }
示例#20
0
 public fSignup()
 {
     InitializeComponent();
     ControlExtension.Draggable(button1, true);
 }
示例#21
0
 private void lbtext()
 {
     ControlExtension.Draggable(lbTxt, true);
     lbTxt.Parent    = pictureBox1;
     lbTxt.BackColor = Color.Transparent;
 }
示例#22
0
 private void InitializePboxes()
 {
     ControlExtension.Draggable(Scout1, true);
     ControlExtension.Draggable(AA1, true);
     ControlExtension.Draggable(AA2, true);
     ControlExtension.Draggable(MG1, true);
     ControlExtension.Draggable(MG2, true);
     ControlExtension.Draggable(MG3, true);
     ControlExtension.Draggable(Sniper1, true);
     ControlExtension.Draggable(Sniper2, true);
     ControlExtension.Draggable(Sniper3, true);
     ControlExtension.Draggable(Sniper4, true);
     ControlExtension.Draggable(Tank1, true);
     ControlExtension.Draggable(Tank2, true);
     ControlExtension.Draggable(Tank3, true);
     ControlExtension.Draggable(Tank4, true);
     ControlExtension.Draggable(Tank5, true);
     Scout1.Visible  = false;
     AA1.Visible     = false;
     AA2.Visible     = false;
     MG1.Visible     = false;
     MG2.Visible     = false;
     MG3.Visible     = false;
     Sniper1.Visible = false;
     Sniper2.Visible = false;
     Sniper3.Visible = false;
     Sniper4.Visible = false;
     Tank1.Visible   = false;
     Tank2.Visible   = false;
     Tank3.Visible   = false;
     Tank4.Visible   = false;
     Tank5.Visible   = false;
     mgobstacles.Add(MG1);
     mgobstacles.Add(MG2);
     mgobstacles.Add(MG3);
     sniperobstacles.Add(Sniper1);
     sniperobstacles.Add(Sniper2);
     sniperobstacles.Add(Sniper3);
     sniperobstacles.Add(Sniper4);
     tankobstacles.Add(Tank1);
     tankobstacles.Add(Tank2);
     tankobstacles.Add(Tank3);
     tankobstacles.Add(Tank4);
     tankobstacles.Add(Tank5);
     allobstacles.Add(Scout1);
     allobstacles.Add(AA1);
     allobstacles.Add(AA2);
     allobstacles.Add(MG1);
     allobstacles.Add(MG2);
     allobstacles.Add(MG3);
     allobstacles.Add(Sniper1);
     allobstacles.Add(Sniper2);
     allobstacles.Add(Sniper3);
     allobstacles.Add(Sniper4);
     allobstacles.Add(Tank1);
     allobstacles.Add(Tank2);
     allobstacles.Add(Tank3);
     allobstacles.Add(Tank4);
     allobstacles.Add(Tank5);
     EnemyBuildings.Add(pbCommstower);
     EnemyBuildings.Add(pbHeadquarters);
     EnemyBuildings.Add(pbBarracks);
     EnemyBuildings.Add(pbMedbay);
     EnemyBuildings.Add(pbArmory);
     EnemyBuildings.Add(pbAircraftrunway);
     EnemyBuildings.Add(pbAircrafthangar);
     EnemyBuildings.Add(pbGym);
     EnemyBuildings.Add(pbVehiclebay);
     EnemyBuildings.Add(pbDiningarea);
 }
 private void Form1_Load(object sender, EventArgs e)
 {
     ControlExtension.Draggable(textBox1, true);
 }
示例#24
0
        public Form2()
        {
            InitializeComponent();

            this.TopMost = true;

            ControlExtension.Draggable(panel5, true);
            ControlExtension.Draggable(panel1, true);
            ControlExtension.Draggable(panel2, true);
            ControlExtension.Draggable(panel3, true);
            ControlExtension.Draggable(panel4, true);
            ControlExtension.Draggable(panel6, true);

            if (resc.firstrun == false)
            {
                panel5.Location = new Point(resc.MainRadarX, resc.MainRadarY + 22);
                panel4.Location = new Point(resc.MainNameX, resc.MainNameY);
                panel3.Location = new Point(resc.GUIHostX, resc.GUIHostY);
                panel2.Location = new Point(resc.GUIShortcutsX, resc.GUIShortcutsY);
                panel1.Location = new Point(resc.GUITPX, resc.GUITPY);
                panel6.Location = new Point(resc.GUICheatsX, resc.GUICheatsY);

                if (resc.HideRadar == true)
                {
                    checkBox1.Checked = true;
                }
                if (resc.HideRadar == false)
                {
                    checkBox1.Checked = false;
                }

                if (resc.HidePlayer == true)
                {
                    checkBox2.Checked = true;
                }
                if (resc.HidePlayer == false)
                {
                    checkBox2.Checked = false;
                }


                if (resc.GUIradarClosed == true)
                {
                    panel5.Size      = new Size(panel5.Width, 25);
                    panel5.BackColor = Color.DarkSlateGray;
                    button20.Text    = "Open";
                }
                if (resc.GUIradarClosed == false)
                {
                    panel5.Size      = new Size(panel5.Width, 316);
                    panel5.BackColor = Color.Black;
                    button20.Text    = "Close";
                }

                if (resc.GUINameClosed == true)
                {
                    panel4.Size      = new Size(panel4.Width, 30);
                    panel4.BackColor = Color.DarkSlateGray;
                    button45.Text    = "Open";
                }
                if (resc.GUINameClosed == false)
                {
                    panel4.Size      = new Size(panel4.Width, 368);
                    panel4.BackColor = Color.Black;
                    button45.Text    = "Close";
                }

                if (resc.GUITPClosed == true)
                {
                    panel1.Size      = new Size(panel1.Width, 25);
                    panel1.BackColor = Color.DarkSlateGray;
                    button41.Text    = "Open";
                }
                if (resc.GUITPClosed == false)
                {
                    panel1.Size      = new Size(panel1.Width, 329);
                    panel1.BackColor = Color.Black;
                    button41.Text    = "Close";
                }

                //l
                if (resc.GUIHostClosed == true)
                {
                    panel3.Size      = new Size(panel3.Width, 25);
                    panel3.BackColor = Color.DarkSlateGray;
                    button1.Text     = "Open";
                }
                if (resc.GUIHostClosed == false)
                {
                    panel3.Size      = new Size(panel3.Width, 480);
                    panel3.BackColor = Color.Black;
                    button1.Text     = "Close";
                }

                //ll
                if (resc.GUIShortcutsClosed == true)
                {
                    panel2.Size      = new Size(panel2.Width, 30);
                    panel2.BackColor = Color.DarkSlateGray;
                    button2.Text     = "Open";
                }
                if (resc.GUIShortcutsClosed == false)
                {
                    panel2.Size      = new Size(panel2.Width, 322);
                    panel2.BackColor = Color.Black;
                    button2.Text     = "Close";
                }

                if (resc.GUICheatsClosed == true)
                {
                    panel6.Size      = new Size(panel6.Width, 30);
                    panel6.BackColor = Color.DarkSlateGray;
                    button46.Text    = "Open";
                }
                if (resc.GUICheatsClosed == false)
                {
                    panel6.Size      = new Size(panel6.Width, 192);
                    panel6.BackColor = Color.Black;
                    button46.Text    = "Close";
                }
            }
        }