Exemple #1
0
        // -------------------------------------------------
        public Form_NameView_LTP (List<PersonalInfoView_LTP> viewsSrc)
        {
            InitializeComponent ();
            mover = new Mover ();

            views = viewsSrc;

            listUsedNames .Columns [0] .Width = listUsedNames .Width - (SystemInformation .VerticalScrollBarWidth + 4);
            ShowUsedNames ();
            RestoreFromRegistry ();

            ccNewName = new CommentedControlLTP (this, textNewName, Side .N, StringAlignment .Near, "New name");
            RenewMover ();
        }
        // -------------------------------------------------        OnLoad
        private void OnLoad (object sender, EventArgs e)
        {
            numericUD_Apexes .Value = 7;
            nRadius = Math .Min (ClientSize .Width, ClientSize .Height) / 3;
            ptCenter = new Point (ClientSize .Width * 7 / 12, ClientSize .Height / 2);

            sampleCenter = new SquareSample (new Point (ClientRectangle .Width - 18, 18), halfSq, clrCenter);
            CreatePolygon ();
            CreateApexSamples ();

            ccApexes = new CommentedControlLTP (this, numericUD_Apexes, Side .W, "Apexes");

            penString = new Pen (ControlPaint .Dark (BackColor));
            text = new TextM (this, new Point (ClientSize .Width / 6, ClientSize .Height * 7 / 10), info, Color .Blue);
            text .ShowBackground = false;

            RenewMover ();
            bAfterInit = true;
        }
        // -------------------------------------------------
        public Form_RectangleGeneralCase ()
        {
            InitializeComponent ();
            mover = new Mover (this);
            //Font = new Font ("Times New Roman", 14);

            sizefStrs = Auxi_Geometry .MeasureStrings (this, strs);
            Prepare_lrsView ();

            ccChange = new CommentedControlLTP (this, comboChangeResizing, Side .E, StringAlignment .Center, 4, "Changeable resizing");
            radius = 6;
            halfstrip = 3;
            numericUD_Radius .Value = radius;
            numericUD_HalfStrip .Value = halfstrip;

            DefineRectangles ();
            comboChangeResizing .SelectedIndex = Convert .ToInt32 (rg_Change .Resizing);
            RenewMover ();
            bAfterInit = true;
        }
