Ejemplo n.º 1
0
        public void OpenFormCategory()
        {
            CategoryForm Childform = new CategoryForm
            {
                MdiParent = this.ParentForm,
                Dock      = DockStyle.Fill
            };

            Childform.Show();
        }
Ejemplo n.º 2
0
        public void CategoryFormDefaultResponse(CategoryForm x)
        {
            // Zmienne przechowujace szerokosc oraz wysokosc ekranu
            int widthSize  = x.Width;
            int heightSize = x.Height;
            //zmienne przechowujace skalowanie dla wiekszej liczby kontrolek

            int labelFontSize          = 12;
            int gridFontSize           = 11;
            int labelHeightSize        = (int)(heightSize / 21.74);
            int labelHeightLocation    = (int)(heightSize / 55.55);
            int dataGridWidthSize      = (int)(widthSize / 4.16);
            int dataGridHeightSize     = (int)(heightSize / 1.1);
            int dataGridHeightLocation = (int)(heightSize / 14.28);
            // zmienne przechowujace skalowanie dla wlasciwosci size kontrolek
            int chooseCategoryLabelWidthSize     = (int)(widthSize / 4.07);
            int chooseTaskLabelWidthSize         = (int)(widthSize / 4.41);
            int describeTaskLabelWidthSize       = (int)(widthSize / 5.35);
            int describeTaskRichTextBoxWidthSize = (int)(widthSize / 2.51);

            // Ustawienie rozmairu dla wszystkich kontrolek
            x.chooseCategoryLabel.Size     = new Size(chooseCategoryLabelWidthSize, labelHeightSize);
            x.chooseTaskLabel.Size         = new Size(chooseTaskLabelWidthSize, labelHeightSize);
            x.describeTaskLabel.Size       = new Size(describeTaskLabelWidthSize, labelHeightSize);
            x.chooseCategoryDataGrid.Size  = new Size(dataGridWidthSize, dataGridHeightSize);
            x.chooseTaskDataGrid.Size      = new Size(dataGridWidthSize, dataGridHeightSize);
            x.describeTaskRichTextBox.Size = new Size(describeTaskLabelWidthSize, dataGridHeightSize);
            // zmienne przechowujace skalowanie dla wlasciowsci location kontrolek
            int chooseCategoryLabelWidthLocation     = (int)(widthSize / 62.5);
            int chooseTaskLabelWidthLocation         = (int)(widthSize / 3.02);
            int describeTaskLabelWidthLocation       = (int)(widthSize / 1.5);
            int chooseCategoryDataGridWidthLocation  = (int)(widthSize / 46.87);
            int chooseTaskDataGridWidthLocation      = (int)(widthSize / 2.97);
            int describeTaskRIchTextBoxWidthLocation = (int)(widthSize / 1.49);

            // Ustawienie lokalizacji dla wszystkich kontrolek
            x.chooseCategoryLabel.Location     = new Point(chooseCategoryLabelWidthLocation, labelHeightLocation);
            x.chooseTaskLabel.Location         = new Point(chooseTaskLabelWidthLocation, labelHeightLocation);
            x.describeTaskLabel.Location       = new Point(describeTaskLabelWidthLocation, labelHeightLocation);
            x.chooseCategoryDataGrid.Location  = new Point(chooseCategoryDataGridWidthLocation, dataGridHeightLocation);
            x.chooseTaskDataGrid.Location      = new Point(chooseTaskDataGridWidthLocation, dataGridHeightLocation);
            x.describeTaskRichTextBox.Location = new Point(describeTaskRIchTextBoxWidthLocation, dataGridHeightLocation);
            // Ustawienie czcionek dla wszystkich kontrolek

            if (Settings.Default.BoldFont)
            {
                x.chooseCategoryLabel.Font     = new Font(fontName, labelFontSize, fontStyle);
                x.chooseTaskLabel.Font         = new Font(fontName, labelFontSize, fontStyle);
                x.describeTaskLabel.Font       = new Font(fontName, labelFontSize, fontStyle);
                x.chooseCategoryDataGrid.Font  = new Font(fontName, gridFontSize, fontStyle);
                x.chooseTaskDataGrid.Font      = new Font(fontName, gridFontSize, fontStyle);
                x.describeTaskRichTextBox.Font = new Font(fontName, gridFontSize, fontStyle);
            }
            else
            {
                x.chooseCategoryLabel.Font     = new Font(fontName, labelFontSize);
                x.chooseTaskLabel.Font         = new Font(fontName, labelFontSize);
                x.describeTaskLabel.Font       = new Font(fontName, labelFontSize);
                x.chooseCategoryDataGrid.Font  = new Font(fontName, gridFontSize);
                x.chooseTaskDataGrid.Font      = new Font(fontName, gridFontSize);
                x.describeTaskRichTextBox.Font = new Font(fontName, gridFontSize);
            }
        }