Beispiel #1
0
        // -------------------------------------------------        OnLoad
        private void OnLoad (object sender, EventArgs e)
        {
            Auxi_Common .OneColumnPanelComments (this, panelInfo, Font, strInfo, out cyLine);
            rand = Auxi_Common .RandomByCurTime (out nSeed);

            decSideMin = 20;
            decSideMax = 120;
            decSideIncrement = 5;
            numericUD_Side .Minimum = decSideMin;
            numericUD_Side .Maximum = decSideMax;
            numericUD_Side .Increment = decSideIncrement;
            RandomCombination ();
            font = new Font ("Times New Roman", 10, FontStyle .Bold | FontStyle .Italic);
            labelSample .Font = font;
            toolTip1 .SetToolTip (btnFont, Auxi_Convert .FontInDetails (font));

            radioTwoNodes .Checked = true;
            int nNodes = radioTwoNodes .Checked ? 2 : 4;
            nID = 0;
            TwoNodeSquare tns = new TwoNodeSquare (new Rectangle (100, 100, 200, 200), 
                                                   Color .Blue, Color .Black, nID .ToString (), Font, nNodes);
            nID++;
            squares .Add (tns);

            RenewMover ();
        }
Beispiel #2
0
        // -------------------------------------------------		Click_btnNewSquare
        private void Click_btnNewSquare (object sender, EventArgs e)
        {
            int nSide = Convert .ToInt32 (numericUD_Side .Value);
            int cxL = rand .Next (nSeed) % (ClientSize .Width - nSide);
            int cyT = rand .Next (nSeed) % (ClientSize .Height - nSide);

            int nNodes = radioTwoNodes .Checked ? 2 : 4;
            TwoNodeSquare tns = new TwoNodeSquare (new Rectangle (cxL, cyT, nSide, nSide), clrBack, clrText,
                                                   nID .ToString (), font, nNodes);
            nID++;
            squares .Insert (0, tns);
            RenewMover ();
            Invalidate ();
            RandomCombination ();
        }