Beispiel #1
0
        protected override AppearanceClass UpdateAppearance()
        {
            AppearanceClass app = base.UpdateAppearance();

            if (null != app)
            {
                ParentNotePanel.BackColor = app.captionBackground;
                panelLayout.ColorToolBars(app);
            }
            return(app);
        }
Beispiel #2
0
        protected override AppearanceClass UpdateAppearance()
        {
            AppearanceClass app = base.UpdateAppearance();

            if (BottomInfo != null)
            {
                BottomInfo.BackColor = app.mainBackground;
                BottomInfo.ForeColor = app.secondaryForeground;
            }

            return(app);
        }
        public AppearancePanelForm(AppearanceClass app)
        {
            this.Icon = LayoutDetails.Instance.MainFormIcon;
            FormUtils.SizeFormsForAccessibility(this, LayoutDetails.Instance.MainFormFontSize);

            Panel bottom = new Panel();
            bottom.Dock = DockStyle.Bottom;
            bottom.Height = LayoutDetails.ButtonHeight;
             ok = new Button();

            ok.Text = Loc.Instance.GetString ("OK");
            ok.DialogResult = DialogResult.OK;
            ok.Dock = DockStyle.Left;

            Button Cancel = new Button();
            Cancel.Text = Loc.Instance.GetString ("Cancel");
            Cancel.Dock = DockStyle.Right;
            Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;

            bottom.Controls.Add (ok);
            bottom.Controls.Add(Cancel);

            if (app == null) {
                // we are in build mode. So we create a classic note
                app = AppearanceClass.SetAsClassic();

                app.Name = "Choose A Unique Name For Your New Appearance";
                ok.Enabled = false;

            }

            appearancePanel = new AppearancePanel(false, app, null, ValidData, true);

            appearancePanel.Dock = DockStyle.Fill		;
                this.Controls.Add(bottom);
            this.Controls.Add (appearancePanel);
            appearancePanel.BringToFront();
        }
        protected override void DoChildAppearance(AppearanceClass app)
        {
            base.DoChildAppearance (app);

            TablePanel.BackColor = app.mainBackground;
        }
 public Layout.AppearanceClass GetAppearanceFromStorage(string Key)
 {
     Layout.AppearanceClass fake = AppearanceClass.SetAsClassic();
     //fake.SetAsClassic();
     return(fake);
 }
        public void UpdateAppearance(AppearanceClass app)
        {
            EventList.BackColor = app.mainBackground;
            EventList.ForeColor =app.secondaryForeground;
            EventList.Font = app.captionFont;

            Add.BackColor = app.mainBackground;
            Add.ForeColor = app.secondaryForeground;
            Add.Font = app.captionFont;

            Summary.Font = app.captionFont;
            Summary.BackColor = app.mainBackground;
            Summary.ForeColor = app.secondaryForeground;
        }
        protected override void DoChildAppearance(AppearanceClass app)
        {
            base.DoChildAppearance(app);

            richBox.BackColor = app.mainBackground;
            richBox.ForeColor = app.secondaryForeground;
        }
