Exemple #1
0
        public setupForm(string profilname)
        {
            InitializeComponent();
            this.profilName = profilname;
            label1.Text     = Projector.Properties.Resources.mysqlUserName;
            label2.Text     = Projector.Properties.Resources.mysqlPassword;
            label3.Text     = Projector.Properties.Resources.mysqlHost;
            label4.Text     = Projector.Properties.Resources.mysqlSchema;

            okbtn.Text     = Projector.Properties.Resources.btnOk;
            cancelbtn.Text = Projector.Properties.Resources.btnCancel;
            groupBox1.Text = Projector.Properties.Resources.mysqlSettings;
            tabPage1.Text  = Projector.Properties.Resources.mysqlSettings;
            btnChk.Text    = Projector.Properties.Resources.MysqlCheckConnetion;
            checkInput();
            tableListBox.Visible = false;

            List <string> styles = StyleFormProps.getAllStyles();

            foreach (string style in styles)
            {
                styleComboBox.Items.Add(style);
                mdiStyleComboBox.Items.Add(style);
            }
        }
Exemple #2
0
        public void addQueryWindow(queryBrowser qb)
        {
            windowID++;
            qb.Name = "QueryBrowser " + windowID;
            if (currentProfil.getProperty(ProfilProps.STYLE_COLOR) != null && currentProfil.getProperty(ProfilProps.STYLE_COLOR).Length > 2)
            {
                StyleFormProps profilStyle = new StyleFormProps();
                profilStyle.MainColor = Color.FromArgb(int.Parse(currentProfil.getProperty(ProfilProps.STYLE_COLOR)));

                string styleName = currentProfil.getProperty(ProfilProps.WINDOW_STYLE);
                if (styleName == null)
                {
                    styleName = ProjectorForm.getMainFormStyle();
                }

                profilStyle.composeStyle(styleName);
                qb.setStyle(profilStyle);
            }
            qb.sensorProfil = currentProfil;
            qb.loadPlaceHolder();
            qb.MdiParent = this;

            qb.Show();
            qb.listTables();
            listWindows();
        }
Exemple #3
0
 public void setStyle(StyleFormProps Style)
 {
     if (Style.containsChanges())
     {
         this.BackColor    = Style.BackgroundControlColor;
         this.ForeColor    = Style.ForeGroundContentColor;
         this.currentStyle = Style;
         this.FlatMode     = (this.currentStyle.ButtonStyle == FlatStyle.Flat);
         this.updateContent(Style);
     }
 }
Exemple #4
0
        public void composeStyle(string name)
        {
            List <string> possibles = StyleFormProps.getAllStyles();

            this.changeStyle = false;
            if (possibles.Contains(name))
            {
                this.currentStyle = name;
                this.changeStyle  = true;
                switch (name)
                {
                case StyleFormProps.STYLE_DEFAULT:
                    this.changeStyle = false;
                    break;

                case StyleFormProps.STYLE_LIGHT_COLOR:
                    this.composeFlatLight();
                    break;

                case StyleFormProps.STYLE_NIGHT:
                    this.composeNight();
                    break;

                case StyleFormProps.STYLE_DARK_COLOR:
                    this.composeFlatDark();
                    break;

                case StyleFormProps.STYLE_PAPER:
                    this.composePaper();
                    break;

                case StyleFormProps.STYLE_PAPER_BLUE:
                    this.composePaperWhite();
                    break;
                }
            }
        }
Exemple #5
0
        private void updateContent(StyleFormProps Style, Control.ControlCollection controlCollection)
        {
            for (int i = 0; i < controlCollection.Count; i++)
            {
                Boolean foreColChangeable = !this.notTouchableForeColor.ContainsKey(getColorString(controlCollection[i].ForeColor));
                Boolean backColChangeable = !this.notTouchableBackColor.ContainsKey(getColorString(controlCollection[i].BackColor));

                if (backColChangeable)
                {
                    controlCollection[i].BackColor = Style.BackgroundControlColor;
                }
                if (foreColChangeable)
                {
                    controlCollection[i].ForeColor = Style.ForeGroundContentColor;
                }



                if (controlCollection[i] is Button)
                {
                    Button tmpBtn = (Button)controlCollection[i];
                    tmpBtn.FlatStyle = Style.ButtonStyle;
                    if (backColChangeable)
                    {
                        tmpBtn.BackColor = Style.ButtonBackColor;
                    }
                    if (backColChangeable)
                    {
                        tmpBtn.ForeColor = Style.ButtonForeColor;
                    }
                    if (tmpBtn.FlatStyle == FlatStyle.Flat)
                    {
                        tmpBtn.FlatAppearance.BorderColor = Style.ButtonForeColor;
                    }
                }

                if (controlCollection[i] is TextBoxBase)
                {
                    TextBoxBase tmpEl = (TextBoxBase)controlCollection[i];
                    tmpEl.BorderStyle = Style.ElBorderStyle;
                    if (backColChangeable)
                    {
                        tmpEl.BackColor = Style.ElBackColor;
                    }
                    if (foreColChangeable)
                    {
                        tmpEl.ForeColor = Style.ELForeColor;
                    }
                }

                if (controlCollection[i] is ComboBox)
                {
                    ComboBox tmpEl = (ComboBox)controlCollection[i];
                    tmpEl.FlatStyle = Style.ButtonStyle;
                    if (backColChangeable)
                    {
                        tmpEl.BackColor = Style.ElBackColor;
                    }
                    if (foreColChangeable)
                    {
                        tmpEl.ForeColor = Style.ELForeColor;
                    }
                }

                if (controlCollection[i] is GroupBox)
                {
                    GroupBox tmpEl = (GroupBox)controlCollection[i];
                    tmpEl.FlatStyle = Style.ButtonStyle;
                    if (backColChangeable)
                    {
                        tmpEl.BackColor = Style.BackgroundControlColor;
                    }
                    if (foreColChangeable)
                    {
                        tmpEl.ForeColor = Style.ForeGroundContentColor;
                    }
                }

                if (controlCollection[i] is ListView)
                {
                    ListView tmpEl = (ListView)controlCollection[i];
                    tmpEl.BorderStyle = Style.ElBorderStyle;
                    if (backColChangeable)
                    {
                        tmpEl.BackColor = Style.ElBackColor;
                    }
                    if (foreColChangeable)
                    {
                        tmpEl.ForeColor = Style.ELForeColor;
                    }
                }

                if (controlCollection[i].Controls.Count > 0)
                {
                    this.updateContent(Style, controlCollection[i].Controls);
                }
            }
        }
Exemple #6
0
 private void updateContent(StyleFormProps Style)
 {
     this.updateContent(Style, this.Controls);
 }