Exemplo n.º 1
0
        private void Remove(object o, EventArgs e)
        {
            IconPictureBox ib = (IconPictureBox)o;

            if (ib.Name.StartsWith("heart_"))
            {
                int index = int.Parse(ib.Name.Split(new char[] { '_' })[1]) - 1;
                MusicFound.Rows[index].Selected = true;
                foreach (Music music in Music.musicsList)
                {
                    string name = MusicFound.Rows[index].Cells[1].Value.ToString();
                    if (music.Name.Equals(name))
                    {
                        if (ib.ForeColor == Color.Silver)
                        {
                            app.User.Favorite.Musics.Add(music);
                            ib.ForeColor = Color.Red;
                            MessageBox.Show("Music added!");
                        }
                        else
                        {
                            app.User.Favorite.Musics.Remove(music);
                            ib.ForeColor = Color.Silver;
                            MessageBox.Show("Music removed from Favorite!");
                        }
                        break;
                    }
                }
            }
        }
        public void Be_Creatable(IconChar icon)
        {
            var pictureBox = new IconPictureBox {
                IconChar = icon
            };

            pictureBox.Should().NotBeNull();
        }
Exemplo n.º 3
0
        public void Display_Icons(IconChar icon)
        {
            var pictureBox = new IconPictureBox {
                IconChar = icon
            };

            pictureBox.Image.Should().NotBeNull();
        }
Exemplo n.º 4
0
        private void PaintTicketAlertPanelElements(int marginTop, int marginLeft, Panel pnl, string userId, string ticketId, string ticketStatus, string ticketDesc, Color urgency)
        {
            Font font = new Font("Calibri", 10);

            //ticketAlarmPanel.Size;
            //create the warning sign
            IconPictureBox iconBox = new IconPictureBox();

            iconBox.IconChar  = IconChar.Clock;
            iconBox.IconSize  = 32;
            iconBox.Location  = new Point(marginLeft, marginTop);
            iconBox.IconColor = urgency;
            pnl.Controls.Add(iconBox);
            //create the UserID label
            Point lblUidLocation   = new Point(marginLeft + 40, marginTop + 5);
            Label lblUserIDWarning = new Label();

            lblUserIDWarning.Text      = "User ID: " + userId;
            lblUserIDWarning.Font      = font;
            lblUserIDWarning.AutoSize  = true;
            lblUserIDWarning.BackColor = Color.Transparent;
            lblUserIDWarning.Location  = lblUidLocation;
            pnl.Controls.Add(lblUserIDWarning);
            //ticket Id
            Point lblTidLocation     = new Point(marginLeft + 40, marginTop + 20);
            Label lblTicketIDWarning = new Label();

            lblTicketIDWarning.Text      = "Ticket Number: " + ticketId;
            lblTicketIDWarning.Font      = font;
            lblTicketIDWarning.ForeColor = Color.Black;
            lblTicketIDWarning.AutoSize  = true;
            lblTicketIDWarning.Location  = lblTidLocation;
            pnl.Controls.Add(lblTicketIDWarning);
            //Create status
            Point lblStatusLocation = new Point(marginLeft + 40, marginTop + 40);
            Label lblTicketStatus   = new Label();

            lblTicketStatus.Text      = "Ticket status: " + ticketStatus;
            lblTicketStatus.Font      = font;
            lblTicketStatus.ForeColor = Color.Black;
            lblTicketStatus.AutoSize  = true;
            lblTicketStatus.Location  = lblStatusLocation;
            pnl.Controls.Add(lblTicketStatus);
            //Create description
            Point descLocation  = new Point(marginLeft + 40, marginTop + 60);
            Label lblTicketDesc = new Label();

            lblTicketDesc.Text      = "Ticket description: " + ticketDesc;
            lblTicketDesc.Font      = font;
            lblTicketDesc.ForeColor = Color.Black;
            lblTicketDesc.AutoSize  = true;
            lblTicketDesc.Location  = descLocation;
            pnl.Controls.Add(lblTicketDesc);
        }
Exemplo n.º 5
0
 private void InitLikeIcon(IconPictureBox iconPicture)
 {
     iconPicture.Cursor    = Cursors.Hand;
     iconPicture.ForeColor = SystemColors.ControlText;
     iconPicture.IconChar  = IconChar.ThumbsUp;
     iconPicture.IconColor = SystemColors.ControlText;
     iconPicture.IconSize  = 30;
     iconPicture.Location  = LikeIcon.Location;
     iconPicture.Name      = "icon" + count;
     iconPicture.Size      = LikeIcon.Size;
     iconPicture.SizeMode  = PictureBoxSizeMode.CenterImage;
     iconPicture.TabIndex  = 48;
     iconPicture.TabStop   = false;
 }
Exemplo n.º 6
0
 private void InitRedirectIcon(IconPictureBox iconPicture)
 {
     iconPicture.BackColor = Color.Transparent;
     iconPicture.Cursor    = Cursors.Hand;
     iconPicture.ForeColor = SystemColors.ControlText;
     iconPicture.IconChar  = IconChar.Reply;
     iconPicture.IconColor = SystemColors.ControlText;
     iconPicture.IconSize  = 30;
     iconPicture.Location  = RedirectIcon.Location;
     iconPicture.Name      = "icon" + count;
     iconPicture.Size      = RedirectIcon.Size;
     iconPicture.SizeMode  = PictureBoxSizeMode.CenterImage;
     iconPicture.TabIndex  = 48;
     iconPicture.TabStop   = false;
 }
 public void UpdateWeatherInfoView()
 {
     if (previousSelectedCity != mainInfoPresenter.SelectedCity || LastUpdateTimeLabel.Text != mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].LastUpdateTime.ToShortTimeString())
     {
         CityNameLabel.Text = mainInfoPresenter.SelectedCity;
         DegreeLabel.Text   = mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.Temperature.ToString() + "°C";
         IconPictureBox.Load(mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.IconPath);
         DescriptionLabel.Text    = mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.Description;
         LastUpdateTimeLabel.Text = $"Last update time {mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].LastUpdateTime.ToShortTimeString()}";
         PressureLabel.Text       = $"Pressure {mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.Pressure} hPa";
         HumidityLabel.Text       = $"Humidity {mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.Humidity} %";
         WindLabel.Text           = $"Wind {mainInfoPresenter.CityWeathers[mainInfoPresenter.SelectedCity].CurrentWeather.WindSpeed} m/s";
         UpdateDailyWeatherColumn();
         (DailyWeatherInfoTableLayoutPanel.Controls[0] as DailyItemUserControl)?.ItemClick(null, null);
         previousSelectedCity = mainInfoPresenter.SelectedCity;
     }
 }