Beispiel #8
0
 protected override void DoChildAppearance(AppearanceClass app)
 {
     base.DoChildAppearance(app);
 }
        protected override void DoChildAppearance(AppearanceClass app)
        {
            base.DoChildAppearance (app);

            checkers.BackColor = app.mainBackground;
            checkers.ForeColor = app.secondaryForeground;

            preview.BackColor = app.mainBackground;
            preview.ForeColor = app.secondaryForeground;
        }
 protected override void DoChildAppearance(AppearanceClass app)
 {
     base.DoChildAppearance (app);
 }
        /// <summary>
        /// Updates the appearance, using the AppearanceClass object
        /// </summary>
        /// <param name='app'>
        /// App.
        /// </param>
        public void UpdateAppearance(AppearanceClass app)
        {
            YearsReport.BackColor = app.captionBackground;
            YearsReport.ForeColor = app.captionForeground;

            TransactionsPanel.UpdateAppearance(app);
            dayTime.UpdateAppearance(app);
            ProgressPanel.UpdateAppearance(app);
        }
        // This panel is used in read-only mode to show what a particular appearance looks like
        // It can also be used in edit mode
        public AppearancePanel(bool ShowEditButton, AppearanceClass app, Action<AppearanceClass> _SaveAppearance, Action<bool>validDataToSave, bool AllowNameEdit)
        {
            if (app == null)
                throw new Exception ("An invalid appearance was passed into AppearancePanel");
            ValidDataToSave = validDataToSave;

            App = app;
            SaveAppearance = _SaveAppearance;

            CaptionBar = new ToolStrip ();
            CaptionBar.AutoSize = false;
            ToolStripLabel CaptionLabel = new ToolStripLabel ();
            CaptionLabel.Text = Loc.Instance.GetString ("EXAMPLE");
            CaptionBar.GripStyle = ToolStripGripStyle.Hidden;

            //(readonlyunlessvalidtext
            NameField = new TextBox ();

            NameField.Text = app.Name;
            NameField.TextChanged += HandleTextChanged;
            NameField.Dock = DockStyle.Top;
            NameField.ReadOnly = !AllowNameEdit;

            this.Controls.Add (NameField);
            this.Controls.Add (CaptionBar);

            CaptionBar.Items.Add (CaptionLabel);

            //
            // THE SETTINGS
            //

            CaptionBar.Font = app.captionFont; //[x]
            CaptionBar.Height = app.nHeaderHeight; //[x]
            //this.CaptionLabel.Bord = app.HeaderBorderStyle;
            this.BorderStyle = app.mainPanelBorderStyle; //[x]

            CaptionBar.BackColor = app.captionBackground; //[x]
            CaptionBar.ForeColor = app.captionForeground; //[x]

            NameField.ForeColor = app.secondaryForeground;
            try {
                NameField.BackColor = app.mainBackground; //[x]

            } catch (Exception) {

                NewMessage.Show ("The Main Background color is invalid. Try choosing another.");
                NameField.BackColor = this.BackColor; //[x]
            }

            if (true == ShowEditButton) {
                Button EditBut = new Button ();
                EditBut.Text = Loc.Instance.GetString ("Edit");
                EditBut.Click += HandleClick;
                this.Controls.Add (EditBut);
                EditBut.Dock = DockStyle.Bottom;

                Button AddBut = new Button();
                AddBut.Text= Loc.Instance.GetString ("New");
                AddBut.Click += HandleAddAppearanceClick1;
                AddBut.Dock = DockStyle.Bottom;
                this.Controls.Add (AddBut);

            } else {

                // when we show the EditButton that means we are in READ ONLY MODE
                // when do do not show the EditButton that means we are in Edit Mode

                // setup the clicks
                ToolStripButton CaptionForeColor = new ToolStripButton();
                CaptionForeColor.Text = Loc.Instance.GetString ("Forecolor");
                CaptionForeColor.Click+= HandleForeColorClick;

                ToolStripButton CaptionBackColor = new ToolStripButton();
                CaptionBackColor.Text = Loc.Instance.GetString ("Backcolor");
                CaptionBackColor.Click+= HandleBackColorClick1;

                ToolStripButton CaptionFont = new ToolStripButton();
                CaptionFont.Text= Loc.Instance.GetString ("Font");
                CaptionFont.Click+= HandleFontClick1;

                ToolStripButton OtherBackColor = new ToolStripButton();
                OtherBackColor.Text= Loc.Instance.GetString ("Secondary Back Color");
                OtherBackColor.Click+= HandleSecondaryBackColorClick1;

                ToolStripButton OtherForeColor = new ToolStripButton();
                OtherForeColor.Text= Loc.Instance.GetString ("Secondary Fore Color");
                OtherForeColor.Click+= HandleSecondaryForeColorClick;;

                ToolStripComboBox BorderStyleSet = new ToolStripComboBox();
                BorderStyleSet.DropDownStyle = ComboBoxStyle.DropDownList;
                int count = 0;
                int match = 0;
                foreach (string s in Enum.GetNames (typeof(BorderStyle)))
                {
                    BorderStyleSet.Items.Add (s);
                    string name = Enum.GetName (typeof(BorderStyle),app.mainPanelBorderStyle);
                    if (s == name)
                    {
                        match = count;
                    }
                    count++;
                }
                BorderStyleSet.SelectedIndex = match;
                BorderStyleSet.SelectedIndexChanged+= HandleMainBorderSelectedIndexChanged;

                NumericUpDown numbers = new NumericUpDown ();

                numbers.Value = app.nHeaderHeight;
                numbers.ValueChanged += HandleIconsPerColumnValueChanged;
                numbers.Minimum = 1;
                numbers.Maximum = 50;
                ToolStripControlHost numbersHost = new ToolStripControlHost (numbers);
                numbersHost.ToolTipText = Loc.Instance.GetString ("Adjust this number to change caption height");

                CaptionBar.Items.Add (CaptionForeColor);
                CaptionBar.Items.Add (CaptionBackColor);
                CaptionBar.Items.Add (CaptionFont);
                CaptionBar.Items.Add (OtherBackColor);
                CaptionBar.Items.Add (OtherForeColor);
                CaptionBar.Items.Add (BorderStyleSet);
                CaptionBar.Items.Add (numbersHost);

            }
        }
        public AppearanceClass GetAppearanceSelected()
        {
            // This is caused only from the FORM version of this control, see below, the HandleClick routine
            AppearanceClass ThisAppearance = new  AppearanceClass();

            // grab name from TextField (which will remain in readonly mode WHEN editing existing but is rightable
            ThisAppearance.Name = NameField.Text;

            ThisAppearance.captionFont=CaptionBar.Font;
            ThisAppearance.nHeaderHeight=CaptionBar.Height;
            ThisAppearance.mainPanelBorderStyle=this.BorderStyle;
            ThisAppearance.captionBackground=CaptionBar.BackColor ;
            ThisAppearance.captionForeground=CaptionBar.ForeColor;

            ThisAppearance.mainBackground = NameField.BackColor;
            ThisAppearance.secondaryForeground = NameField.ForeColor;
                //this.CaptionLabel.Bord = app.HeaderBorderStyle;  //6

            return ThisAppearance;
        }