Ejemplo n.º 1
0
    private void InitComponents()
    {
        BackColor       = Shared.preferences.colorForeground;
        SizeChanged    += CcHistoryViewer_SizeChanged;
        VisibleChanged += CcHistoryViewer_VisibleChanged;
        DoubleBuffered  = true;
        AutoScroll      = true;
        //Scroll += CcHistoryViewer_Scroll;

        ccSearchContainer = new CcPanel()
        {
            Parent    = this,
            BackColor = Shared.preferences.colorBackground
        };
        Controls.Add(ccSearchContainer);

        ccSearch = new TextBox()
        {
            Parent      = ccSearchContainer,
            BorderStyle = BorderStyle.None,
            BackColor   = Shared.preferences.colorBackground,
            ForeColor   = Shared.preferences.colorFontDefault,
            Font        = new Font(Shared.preferences.fontDefault.FontFamily, 26, GraphicsUnit.Pixel),
            Text        = searchPlaceholder
        };
        ccSearch.TextChanged += CcSearch_TextChanged;
        ccSearch.GotFocus    += CcSearch_GotFocus;
        ccSearch.LostFocus   += CcSearch_LostFocus;
        ccSearchContainer.Controls.Add(ccSearch);
    }
Ejemplo n.º 2
0
        private void InitComponents()
        {
            ccLabelSettins = new Label()
            {
                Parent    = this,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 36, GraphicsUnit.Pixel),
                Text      = "Settings",
                AutoSize  = true
            };
            Controls.Add(ccLabelSettins);

            // Colors
            ccContainerColors = new CcPanel()
            {
                Parent    = this,
                BackColor = Shared.preferences.colorBackground,
                AutoSize  = true
            };
            Controls.Add(ccContainerColors);


            ccTitleColors = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 28, GraphicsUnit.Pixel),
                Text      = "Colors",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccTitleColors);


            ccLabelColorFont = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Font color:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorFont);

            ccPanelColorFont = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorFontDefault,
                Cursor    = Cursors.Hand
            };
            ccPanelColorFont.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorFont);


            ccLabelColorForeground = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Background light:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorForeground);

            ccPanelColorForeground = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorForeground,
                Cursor    = Cursors.Hand
            };
            ccPanelColorForeground.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorForeground);


            ccLabelColorBackground = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Background dark:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorBackground);

            ccPanelColorBackground = new CcPanel()
            {
                Parent      = ccContainerColors,
                BackColor   = Shared.preferences.colorBackground,
                Cursor      = Cursors.Hand,
                BorderStyle = BorderStyle.FixedSingle
            };
            ccPanelColorBackground.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorBackground);


            ccLabelColorAccent1 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 1:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent1);

            ccPanelColorAccent1 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent1,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent1.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent1);


            ccLabelColorAccent2 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 2:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent2);

            ccPanelColorAccent2 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent2,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent2.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent2);


            ccLabelColorAccent3 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 3:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent3);

            ccPanelColorAccent3 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent3,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent3.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent3);


            ccLabelColorAccent4 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 4:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent4);

            ccPanelColorAccent4 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent4,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent4.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent4);


            ccLabelColorAccent5 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 5:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent5);

            ccPanelColorAccent5 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent5,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent5.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent5);

            ccLabelColorAccent6 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 6:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent6);

            ccPanelColorAccent6 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent6,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent6.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent6);


            ccLabelColorAccent7 = new Label()
            {
                Parent    = ccContainerColors,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Accent 7:",
                AutoSize  = true
            };
            ccContainerColors.Controls.Add(ccLabelColorAccent7);

            ccPanelColorAccent7 = new CcPanel()
            {
                Parent    = ccContainerColors,
                BackColor = Shared.preferences.colorAccent7,
                Cursor    = Cursors.Hand
            };
            ccPanelColorAccent7.Click += CCPanelColorX_Click;
            ccContainerColors.Controls.Add(ccPanelColorAccent7);

            // File folder
            ccContainerFiles = new CcPanel()
            {
                Parent    = this,
                BackColor = Shared.preferences.colorBackground,
                AutoSize  = true
            };
            Controls.Add(ccContainerFiles);

            ccTitleFiles = new Label()
            {
                Parent    = ccContainerFiles,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 28, GraphicsUnit.Pixel),
                Text      = "File folders",
                AutoSize  = true
            };
            ccContainerFiles.Controls.Add(ccTitleFiles);


            ccLabelFolderDownloads = new Label()
            {
                Parent    = ccContainerFiles,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Downloads folder: ",
                AutoSize  = true
            };
            ccContainerFiles.Controls.Add(ccLabelFolderDownloads);

            ccTextFolderDownloads = new RichTextBox()
            {
                Parent      = ccContainerFiles,
                ForeColor   = Shared.preferences.colorFontDefault,
                BackColor   = ccContainerFiles.BackColor,
                BorderStyle = BorderStyle.None,
                Font        = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                ReadOnly    = true,
                WordWrap    = true,
                Text        = Path.GetFullPath(Shared.preferences.downloadsDirectory)
            };
            ccContainerFiles.Controls.Add(ccTextFolderDownloads);

            ccButtonFolderDownloads = new CcPanel()
            {
                Parent = ccContainerFiles,
                Cursor = Cursors.Hand,
                BackgroundImageLayout = ImageLayout.Zoom,
                BackgroundImage       = SharedFunctions.getImage(Path.Combine(OnlineResource.resourcesDirectory, OnlineResource.FormControls_IMG_Directory)),
                BackColor             = ccContainerFiles.BackColor
            };
            ccButtonFolderDownloads.Click += ccButtonFolderDownloads_Click;
            ccContainerFiles.Controls.Add(ccButtonFolderDownloads);


            ccLabelFolderTemp = new Label()
            {
                Parent    = ccContainerFiles,
                ForeColor = Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                Text      = "Temporary files: ",
                AutoSize  = true
            };
            ccContainerFiles.Controls.Add(ccLabelFolderTemp);

            ccTextFolderTemp = new RichTextBox()
            {
                Parent      = ccContainerFiles,
                ForeColor   = Shared.preferences.colorFontDefault,
                BackColor   = ccContainerFiles.BackColor,
                BorderStyle = BorderStyle.None,
                Font        = new Font(Shared.preferences.fontDefault.FontFamily, 18, GraphicsUnit.Pixel),
                ReadOnly    = true,
                WordWrap    = true,
                Text        = Path.GetFullPath(Shared.preferences.tempDirectoy)
            };
            ccContainerFiles.Controls.Add(ccTextFolderTemp);

            ccButtonFolderTemp = new CcPanel()
            {
                Parent = ccContainerFiles,
                Cursor = Cursors.Hand,
                BackgroundImageLayout = ImageLayout.Zoom,
                BackgroundImage       = SharedFunctions.getImage(Path.Combine(OnlineResource.resourcesDirectory, OnlineResource.FormControls_IMG_Directory)),
                BackColor             = ccContainerFiles.BackColor
            };
            ccButtonFolderTemp.Click += CcButtonFolderTemp_Click;
            ccContainerFiles.Controls.Add(ccButtonFolderTemp);

            ccLabelUpdate = new Label()
            {
                Parent = this,
                //BackColor = Shared.preferences.colorAccent6,//Shared.preferences.colorAccent6,
                ForeColor = Shared.preferences.colorAccent2,//Shared.preferences.colorFontDefault,
                Font      = new Font(Shared.preferences.fontDefault.FontFamily, 36, GraphicsUnit.Pixel),
                Text      = "Update",
                AutoSize  = false,
                Cursor    = Cursors.Hand,
                TextAlign = ContentAlignment.MiddleCenter
            };
            ccLabelUpdate.Paint += CcLabelUpdate_Paint;
            ccLabelUpdate.Click += CcLabelUpdate_Click;
            Controls.Add(ccLabelUpdate);

            // Bottom margin
            ccBottomMargin = new CcPanel()
            {
                Parent    = this,
                BackColor = BackColor
            };
            Controls.Add(ccBottomMargin);
        }