Exemplo n.º 8
0
        private IconPictureBox CheckIcon; //Gets or sets checkbox icon checked

        ///<Note>:ICON PICTURE BOX is provided by <see cref="FontAwesome.Sharp"/> library
        ///      Autor: mkoertgen
        ///      GitHub: https://github.com/awesome-inc/FontAwesome.Sharp
        ///      Nuget Package: https://www.nuget.org/packages/FontAwesome.Sharp </Note>
        #endregion

        #region -> Constructor

        public CTCheckBox()
        {
            CheckIcon           = new IconPictureBox(); //Initialize check icon
            CheckIcon.IconChar  = IconChar.Check;       //Set icon
            CheckIcon.IconSize  = 19;
            CheckIcon.IconColor = Color.White;

            this.Appearance                = Appearance.Button;//Set button appearance
            this.BackgroundImageLayout     = ImageLayout.None;
            this.FlatStyle                 = FlatStyle.Flat;
            this.FlatAppearance.BorderSize = 1;
            this.UseVisualStyleBackColor   = false;
            this.Size    = new Size(19, 19);
            this.Cursor  = Cursors.Hand;
            this.Checked = true;                                            //Set default checked
            this.Image   = CheckIcon.Image;                                 //Set check icon as image
            Style        = ControlStyle.Solid;                              //Set Solid Style (Apply UI Appearance Settings )

            this.CheckedChanged += new EventHandler(CheckBox_CheckChanged); //Subscribe CheckedChanged Event
            this.Resize         += new EventHandler(CheckBox_Resized);      //Subscribe Resize Event
        }
Exemplo n.º 9
0
        private void AddTo(object o, EventArgs e)
        {
            IconPictureBox ib = (IconPictureBox)o;

            if (ib.Name.StartsWith("add_"))
            {
                int index = int.Parse(ib.Name.Split(new char[] { '_' })[1]) - 1;
                MusicFound.Rows[index].Selected = true;
                foreach (Music music in app.User.Favorite.Musics)
                {
                    string name = MusicFound.Rows[index].Cells[1].Value.ToString();
                    if (music.Name.Equals(name))
                    {
                        currentMusic = music;
                        break;
                    }
                }
                AddPanel.Visible = true;
                ChangePanelColor(index);
            }
        }
Exemplo n.º 10
0
        public firstForm()
        {
            InitializeComponent();
            panelDesktop.Hide();
            Rectangle rec;

            rec   = Screen.GetWorkingArea(this);
            rec.X = this.MaximizedBounds.X;
            rec.Y = this.MaximizedBounds.Y;
            this.MaximizedBounds = rec;
            this.FormBorderStyle = FormBorderStyle.None;

            //Remove form title bar
            this.Text       = string.Empty;
            this.ControlBox = false;

            firstPanel = this.panelDesktop2;
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.HorizontalScroll.Enabled = false;

            //New form
            leftBorderBtn      = new Panel();
            leftBorderBtn.Size = new System.Drawing.Size(7, 60);
            panelMenu.Controls.Add(leftBorderBtn);
            projectSubMenu.Visible = false;
            restoreButton.Visible  = false;
            iconButton5.Visible    = true;

            panelDesktop2.Location = new System.Drawing.Point(0, 0);
            panelMenu.Location     = new System.Drawing.Point(0, 0);

            typeof(Panel).InvokeMember("DoubleBuffered",
                                       BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
                                       null, panelDesktop2, new object[] { true });
            currentChildForm = null;
            userControl      = null;
            iconBtn          = iconCurrentChildForm;
            title            = lblTitleChildForm;
            elementHost1.Hide();
        }
