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

            Childform.Show();
        }
Ejemplo n.º 2
0
        public void FindTaskDefaultResponse(FindTaskForm x)
        {
            // Zmienne przechowujace szerokosc oraz wysokosc ekranu
            int widthSize  = x.Width;
            int heightSize = x.Height;
            //zmienne przechowujace skalowanie dla wiekszej liczby kontrolek
            FontStyle fontStyle                         = FontStyle.Bold;
            int       labelFontSize                     = widthSize / 55;
            int       labelHeightSize                   = (int)(heightSize / 26.31);
            int       labelHeightLocation               = (int)(heightSize / 12.82);
            int       textBoxHeightSize                 = (int)(heightSize / 2.5);
            int       labelFontTextBox                  = (int)(widthSize / 62.5);
            int       textBoxWidthLocation              = (int)(widthSize / 26.78);
            int       findTaskLabelWidthLocation        = (int)(widthSize / 31.25);
            int       labelFilterFontSize               = (int)(widthSize / 65);
            int       filterDataPickerWidthSize         = (int)(widthSize / 2.70);
            int       filterDataPickerHeightSize        = (int)(heightSize / 22.72);
            int       filterLabelWidthLocation          = (int)(widthSize / 93.75);
            int       filterDateTimePickerWidthLocation = (int)(widthSize / 62.5);
            int       filterFromDateTimePickerHeight    = (int)(heightSize / 2.38);
            int       filterLabelWidthSize              = (int)(widthSize / 9.74);
            int       filterLabelHeightSize             = (int)(heightSize / 26.31);
            // zmienne przechowujace skalowanie dla wlasciwosci size kontrolek
            int findTaskLabelWidthSize        = (int)(widthSize / 4.03);
            int findTaskTextBoxWidthSize      = (int)(widthSize / 3.5);
            int findTaskFilterLabelWidthSize  = (int)(widthSize / 19.73);
            int findTaskFilterLabelHeightSize = (int)(heightSize / 26.31);
            int filterComboBoxHeightSize      = (int)(heightSize / 23.8);
            int findPictureBoxWidthSize       = (int)(widthSize / 4.26);
            int findPictureBoxHeightSize      = (int)(heightSize / 5.05);
            int findPictureBoxWidthLocation   = (int)(widthSize / 17.04);
            int findPictureBoxHeightLocation  = (int)(heightSize / 1.39);
            int findTaskDataGridWidthSize     = (int)(widthSize / 1.66);
            int findTaskDataGridHeightSize    = heightSize / 1;

            // Ustawienie rozmairu dla wszystkich kontrolek
            x.FindTaskLabel.Size    = new Size(findTaskLabelWidthSize, labelHeightSize);
            x.FindTaskTextBox.Size  = new Size(findTaskTextBoxWidthSize, textBoxHeightSize);
            x.FilterLabel.Size      = new Size(findTaskFilterLabelWidthSize, findTaskFilterLabelHeightSize);
            x.FilterFrom.Size       = new Size(filterDataPickerWidthSize, filterDataPickerHeightSize);
            x.FilterTo.Size         = new Size(filterDataPickerWidthSize, filterDataPickerHeightSize);
            x.FilterComboBox.Size   = new Size(findTaskTextBoxWidthSize, filterComboBoxHeightSize);
            x.FilterFromLabel.Size  = new Size(filterLabelWidthSize, filterLabelHeightSize);
            x.FilterToLabel.Size    = new Size(filterLabelWidthSize, filterLabelHeightSize);
            x.FindPictureBox.Size   = new Size(findPictureBoxWidthSize, findPictureBoxHeightSize);
            x.FindTaskDataGrid.Size = new Size(findTaskDataGridWidthSize, findTaskDataGridHeightSize);



            // zmienne przechowujace skalowanie dla wlasciowsci location kontrolek
            int textBoxHeightLocation                = (int)(heightSize / 8.19);
            int filterLabelHeightLocation            = (int)(heightSize / 4.42);
            int filterToLabelHeightLocation          = (int)(heightSize / 2.05);
            int filterFromLabelHeightLocation        = (int)(heightSize / 2.66);
            int filterToDateTimePickerHeightLocation = (int)(heightSize / 1.88);
            int filterComboBoxLocation               = (int)(heightSize / 3.70);

            // Ustawienie lokalizacji dla wszystkich kontrolek
            x.FindTaskLabel.Location   = new Point(findTaskLabelWidthLocation, labelHeightLocation);
            x.FindTaskTextBox.Location = new Point(textBoxWidthLocation, textBoxHeightLocation);
            x.FilterLabel.Location     = new Point(findTaskLabelWidthLocation, filterLabelHeightLocation);
            x.FilterFromLabel.Location = new Point(filterLabelWidthLocation, filterFromLabelHeightLocation);
            x.FilterToLabel.Location   = new Point(filterLabelWidthLocation, filterToLabelHeightLocation);
            x.FilterFrom.Location      = new Point(filterDateTimePickerWidthLocation, filterFromDateTimePickerHeight);
            x.FilterTo.Location        = new Point(filterDateTimePickerWidthLocation, filterToDateTimePickerHeightLocation);
            x.FilterComboBox.Location  = new Point(textBoxWidthLocation, filterComboBoxLocation);
            x.FindPictureBox.Location  = new Point(findPictureBoxWidthLocation, findPictureBoxHeightLocation);
            // Ustawienie czcionek dla wszystkich kontrolek
            if (Settings.Default.BoldFont)
            {
                x.FindTaskLabel.Font   = new Font(fontName, labelFontSize, fontStyle);
                x.FindTaskTextBox.Font = new Font(fontName, labelFontTextBox);
                x.FilterLabel.Font     = new Font(fontName, labelFontSize, fontStyle);
                x.FilterComboBox.Font  = new Font(fontName, labelFontTextBox);
                x.FilterFromLabel.Font = new Font(fontName, labelFontSize, fontStyle);
                x.FilterFrom.Font      = new Font(fontName, labelFilterFontSize);
                x.FilterTo.Font        = new Font(fontName, labelFilterFontSize);
                x.FilterToLabel.Font   = new Font(fontName, labelFontSize, fontStyle);
            }
            else
            {
                x.FindTaskLabel.Font   = new Font(fontName, labelFontSize);
                x.FindTaskTextBox.Font = new Font(fontName, labelFontTextBox);
                x.FilterLabel.Font     = new Font(fontName, labelFontSize);
                x.FilterComboBox.Font  = new Font(fontName, labelFontTextBox);
                x.FilterFromLabel.Font = new Font(fontName, labelFontSize);
                x.FilterFrom.Font      = new Font(fontName, labelFilterFontSize);
                x.FilterTo.Font        = new Font(fontName, labelFilterFontSize);
                x.FilterToLabel.Font   = new Font(fontName, labelFontSize);
            }
        }