Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
        public UCFenetre(CpcDosCPlusWindow mafenetre)
        {
            InitializeComponent();
            //TODO: Gérer proprement le binding bi-directionnel
            int TailleX = int.Parse(mafenetre.SizeX);
            int TailleY = int.Parse(mafenetre.SizeY);

            label1.Text   = mafenetre.Title;
            panel4.Width  = TailleX;
            panel4.Height = TailleY;
            panel2.Width  = TailleX;
            Preview apercu = new Preview();

            apercu.Show();
            apercu.Width   = TailleX;
            apercu.Height  = TailleY;
            apercu.Text    = mafenetre.Title;
            apercu.TopMost = true;
            propertyGrid1.SelectedObject = mafenetre;

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

            CouleurFOND = mafenetre.BackColor;

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



            panel4.BackColor = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue));
            apercu.BackColor = Color.FromArgb(int.Parse(red), int.Parse(green), int.Parse(blue));
        }