Exemplo n.º 11
0
        private static readonly Color activateBackColor    = Color.FromArgb(58, 50, 97);    //Sets or gets back Color when menu button is activated and dropdown menu is displayed

        #endregion

        #region -> Constructor
        public CTMenuButton()
        {
            pbDropdownArrowIcon = new IconPictureBox();
            //initialize properties and events
            this.Dock      = DockStyle.Top;
            this.BackColor = Colors.SideMenuColor;
            this.FlatAppearance.BorderSize         = 0;
            this.FlatAppearance.MouseDownBackColor = Colors.DarkItemBackground;
            this.FlatStyle         = FlatStyle.Flat;
            this.Flip              = FlipOrientation.Normal;
            this.Font              = new Font("Verdana", 10F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.ForeColor         = deactivateItemsColor;
            this.IconChar          = FontAwesome.Sharp.IconChar.DiceD6;
            this.IconColor         = deactivateItemsColor;
            this.IconSize          = 28;
            this.Rotation          = 0D;
            this.Size              = new Size(220, 55);
            this.TextAlign         = ContentAlignment.MiddleLeft;
            this.ImageAlign        = ContentAlignment.MiddleLeft;
            this.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.Padding           = new Padding(12, 0, 0, 0);
            this.SizeChanged      += new EventHandler(WidthChanged);
            this.HandleCreated    += new EventHandler(MB_HandleCreated);
        }
Exemplo n.º 12
0
        private void HoverColor(object sender, EventArgs e)
        {
            IconPictureBox one = (IconPictureBox)sender;

            one.IconColor = Color.LavenderBlush;
        }
Exemplo n.º 13
0
        private void InitComments()
        {
            foreach (Panel innerPanel in comments)
            {
                innerPanel.Dispose();
                lastComment = null;
            }
            foreach (Comment comment in playList.Comments)
            {
                if (lastComment == null)
                {
                    lastComment           = ControlExtensions.Clone(CommentExemple);
                    lastComment.Visible   = true;
                    lastComment.Name      = "CommentPanel" + count;
                    lastComment.BackColor = Color.FromArgb(89, 147, 180);
                    PictureBox pb = new PictureBox();
                    InitUserPictureBox(pb, comment.Author);
                    IconPictureBox icon2 = new IconPictureBox();
                    InitLikeIcon(icon2);
                    IconPictureBox icon3 = new IconPictureBox();
                    InitReplyIcon(icon3);
                    Label commentername = ControlExtensions.Clone(CommenterName);
                    commentername.Text    = comment.Author.Username + ":";
                    commentername.Visible = true;

                    Label content = ControlExtensions.Clone(CommentContent);
                    content.Text    = comment.Content;
                    content.Visible = true;

                    Label date = ControlExtensions.Clone(CommentDate);
                    date.Text    = comment.Date;
                    date.Visible = true;

                    Label likes = ControlExtensions.Clone(CommentLikes);
                    likes.Text    = comment.Likes + "";
                    likes.Visible = true;

                    lastComment.Controls.Add(pb);
                    lastComment.Controls.Add(icon2);
                    lastComment.Controls.Add(icon3);
                    lastComment.Controls.Add(date);
                    lastComment.Controls.Add(likes);
                    lastComment.Controls.Add(content);
                    lastComment.Controls.Add(commentername);
                    CommentsPanel.Controls.Add(lastComment);
                    comments.Add(lastComment);
                    lastComment.Show();
                    CommentsPanel.Refresh();
                }
                else
                {
                    Panel panel = ControlExtensions.Clone(lastComment);
                    panel.Name      = "CommentPanel" + count;
                    panel.Visible   = true;
                    panel.Location  = new Point(panel.Location.X, panel.Location.Y + 70);
                    panel.BackColor = Color.FromArgb(89, 147, 180);
                    PictureBox pb = new PictureBox();
                    InitUserPictureBox(pb, comment.Author);
                    IconPictureBox icon2 = new IconPictureBox();
                    InitLikeIcon(icon2);
                    IconPictureBox icon3 = new IconPictureBox();
                    InitReplyIcon(icon3);

                    Label commentername = ControlExtensions.Clone(CommenterName);
                    commentername.Text    = comment.Author.Name + ":";
                    commentername.Visible = true;

                    Label content = ControlExtensions.Clone(CommentContent);
                    content.Text    = comment.Content;
                    content.Visible = true;

                    Label date = ControlExtensions.Clone(CommentDate);
                    date.Text    = comment.Date;
                    date.Visible = true;

                    Label likes = ControlExtensions.Clone(CommentLikes);
                    likes.Text    = comment.Likes + "";
                    likes.Visible = true;

                    panel.Controls.Add(pb);
                    panel.Controls.Add(icon2);
                    panel.Controls.Add(icon3);
                    panel.Controls.Add(date);
                    panel.Controls.Add(likes);
                    panel.Controls.Add(content);
                    panel.Controls.Add(commentername);
                    CommentsPanel.Controls.Add(lastComment);
                    panel.Show();
                    CommentsPanel.Refresh();
                    comments.Add(lastComment);
                    lastComment = panel;
                }
                count++;
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(JakklConfig));
     this.contextMenu        = new System.Windows.Forms.ContextMenu();
     this.menuItemConfigure  = new System.Windows.Forms.MenuItem();
     this.menuItemVwr        = new System.Windows.Forms.MenuItem();
     this.menuItem2          = new System.Windows.Forms.MenuItem();
     this.menuItemExit       = new System.Windows.Forms.MenuItem();
     this.SaveButton         = new MetroFramework.Controls.MetroButton();
     this.cancelButton       = new MetroFramework.Controls.MetroButton();
     this.metroLabel1        = new MetroFramework.Controls.MetroLabel();
     this.metroLabel2        = new MetroFramework.Controls.MetroLabel();
     this.runOnStartup       = new MetroFramework.Controls.MetroToggle();
     this.metroLabel3        = new MetroFramework.Controls.MetroLabel();
     this._saveSettings      = new MetroFramework.Controls.MetroRadioButton();
     this.cbFilter           = new System.Windows.Forms.ComboBox();
     this.cbLogs             = new System.Windows.Forms.ComboBox();
     this.checkBoxROS        = new System.Windows.Forms.CheckBox();
     this._saveSettingsLabel = new MetroFramework.Controls.MetroLabel();
     this._saveSettings1     = new MetroFramework.Controls.MetroToggle();
     this.metroLabel4        = new MetroFramework.Controls.MetroLabel();
     this.syslogServer       = new MetroFramework.Controls.MetroTextBox();
     this.syslogPortLabel    = new MetroFramework.Controls.MetroLabel();
     this._syslogPort        = new MetroFramework.Controls.MetroTextBox();
     this.pictureBox1        = new System.Windows.Forms.PictureBox();
     this.testConnButton     = new MetroFramework.Controls.MetroButton();
     this.logsSelectedBox    = new MetroFramework.Controls.MetroTextBox();
     this.logsCheckBox       = new System.Windows.Forms.ListBox();
     this.metroButton1       = new FontAwesome.Sharp.IconPictureBox();
     this.iconPictureBox1    = new FontAwesome.Sharp.IconPictureBox();
     this.filterTextBox      = new MetroFramework.Controls.MetroTextBox();
     this._eventFilter       = new System.Windows.Forms.ListBox();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.metroButton1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox1)).BeginInit();
     this.SuspendLayout();
     //
     // contextMenu
     //
     this.contextMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
         this.menuItemConfigure,
         this.menuItemVwr,
         this.menuItem2,
         this.menuItemExit
     });
     //
     // menuItemConfigure
     //
     this.menuItemConfigure.DefaultItem = true;
     this.menuItemConfigure.Index       = 0;
     this.menuItemConfigure.Text        = "Configure...";
     this.menuItemConfigure.Click      += new System.EventHandler(this.menuItemConfigure_Click);
     //
     // menuItemVwr
     //
     this.menuItemVwr.Index  = 1;
     this.menuItemVwr.Text   = "Event Viewer";
     this.menuItemVwr.Click += new System.EventHandler(this.menuItemVwr_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 2;
     this.menuItem2.Text  = "-";
     //
     // menuItemExit
     //
     this.menuItemExit.Index  = 3;
     this.menuItemExit.Text   = "Exit";
     this.menuItemExit.Click += new System.EventHandler(this.menuItemExit_Click);
     //
     // SaveButton
     //
     this.SaveButton.Location = new System.Drawing.Point(182, 350);
     this.SaveButton.Name     = "SaveButton";
     this.SaveButton.Size     = new System.Drawing.Size(82, 23);
     this.SaveButton.TabIndex = 2;
     this.SaveButton.Text     = "Apply";
     this.SaveButton.Click   += new System.EventHandler(this.SaveButton_Click);
     //
     // cancelButton
     //
     this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.cancelButton.Location     = new System.Drawing.Point(23, 350);
     this.cancelButton.Name         = "cancelButton";
     this.cancelButton.Size         = new System.Drawing.Size(75, 23);
     this.cancelButton.TabIndex     = 3;
     this.cancelButton.Text         = "Cancel";
     this.cancelButton.Click       += new System.EventHandler(this.cancelButton_Click);
     //
     // metroLabel1
     //
     this.metroLabel1.AutoSize = true;
     this.metroLabel1.Location = new System.Drawing.Point(23, 61);
     this.metroLabel1.Name     = "metroLabel1";
     this.metroLabel1.Size     = new System.Drawing.Size(115, 19);
     this.metroLabel1.TabIndex = 7;
     this.metroLabel1.Text     = "Log(s) to monitor:";
     //
     // metroLabel2
     //
     this.metroLabel2.AutoSize = true;
     this.metroLabel2.Location = new System.Drawing.Point(23, 126);
     this.metroLabel2.Name     = "metroLabel2";
     this.metroLabel2.Size     = new System.Drawing.Size(128, 19);
     this.metroLabel2.TabIndex = 8;
     this.metroLabel2.Text     = "Filter by event types:";
     //
     // runOnStartup
     //
     this.runOnStartup.AutoSize   = true;
     this.runOnStartup.Checked    = true;
     this.runOnStartup.CheckState = System.Windows.Forms.CheckState.Checked;
     this.runOnStartup.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.runOnStartup.Location   = new System.Drawing.Point(183, 273);
     this.runOnStartup.Name       = "runOnStartup";
     this.runOnStartup.Size       = new System.Drawing.Size(80, 17);
     this.runOnStartup.TabIndex   = 8;
     this.runOnStartup.Text       = "On";
     this.runOnStartup.UseVisualStyleBackColor = true;
     this.runOnStartup.CheckedChanged         += new System.EventHandler(this.MetroToggle1_CheckedChanged);
     //
     // metroLabel3
     //
     this.metroLabel3.AutoSize = true;
     this.metroLabel3.Location = new System.Drawing.Point(23, 273);
     this.metroLabel3.Name     = "metroLabel3";
     this.metroLabel3.Size     = new System.Drawing.Size(103, 19);
     this.metroLabel3.TabIndex = 11;
     this.metroLabel3.Text     = "Run On Startup:";
     //
     // _saveSettings
     //
     this._saveSettings.Location = new System.Drawing.Point(0, 0);
     this._saveSettings.Name     = "_saveSettings";
     this._saveSettings.Size     = new System.Drawing.Size(104, 24);
     this._saveSettings.TabIndex = 0;
     //
     // cbFilter
     //
     this.cbFilter.Location = new System.Drawing.Point(0, 0);
     this.cbFilter.Name     = "cbFilter";
     this.cbFilter.Size     = new System.Drawing.Size(121, 21);
     this.cbFilter.TabIndex = 0;
     //
     // cbLogs
     //
     this.cbLogs.Location = new System.Drawing.Point(0, 0);
     this.cbLogs.Name     = "cbLogs";
     this.cbLogs.Size     = new System.Drawing.Size(121, 21);
     this.cbLogs.TabIndex = 0;
     //
     // checkBoxROS
     //
     this.checkBoxROS.Location = new System.Drawing.Point(0, 0);
     this.checkBoxROS.Name     = "checkBoxROS";
     this.checkBoxROS.Size     = new System.Drawing.Size(104, 24);
     this.checkBoxROS.TabIndex = 0;
     //
     // _saveSettingsLabel
     //
     this._saveSettingsLabel.AutoSize = true;
     this._saveSettingsLabel.Location = new System.Drawing.Point(23, 305);
     this._saveSettingsLabel.Name     = "_saveSettingsLabel";
     this._saveSettingsLabel.Size     = new System.Drawing.Size(88, 19);
     this._saveSettingsLabel.TabIndex = 12;
     this._saveSettingsLabel.Text     = "Save Settings:";
     //
     // _saveSettings1
     //
     this._saveSettings1.AutoSize   = true;
     this._saveSettings1.Checked    = true;
     this._saveSettings1.CheckState = System.Windows.Forms.CheckState.Checked;
     this._saveSettings1.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this._saveSettings1.Location   = new System.Drawing.Point(183, 307);
     this._saveSettings1.Name       = "_saveSettings1";
     this._saveSettings1.Size       = new System.Drawing.Size(80, 17);
     this._saveSettings1.TabIndex   = 13;
     this._saveSettings1.Text       = "On";
     this._saveSettings1.UseVisualStyleBackColor = true;
     //
     // metroLabel4
     //
     this.metroLabel4.AutoSize = true;
     this.metroLabel4.Location = new System.Drawing.Point(23, 195);
     this.metroLabel4.Name     = "metroLabel4";
     this.metroLabel4.Size     = new System.Drawing.Size(92, 19);
     this.metroLabel4.TabIndex = 14;
     this.metroLabel4.Text     = "Syslog Server:";
     //
     // syslogServer
     //
     this.syslogServer.CustomBackground = true;
     this.syslogServer.Location         = new System.Drawing.Point(26, 217);
     this.syslogServer.Name             = "syslogServer";
     this.syslogServer.Size             = new System.Drawing.Size(125, 23);
     this.syslogServer.TabIndex         = 15;
     this.syslogServer.Text             = "0.0.0.0";
     this.syslogServer.Click           += new System.EventHandler(this.MetroTextBox1_Click);
     //
     // syslogPortLabel
     //
     this.syslogPortLabel.AutoSize = true;
     this.syslogPortLabel.Location = new System.Drawing.Point(161, 195);
     this.syslogPortLabel.Name     = "syslogPortLabel";
     this.syslogPortLabel.Size     = new System.Drawing.Size(37, 19);
     this.syslogPortLabel.TabIndex = 16;
     this.syslogPortLabel.Text     = "Port:";
     this.syslogPortLabel.Click   += new System.EventHandler(this.SyslogPort_Click);
     //
     // _syslogPort
     //
     this._syslogPort.BackColor        = System.Drawing.SystemColors.Window;
     this._syslogPort.CustomBackground = true;
     this._syslogPort.Location         = new System.Drawing.Point(161, 217);
     this._syslogPort.Name             = "_syslogPort";
     this._syslogPort.Size             = new System.Drawing.Size(43, 23);
     this._syslogPort.TabIndex         = 17;
     this._syslogPort.Text             = "514";
     //
     // pictureBox1
     //
     this.pictureBox1.Image        = global::Jakkl.Properties.Resources.Jakkl_sm;
     this.pictureBox1.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.InitialImage")));
     this.pictureBox1.Location     = new System.Drawing.Point(202, 7);
     this.pictureBox1.Name         = "pictureBox1";
     this.pictureBox1.Size         = new System.Drawing.Size(74, 76);
     this.pictureBox1.SizeMode     = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
     this.pictureBox1.TabIndex     = 18;
     this.pictureBox1.TabStop      = false;
     //
     // testConnButton
     //
     this.testConnButton.Location = new System.Drawing.Point(210, 217);
     this.testConnButton.Name     = "testConnButton";
     this.testConnButton.Size     = new System.Drawing.Size(54, 23);
     this.testConnButton.TabIndex = 20;
     this.testConnButton.Text     = "Test";
     this.testConnButton.Click   += new System.EventHandler(this.testConnButton_Click);
     //
     // logsSelectedBox
     //
     this.logsSelectedBox.FontWeight = MetroFramework.MetroTextBoxWeight.Light;
     this.logsSelectedBox.Location   = new System.Drawing.Point(26, 85);
     this.logsSelectedBox.Name       = "logsSelectedBox";
     this.logsSelectedBox.Size       = new System.Drawing.Size(209, 23);
     this.logsSelectedBox.TabIndex   = 22;
     this.logsSelectedBox.Click     += new System.EventHandler(this.metroTextBox1_Click_1);
     //
     // logsCheckBox
     //
     this.logsCheckBox.FormattingEnabled = true;
     this.logsCheckBox.Location          = new System.Drawing.Point(26, 114);
     this.logsCheckBox.Name          = "logsCheckBox";
     this.logsCheckBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
     this.logsCheckBox.Size          = new System.Drawing.Size(237, 95);
     this.logsCheckBox.Sorted        = true;
     this.logsCheckBox.TabIndex      = 25;
     this.logsCheckBox.Visible       = false;
     this.logsCheckBox.MouseLeave   += new System.EventHandler(this.Close_ListBox);
     //
     // metroButton1
     //
     this.metroButton1.BackColor             = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.metroButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.metroButton1.ForeColor             = System.Drawing.SystemColors.ControlText;
     this.metroButton1.IconChar    = FontAwesome.Sharp.IconChar.None;
     this.metroButton1.IconColor   = System.Drawing.SystemColors.ControlText;
     this.metroButton1.IconSize    = 23;
     this.metroButton1.Location    = new System.Drawing.Point(241, 85);
     this.metroButton1.Name        = "metroButton1";
     this.metroButton1.Size        = new System.Drawing.Size(23, 23);
     this.metroButton1.TabIndex    = 26;
     this.metroButton1.TabStop     = false;
     this.metroButton1.Click      += new System.EventHandler(this.ShowLogsCheckBox);
     this.metroButton1.MouseHover += new System.EventHandler(this.ShowLogsCheckBox);
     //
     // iconPictureBox1
     //
     this.iconPictureBox1.BackColor             = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.iconPictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.iconPictureBox1.ForeColor             = System.Drawing.SystemColors.ControlText;
     this.iconPictureBox1.IconChar    = FontAwesome.Sharp.IconChar.None;
     this.iconPictureBox1.IconColor   = System.Drawing.SystemColors.ControlText;
     this.iconPictureBox1.IconSize    = 23;
     this.iconPictureBox1.Location    = new System.Drawing.Point(241, 148);
     this.iconPictureBox1.Name        = "iconPictureBox1";
     this.iconPictureBox1.Size        = new System.Drawing.Size(23, 23);
     this.iconPictureBox1.TabIndex    = 28;
     this.iconPictureBox1.TabStop     = false;
     this.iconPictureBox1.MouseHover += new System.EventHandler(this.ShoweventFilters);
     //
     // filterTextBox
     //
     this.filterTextBox.FontWeight = MetroFramework.MetroTextBoxWeight.Light;
     this.filterTextBox.Location   = new System.Drawing.Point(28, 148);
     this.filterTextBox.Name       = "filterTextBox";
     this.filterTextBox.Size       = new System.Drawing.Size(207, 23);
     this.filterTextBox.TabIndex   = 27;
     //
     // _eventFilter
     //
     this._eventFilter.FormattingEnabled = true;
     this._eventFilter.Items.AddRange(new object[] {
         "All Event Types",
         "Error",
         "FailureAudit",
         "Information",
         "SuccessAudit",
         "Warning"
     });
     this._eventFilter.Location      = new System.Drawing.Point(28, 177);
     this._eventFilter.Name          = "_eventFilter";
     this._eventFilter.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
     this._eventFilter.Size          = new System.Drawing.Size(235, 69);
     this._eventFilter.Sorted        = true;
     this._eventFilter.TabIndex      = 29;
     this._eventFilter.Visible       = false;
     this._eventFilter.MouseLeave   += new System.EventHandler(this.Close_FiltersListBox);
     //
     // JakklConfig
     //
     this.AcceptButton      = this.SaveButton;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.CancelButton      = this.cancelButton;
     this.ClientSize        = new System.Drawing.Size(293, 388);
     this.ContextMenu       = this.contextMenu;
     this.ControlBox        = false;
     this.Controls.Add(this.logsCheckBox);
     this.Controls.Add(this._eventFilter);
     this.Controls.Add(this.iconPictureBox1);
     this.Controls.Add(this.filterTextBox);
     this.Controls.Add(this.metroButton1);
     this.Controls.Add(this.logsSelectedBox);
     this.Controls.Add(this.testConnButton);
     this.Controls.Add(this.pictureBox1);
     this.Controls.Add(this._syslogPort);
     this.Controls.Add(this.syslogPortLabel);
     this.Controls.Add(this.syslogServer);
     this.Controls.Add(this.metroLabel4);
     this.Controls.Add(this._saveSettings1);
     this.Controls.Add(this._saveSettingsLabel);
     this.Controls.Add(this.metroLabel3);
     this.Controls.Add(this.runOnStartup);
     this.Controls.Add(this.metroLabel2);
     this.Controls.Add(this.metroLabel1);
     this.Controls.Add(this.cancelButton);
     this.Controls.Add(this.SaveButton);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox   = false;
     this.Name          = "JakklConfig";
     this.ShowInTaskbar = false;
     this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
     this.Text          = "Jakkl Config";
     this.Load         += new System.EventHandler(this.Config_Load);
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.metroButton1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.iconPictureBox1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Exemplo n.º 15
0
        public static void AddGoalVisuals(Int32 type, String name, String goal, Int32 locationX, Int32 locationY, Form currentForm, Button btnAddGoal, int measurements)
        {
            int   btnLocationX = btnAddGoal.Location.X;
            Int32 startX       = btnLocationX;
            Int32 startY       = 150;
            int   locX         = startX + locationX;
            int   locY         = startY + locationY;

            //ICON
            IconPictureBox icon = new IconPictureBox
            {
                BackColor = Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(33)))), ((int)(((byte)(74))))),
                ForeColor = Color.Gainsboro,
                IconChar  = FontAwesome.Sharp.IconChar.FolderMinus,
                IconColor = Color.Gainsboro,
                Location  = new Point(locX, locY - 5),
                Margin    = new Padding(3, 2, 3, 2),
                Name      = "iconGoal",
                Size      = new Size(40, 32),
            };

            //GOAL NAME
            Double goalConverted = Convert.ToDouble(goal);
            Label  goalName      = new Label
            {
                Location  = new Point(locX + 50, locY),
                Text      = name,
                AutoSize  = true,
                ForeColor = Color.Gainsboro,
                Font      = new Font("Segoe UI", 10.2F, FontStyle.Bold)
            };

            //SLIDER
            TrackBar trackBarGoal = new TrackBar
            {
                Location  = new Point(locX + 110, locY - 5),
                Margin    = new Padding(3, 2, 3, 2),
                Maximum   = Convert.ToInt32(goalConverted * 1.2),
                Value     = Convert.ToInt32(goalConverted),
                Name      = "trackBarGoal",
                Size      = new Size(155, 55),
                TabIndex  = 2,
                TickStyle = TickStyle.None
            };

            //LABEL PRICE
            Label goalPrice = new Label
            {
                Location  = new Point(locX + 270, locY),
                Text      = (goalConverted).ToString("€#.#"),
                AutoSize  = true,
                Font      = new Font("Segoe UI", 10.2F, FontStyle.Bold),
                ForeColor = Color.Gainsboro
            };

            //LABEL ESTIMATED TIME
            Label estimatedTime = new Label
            {
                Location  = new Point(locX + 340, locY),
                Text      = FinancialGoal.GetEstimatedTime(FinancialPlanController.ActivePlan.Savings, goalConverted, measurements),
                AutoSize  = true,
                Font      = new Font("Segoe UI", 10.2F, FontStyle.Bold),
                ForeColor = Color.Gainsboro
            };

            currentForm.Controls.Add(icon);
            currentForm.Controls.Add(goalName);
            currentForm.Controls.Add(trackBarGoal);
            currentForm.Controls.Add(goalPrice);
            currentForm.Controls.Add(estimatedTime);
        }
 public void SetImage(Image image)
 {
     IconPictureBox.Image = image;
     IconPictureBox.Refresh();
 }