Exemple #4
0
        // -------------------------------------------------
        public Form_SpottedText ()
        {
            InitializeComponent ();
            Font = new Font ("Times New Roman", 14);
            mover = new Mover (this);

            penLine = new Pen (ControlPaint .Dark (BackColor));
            int hStep = ClientRectangle .Height / (ptAnchor .Length + 1);
            ptAnchor [0] = new Point (ClientRectangle .Width / 4, hStep);
            for (int i = 1; i < ptAnchor .Length; i++)
            {
                ptAnchor [i] = new Point (ptAnchor [0] .X, ptAnchor [0] .Y + hStep * i);
            }
            sample = new SpottedText (this, Auxi_Geometry .Middle (ClientRectangle), TextBasis .E, "Sample", Font, 15, Color .Blue);
            for (int i = 0; i < month .Length; i++)
            {
                month [i] = new SpottedText (this, ptAnchor [i], sample .TextBasis, Auxi_Common .strMonths [i],
                                             Font, sample .Angle_Degree, ForeColor);
                month [i] .ShowSpots = false;
            }
            checkSpots .Checked = month [0] .ShowSpots;
            ccCheck = new CommentedControlLTP (this, checkSpots, Side .E, "Spots on months");
            RenewMover ();
        }
        // -------------------------------------------------        DefaultView
        private void DefaultView ()
        {
            int nH = textName .Height;
            int cxL = 90;
            textName .Bounds = new Rectangle (cxL, 30, 96, nH);
            textSurname .Bounds = new Rectangle (cxL, textName .Bottom + spaces .VerMin, textName .Width, textName .Height);
            int cy = textSurname .Bottom + spaces .VerMin + nH;
            textMonth .Location = new Point (cxL, cy);
            textDay .Location = new Point (textMonth .Right + spaces .HorMin, cy);
            textYear .Location = new Point (textDay .Right + spaces .HorMin, cy);
            tmBirth .Location = new Point (cxL - (tmBirth .Width + 4), textMonth .Top + textMonth .Height / 2 - tmBirth .Height / 2);

            textProfession .Bounds = new Rectangle (cxL, textDay .Bottom + 2 * spaces .VerMin, 300, nH);
            cy = textProfession .Bottom + spaces .VerMin + nH;
            textHomePhone .Bounds = new Rectangle (cxL, cy, 152, nH);
            textOfficePhone .Bounds = new Rectangle (textHomePhone .Right + spaces .HorMin, cy, 152, nH);
            textMobilePhone .Bounds = new Rectangle (textOfficePhone .Right + spaces .HorMin, cy, 152, nH);

            textStreet .Bounds = new Rectangle (cxL, textHomePhone .Bottom + spaces .VerMin + nH, 152, nH);
            textTown .Bounds = new Rectangle (cxL, textStreet .Bottom + spaces .VerMin, 152, nH);
            textProvince .Bounds = new Rectangle (cxL, textTown .Bottom + spaces .VerMin, 152, nH);
            textCountry .Bounds = new Rectangle (cxL, textProvince .Bottom + spaces .VerMin, 152, nH);
            textZipCode .Bounds = new Rectangle (cxL, textCountry .Bottom + spaces .VerMin, 90, nH);

            Rectangle rcAround = Auxi_Geometry .FrameAroundControls (ctrls, spaces);
            ClientSize = new Size (rcAround .Right + spaces .FormSideSpace, rcAround .Bottom + spaces .FormBtmSpace);

            string [] strCC = new string [] {"Name", "Surname", "Month", "Day", "Year", "Profession", 
                                             "Home phone", "Office phone", "Mobile phone", 
                                             "Street", "Town", "Province", "Country", "ZIP code"};

            comctrls [0] = new CommentedControlLTP (this, ctrls [0], Side .W, StringAlignment .Center, 4, strCC [0]);
            comctrls [1] = new CommentedControlLTP (this, ctrls [1], Side .W, StringAlignment .Center, 4, strCC [1]);
            comctrls [2] = new CommentedControlLTP (this, ctrls [2], Side .N, StringAlignment .Near, strCC [2]);
            comctrls [3] = new CommentedControlLTP (this, ctrls [3], Side .N, StringAlignment .Near, strCC [3]);
            comctrls [4] = new CommentedControlLTP (this, ctrls [4], Side .N, StringAlignment .Near, strCC [4]);
            comctrls [5] = new CommentedControlLTP (this, ctrls [5], Side .W, StringAlignment .Center, strCC [5]);
            comctrls [6] = new CommentedControlLTP (this, ctrls [6], Side .N, StringAlignment .Near, strCC [6]);
            comctrls [7] = new CommentedControlLTP (this, ctrls [7], Side .N, StringAlignment .Near, strCC [7]);
            comctrls [8] = new CommentedControlLTP (this, ctrls [8], Side .N, StringAlignment .Near, strCC [8]);
            comctrls [9] = new CommentedControlLTP (this, ctrls [9], Side .W, StringAlignment .Center, strCC [9]);
            comctrls [10] = new CommentedControlLTP (this, ctrls [10], Side .W, StringAlignment .Center, strCC [10]);
            comctrls [11] = new CommentedControlLTP (this, ctrls [11], Side .W, StringAlignment .Center, strCC [11]);
            comctrls [12] = new CommentedControlLTP (this, ctrls [12], Side .W, StringAlignment .Center, strCC [12]);
            comctrls [13] = new CommentedControlLTP (this, ctrls [13], Side .W, StringAlignment .Center, strCC [13]);

            info = new TextM (this, new Point (textProvince .Right + 30, textProvince .Bottom), strInfo);
            info .BackColor = Color .FromArgb (255, 255, 128);
        }
 // -------------------------------------------------
 public PersonalInfoView_LTP (string nm, Size sizeClient, Point ptinf, TextM tm, CommentedControlLTP [] coms)
 {
     name = nm;
     size = sizeClient;
     ptInfo = ptinf;
     txm = tm;
     dccs = new CommentedControlLTP_Data [coms .Length];
     for (int i = 0; i < coms .Length; i++)
     {
         dccs [i] = new CommentedControlLTP_Data (coms [i]);
     }
 }