Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            AutoScaleMode = AutoScaleMode.Dpi;
            DockAreas     = DockAreas.Document | DockAreas.Float;
            CustomInitialize();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");


            //textBox1.Text = objets.ToCPCDosCPlus();
        }
Ejemplo n.º 2
0
        public UCButton(CpcDosCPlusBouton button)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");
            propertyGrid1.SelectedObject = button;
            //TODO: Gérer proprement le binding bi-directionnel
            int TailleX = int.Parse(button.SizeX);
            int TailleY = int.Parse(button.SizeY);

            button1.Text   = button.Text;
            button1.Width  = TailleX;
            button1.Height = TailleY;
            FormCollection nbforms = Application.OpenForms;
            Button         monbouton;

            monbouton = new Button();

            //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox
            nbforms["preview"].Controls.Add(monbouton);

            monbouton.Location = new Point(int.Parse(button.Px), int.Parse(button.Py));
            monbouton.Size     = new Size(TailleX, TailleY);
            monbouton.Text     = button.Text;

            string CouleurFOND;
            string red   = "255";
            string green = "255";
            string blue  = "255";

            CouleurFOND   = button.BackColor;
            textBox1.Text = CouleurFOND;
            if (CouleurFOND == null)
            {
                CouleurFOND = "255,255,255";
            }
            else
            {
                red = CouleurFOND.Substring(0, 3);
            }
            green = CouleurFOND.Substring(4, 3);
            blue  = CouleurFOND.Substring(8, 3);



            button1.BackColor   = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue));
            monbouton.BackColor = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue));
        }
Ejemplo n.º 3
0
        public UCTextBox(CpcDosCPlusTextBox textBox)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");
            propertyGrid1.SelectedObject = textBox;
            //TODO: Gérer proprement le binding bi-directionnel
            int TailleX = int.Parse(textBox.SizeX);
            int TailleY = int.Parse(textBox.SizeY);

            textBox1.Text   = textBox.Text;
            textBox1.Width  = TailleX;
            textBox1.Height = TailleY;
            FormCollection nbforms = Application.OpenForms;
            TextBox        montxtbox;

            montxtbox = new TextBox();


            nbforms["preview"].Controls.Add(montxtbox);

            montxtbox.Location  = new Point(int.Parse(textBox.Px), int.Parse(textBox.Py));
            montxtbox.Size      = new Size(TailleX, TailleY);
            montxtbox.Multiline = true;
            montxtbox.Text      = textBox.Text;


            string CouleurFOND;

            CouleurFOND = textBox.BackColor;
            if (CouleurFOND != null)
            {
                textBox5.Text      = textBox.BackColor.Substring(0, 3);
                textBox7.Text      = textBox.BackColor.Substring(4, 3);
                textBox8.Text      = textBox.BackColor.Substring(8, 3);
                textBox1.BackColor = Color.FromArgb(int.Parse(textBox5.Text), int.Parse(textBox7.Text), int.Parse(textBox8.Text));
            }
            else
            {
                textBox1.BackColor = Color.FromArgb(int.Parse(textBox5.Text), int.Parse(textBox7.Text), int.Parse(textBox8.Text));
            }
        }
Ejemplo n.º 4
0
        public UCButton(CpcDosCPlusBouton button)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");

            //TODO: Gérer proprement le binding bi-directionnel
            TailleX        = int.Parse(button.SizeX);
            TailleY        = int.Parse(button.SizeY);
            PositionX      = int.Parse(button.Px);
            PositionY      = int.Parse(button.Py);
            button1.Text   = button.Text;
            button1.Width  = TailleX;
            button1.Height = TailleY;
            Nom            = button.ID;
            Btext          = button.Text;
            Bevent         = button.Event;
            Bopacite       = button.Opacity;
            Bparameters    = button.Parameters;
            FormCollection nbforms = Application.OpenForms;
            Button         monbouton;

            monbouton = new Button();

            //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox
            // nbforms["preview"].Controls.Add(monbouton);

            monbouton.Location = new Point(int.Parse(button.Px), int.Parse(button.Py));
            monbouton.Size     = new Size(TailleX, TailleY);
            monbouton.Text     = button.Text;

            CouleurFOND   = button.BackColor;
            CouleurText   = button.TextColor;
            textBox1.Text = CouleurFOND;
            // FOND
            if (CouleurFOND == null)
            {
                CouleurFOND = "255,255,255";
            }
            else
            {
                redB   = CouleurFOND.Substring(0, 3);
                greenB = CouleurFOND.Substring(4, 3);
                blueB  = CouleurFOND.Substring(8, 3);
            }
            //TEXT
            if (CouleurText == null)
            {
                CouleurText = "000,000,000";
            }
            else
            {
                redT   = CouleurText.Substring(0, 3);
                greenT = CouleurText.Substring(4, 3);
                blueT  = CouleurText.Substring(8, 3);
            }

            textBox2.Text       = CouleurText;
            button1.BackColor   = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB));
            monbouton.BackColor = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB));


            button1.ForeColor   = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT));
            monbouton.ForeColor = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT));
        }
Ejemplo n.º 5
0
        public UCTextBox(CpcDosCPlusTextBox textBox)
        {
            InitializeComponent();
            objets = new CpcDosCPlusListeObjets("fichier1.cpc");

            //TODO: Gérer proprement le binding bi-directionnel
            TailleX         = int.Parse(textBox.SizeX);
            TailleY         = int.Parse(textBox.SizeY);
            PositionX       = int.Parse(textBox.Px);
            PositionY       = int.Parse(textBox.Py);
            textBox.Text    = textBox.Text;
            textBox3.Width  = TailleX;
            textBox3.Height = TailleY;
            Nom             = textBox.ID;
            Btext           = textBox.Text;
            Bevent          = textBox.Event;
            Bopacite        = textBox.Opacity;
            Bparameters     = textBox.Parameters;


            //on pourra choisir sur quelle forme ajouter en modifiant avec un textbox
            // nbforms["preview"].Controls.Add(monbouton);



            CouleurFOND   = textBox.BackColor;
            CouleurText   = textBox.TextColor;
            textBox1.Text = CouleurFOND;
            // FOND
            if (CouleurFOND == null)
            {
                CouleurFOND = "255,255,255";
            }
            else if (CouleurFOND == "")
            {
                CouleurFOND = "255,255,255";
            }
            else
            {
                redB   = CouleurFOND.Substring(0, 3);
                greenB = CouleurFOND.Substring(4, 3);
                blueB  = CouleurFOND.Substring(8, 3);
            }
            //TEXT
            if (CouleurText == null)
            {
                CouleurText = "000,000,000";
            }
            else if (CouleurText == "")
            {
                CouleurText = "000,000,000";
            }
            else
            {
                redT   = CouleurText.Substring(0, 3);
                greenT = CouleurText.Substring(4, 3);
                blueT  = CouleurText.Substring(8, 3);
            }

            textBox2.Text      = CouleurText;
            textBox3.BackColor = Color.FromArgb(int.Parse(redB), int.Parse(greenB), int.Parse(blueB));



            textBox3.ForeColor = Color.FromArgb(int.Parse(redT), int.Parse(greenT), int.Parse(blueT));
        }