Exemplo n.º 17
0
 //Control buttons
 private void ResetBtnColor(IconPictureBox button)
 {
     button.ForeColor = Color.Gainsboro;
 }
Exemplo n.º 18
0
        private void HoverOutColor(object sender, EventArgs e)
        {
            IconPictureBox one = (IconPictureBox)sender;

            one.IconColor = Color.PapayaWhip;
        }
Exemplo n.º 19
0
        private void PublishBtn_Click(object sender, EventArgs e)
        {
            if (lastActivity == null)
            {
                lastActivity         = ControlExtensions.Clone(PanelPublication);
                lastActivity.Visible = true;


                lastActivity.Name = "New Publication";
                PictureBox pb = ControlExtensions.Clone(Friend1Picture);
                pb.Image   = app.User.Picture;
                pb.Visible = true;
                pb.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                pb.Cursor = Cursors.Hand;
                Label name = ControlExtensions.Clone(Friend1);
                name.Text    = app.User.email;
                name.Visible = true;
                name.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                name.Cursor = Cursors.Hand;

                Label data = ControlExtensions.Clone(Date);
                data.Text    = DateTime.Now.ToString("MM/dd/yyyy h:mm tt");
                data.Visible = true;
                data.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                data.Cursor = Cursors.Hand;

                TextBox text = ControlExtensions.Clone(PubText);
                text.Text            = ActivityTextBox.Text;
                text.Visible         = true;
                ActivityTextBox.Text = "";
                Panel newPanel6 = ControlExtensions.Clone(panel6);
                newPanel6.Visible = true;
                newPanel6.Name    = app.User.email;
                newPanel6.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                newPanel6.Cursor = Cursors.Hand;

                Label likes = ControlExtensions.Clone(LikeBox);
                likes.Text    = "0";
                likes.Visible = true;
                Label redirect = ControlExtensions.Clone(RedirectBox);
                redirect.Text    = "0";
                redirect.Visible = true;
                Label replay = ControlExtensions.Clone(LikeBox);
                replay.Text    = "0";
                replay.Visible = true;
                IconPictureBox icon1 = new IconPictureBox();
                InitLikeIcon(icon1);
                IconPictureBox icon2 = new IconPictureBox();
                InitRedirectIcon(icon2);


                newPanel6.Controls.Add(pb);
                newPanel6.Controls.Add(name);
                lastActivity.Controls.Add(text);
                lastActivity.Controls.Add(icon1);
                lastActivity.Controls.Add(icon2);
                newPanel6.Controls.Add(data);
                lastActivity.Controls.Add(likes);
                lastActivity.Controls.Add(redirect);
                lastActivity.Controls.Add(replay);

                lastActivity.Controls.Add(newPanel6);
                lastActivity.Show();
                activities.Add(lastActivity);
                ActivityPanel.Controls.Add(lastActivity);
                ActivityPanel.Refresh();
            }
            else
            {
                Panel newPanel6 = ControlExtensions.Clone(panel6);
                newPanel6.Visible = true;
                newPanel6.Name    = app.User.email;
                newPanel6.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                newPanel6.Cursor = Cursors.Hand;
                Panel newPub = ControlExtensions.Clone(PanelPublication);
                newPub.Visible  = true;
                newPub.Name     = "New Publication";
                newPub.Location = new Point(lastActivity.Location.X, lastActivity.Location.Y + 160);
                PictureBox pb = ControlExtensions.Clone(Friend1Picture);
                pb.Image   = app.User.Picture;
                pb.Visible = true;
                pb.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                pb.Cursor = Cursors.Hand;

                Label name = ControlExtensions.Clone(Friend1);
                name.Text    = app.User.email;
                name.Visible = true;
                name.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                name.Cursor = Cursors.Hand;
                Label data = ControlExtensions.Clone(Date);
                data.Text    = DateTime.Now.ToString("MM/dd/yyyy h:mm tt");
                data.Visible = true;
                data.Click  += delegate(object sender2, EventArgs e2)
                {
                    Click(sender2, e2, app.User.email);
                };
                data.Cursor = Cursors.Hand;

                TextBox text = ControlExtensions.Clone(PubText);
                text.Text            = ActivityTextBox.Text;
                text.Visible         = true;
                ActivityTextBox.Text = "";
                Label likes = ControlExtensions.Clone(LikeBox);
                likes.Text    = "0";
                likes.Visible = true;
                Label redirect = ControlExtensions.Clone(LikeBox);
                redirect.Text    = "0";
                redirect.Visible = true;
                Label replay = ControlExtensions.Clone(LikeBox);
                replay.Text    = "0";
                replay.Visible = true;
                IconPictureBox icon1 = new IconPictureBox();
                InitLikeIcon(icon1);
                IconPictureBox icon2 = new IconPictureBox();
                InitRedirectIcon(icon2);



                newPanel6.Controls.Add(pb);
                newPanel6.Controls.Add(name);
                newPub.Controls.Add(text);
                newPub.Controls.Add(icon1);
                newPub.Controls.Add(icon2);
                newPanel6.Controls.Add(data);
                newPub.Controls.Add(likes);
                newPub.Controls.Add(redirect);
                newPub.Controls.Add(replay);
                newPub.Controls.Add(newPanel6);
                newPub.Show();
                ActivityPanel.Controls.Add(newPub);
                ActivityPanel.Refresh();
                lastActivity = newPub;
            }

            NoActivity.Visible   = false;
            ActivityTextBox.Text = "";
        }
        private void buildMenuOption(menuItemClass menuItem, int placeIndex, int firstmenuItemListIndex, int menuItemsCount)
        {
            int titlePosY         = 0;
            int menuPosX          = enVars.layoutDesign.menu.properties.ClosedStateSize;
            int iconSize          = Convert.ToInt16(enVars.layoutDesign.menu.properties.ClosedStateSize * 0.7);
            var subMenuExpandIcon = new IconPictureBox();
            var subMenuIcon       = new PictureBox();

            menuItem.iconPicHolder = new List <PictureBox>();
            PanelDoubleBuffer activeBar;
            var index        = enVars.layoutDesign.menu.items.FindIndex(c => c.menuUID.Equals(menuItem.menuUID));
            var subMenuPanel = new PanelDoubleBuffer()
            {
                Width     = enVars.layoutDesign.menu.properties.width,
                Height    = enVars.layoutDesign.menu.properties.height,
                BackColor = enVars.layoutDesign.menu.properties.backColor,
                Parent    = setup.menuPanel,
                Name      = menuItem.menuUID + "-" + index,
                Location  = new Point(0, enVars.layoutDesign.menu.properties.height * placeIndex)
            };

            subMenuPanel.Click += menuPanel_Click;
            if (placeIndex.Equals(0))
            {
                subMenuIcon = new PictureBox()
                {
                    Width    = iconSize,
                    Height   = iconSize,
                    Location = new Point((enVars.layoutDesign.menu.properties.height - iconSize) / 2, (enVars.layoutDesign.menu.properties.height - iconSize) / 2),
                    Parent   = subMenuPanel,
                    Cursor   = Cursors.Hand
                };
                if (menuItem.menuTitle.Equals("username"))
                {
                    if (enVars.userPhoto.Equals(""))
                    {
                        subMenuIcon.Image = Image.FromFile(enVars.imagesPath + "worker.icon.png");
                    }
                    else
                    {
                        subMenuIcon.InitialImage = Image.FromFile(enVars.imagesPath + Convert.ToString("loading.png"));
                        subMenuIcon.SizeMode     = PictureBoxSizeMode.StretchImage;
                        var tClient = new WebClient();
                        try
                        {
                            // TODO where to save the files
                            Bitmap tImage = (Bitmap)Image.FromStream(new MemoryStream(tClient.DownloadData(enVars.ServerBaseAddr + "/csl/photos/" + enVars.userPhoto)));
                            subMenuIcon.Image = tImage;
                        }
                        catch (Exception ex)
                        {
                            System.Threading.Thread.CurrentThread.CurrentUICulture = System.Globalization.CultureInfo.GetCultureInfo(enVars.currentLang);
                            subMenuIcon.Image = Image.FromFile(enVars.imagesPath + Convert.ToString("worker.icon.png"));
                            updateStausMessage?.Invoke(this, resources.GetString("errorDownloadingPhoto"));
                        }
                    }
                }
                else if (!menuItem.icon.Equals(""))
                {
                    var checkFile = new FileInfo(enVars.imagesPath + menuItem.icon);
                    checkFile.Refresh();
                    if (checkFile.Exists)
                    {
                        subMenuIcon.Image = Image.FromFile(enVars.imagesPath + menuItem.icon);
                    }
                }

                subMenuIcon.SizeMode = PictureBoxSizeMode.StretchImage;
                subMenuIcon.Click   += menuPanel_Click;
                subMenuPanel.Controls.Add(subMenuIcon);

                //expand icon
                subMenuExpandIcon = new IconPictureBox()
                {
                    IconColor = enVars.layoutDesign.labelForeColor,
                    BackColor = Color.Transparent,
                    Cursor    = Cursors.Hand,
                    IconChar  = IconChar.ArrowDown,
                    IconSize  = iconSize,
                    Location  = new Point(enVars.layoutDesign.menu.properties.width - enVars.layoutDesign.menu.properties.height, Convert.ToInt16(enVars.layoutDesign.menu.properties.height / 2 - iconSize / 2)),
                    Name      = menuItem.menuUID + "_expandIcon-" + index,
                    Size      = new Size(enVars.layoutDesign.menu.properties.height - 6, enVars.layoutDesign.menu.properties.height - 6),
                    Parent    = subMenuPanel
                };

                // TODO add tooltips
                subMenuExpandIcon.Click += menuExpandPanel_Click;
                subMenuPanel.Controls.Add(subMenuExpandIcon);
            }

            // MENU ITEM ACTIVE BAR  =====================================================================================================================
            // TODO: ????
            if (placeIndex.Equals(0))
            {
                menuPosX = enVars.layoutDesign.menu.properties.height;
            }
            else
            {
                menuPosX = enVars.layoutDesign.menu.properties.activeBarWidth + 5;
            }

            if (placeIndex > 0)
            {
                activeBar = new PanelDoubleBuffer()
                {
                    Width     = enVars.layoutDesign.menu.properties.activeBarWidth,
                    Height    = subMenuPanel.Height - 1,
                    BackColor = Color.Transparent,
                    Location  = new Point(0, 0),
                    Parent    = subMenuPanel,
                    Name      = menuItem.menuUID + "_activeBar-" + index
                };
                subMenuPanel.Controls.Add(activeBar);
            }
            else
            {
                activeBar = default;
            }

            // MENU ITEM NOTIFICATION  =====================================================================================================================
            var notif = new LabelDoubleBuffer()
            {
                Location  = new Point(subMenuPanel.Width - enVars.layoutDesign.menu.properties.ClosedStateSize, 5),
                Font      = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.subMenuTitleFontSize, FontStyle.Regular),
                Text      = "",
                Parent    = subMenuPanel,
                ForeColor = Color.Orange,
                BackColor = Color.Transparent,
                Cursor    = Cursors.Hand,
                Name      = menuItem.menuUID + "_notificationIcon-" + index
            };

            if (menuItem.notifications > 0)
            {
                if (menuItem.notifications < 10)
                {
                    notif.Text = "0" + menuItem.notifications.ToString();
                }
                else
                {
                    notif.Text = menuItem.notifications.ToString();
                }
            }

            notif.Click += menuNotification_Click;
            subMenuPanel.Controls.Add(notif);

            // MENU ITEM TITLE TEXT =====================================================================================================================
            if (menuItem.menuTitle.Equals("username"))
            {
                var subtitle = new LabelDoubleBuffer()
                {
                    Font      = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.subMenuTitleFontSize, FontStyle.Regular),
                    Location  = new Point(menuPosX, 26),
                    Text      = enVars.customization.businessname,
                    Parent    = setup.menuPanel,
                    ForeColor = Color.White,
                    BackColor = Color.Transparent,
                    Width     = enVars.layoutDesign.menu.properties.width,
                    Cursor    = Cursors.Hand
                };
                subtitle.Click += menuPanel_Click;
                setup.menuPanel.Controls.Add(subtitle);
                titlePosY = 5;
            }
            else if (placeIndex.Equals(0))
            {
                titlePosY = Convert.ToInt16((setup.menuPanel.Height - sizeOfString.Height) / 2);
            }
            else
            {
                titlePosY = Convert.ToInt16((setup.menuPanel.Height - sizeOfString.Height) / 2);
            }

            var title = new LabelDoubleBuffer()
            {
                Font      = new Font(enVars.layoutDesign.fontTitle.Families[0], enVars.layoutDesign.menuTitleFontSize, FontStyle.Regular),
                Location  = new Point(menuPosX, titlePosY),
                Text      = menuItem.menuTitle.Equals("username") ? enVars.username.Equals("") ? "user" : enVars.username : menuItem.menuTitle,
                Parent    = setup.menuPanel,
                ForeColor = Color.White,
                BackColor = Color.Transparent,
                Width     = enVars.layoutDesign.menu.properties.width,
                Cursor    = Cursors.Hand,
                Name      = menuItem.menuUID + "_title-" + index
            };

            title.Click += menuPanel_Click;
            subMenuPanel.Controls.Add(title);
            setup.menuPanel.Controls.Add(subMenuPanel);
            enVars.layoutDesign.menu.items[index].menuListIndex      = firstmenuItemListIndex;
            enVars.layoutDesign.menu.items[index].menuItemPanel      = subMenuPanel;
            enVars.layoutDesign.menu.items[index].menuActiveBarPanel = activeBar;
            enVars.layoutDesign.menu.items[index].iconPicHolder      = new List <PictureBox>();
            enVars.layoutDesign.menu.items[index].iconPicHolder.Add(subMenuIcon);
            enVars.layoutDesign.menu.items[index].iconPicHolderFontAwesome[1] = subMenuExpandIcon;
        }
Exemplo n.º 21
0
 private void SeleccionarBoton(IconPictureBox button)
 {
     selectedButton   = button.Name;
     button.BackColor = Color.LightBlue;
 }