Пример #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            int origHeight = panelDetails.Height;

            using (new AutoGrow(panelDetails, AnchorStyles.Bottom, true))
            {
                LayoutHelper.NaturalizeHeightAndDistribute(8, panelDetails.Controls);

                LayoutHelper.NaturalizeHeightAndDistribute(2, labelName, textBoxName);
                LayoutHelper.NaturalizeHeightAndDistribute(8, textBoxName, label1);

                LayoutHelper.NaturalizeHeightAndDistribute(2, label1, textBoxHtmlFormat);
                LayoutHelper.NaturalizeHeightAndDistribute(8, textBoxHtmlFormat, label5);

                LayoutHelper.NaturalizeHeightAndDistribute(2, label5, textBoxSeparator);
                LayoutHelper.NaturalizeHeightAndDistribute(8, textBoxSeparator, label4);

                LayoutHelper.NaturalizeHeightAndDistribute(2, label4, textBoxCaption);
                LayoutHelper.NaturalizeHeightAndDistribute(8, textBoxCaption, label2);

                LayoutHelper.NaturalizeHeightAndDistribute(2, label2, textBoxPreview);
            }
            Height += panelDetails.Height - origHeight;

            LayoutHelper.FixupOKCancel(buttonOk, buttonCancel);
        }
Пример #2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Size = _mapOptions.DefaultDialogSize;



            using (LayoutHelper.SuspendAnchoring(mapControl, mapTipControl, buttonOK, buttonCancel))
            {
                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
                mapTipControl.Width = buttonOK.Left - mapTipControl.Left - (int)DisplayHelper.ScaleX(8f);
                LayoutHelper.NaturalizeHeight(mapTipControl);

                int oldTop = buttonCancel.Top;
                if (mapTipControl.Bottom > buttonOK.Bottom)
                {
                    buttonOK.Top = buttonCancel.Top = mapTipControl.Bottom - buttonOK.Height;
                }

                Height += Math.Max(0, buttonCancel.Top - oldTop);
            }

            bool visible = cbShowLabels.Visible;

            cbShowLabels.Visible = true;
            cbShowLabels.Width   = mapControl.Left - cbShowLabels.Left - 3;
            LayoutHelper.NaturalizeHeight(cbShowLabels);
            cbShowLabels.Visible = visible;

            buttonGotoBirdseye.Top = Math.Max(cbShowLabels.Bottom, mapBirdsEyeDirectionControl.Bottom) + 12;

            textBoxAddress.Focus();
        }
Пример #3
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     using (new AutoGrow(this, AnchorStyles.Bottom, false))
     {
         tagEditor.NaturalizeLayout();
         LayoutHelper.FixupOKCancel(buttonInsert, buttonCancel);
     }
 }
Пример #4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ParentForm.AcceptButton = this.btnOK;
            ParentForm.CancelButton = this.btnCancel;
            ParentForm.Closing     += new CancelEventHandler(ParentForm_Closing);

            LayoutHelper.FixupOKCancel(btnOK, btnCancel);
            LayoutHelper.NaturalizeHeight(label1, label2);
        }
Пример #5
0
        protected override void OnLoad(EventArgs e)
        {
            using (new AutoGrow(this, AnchorStyles.None, false))
            {
                DisplayHelper.AutoFitSystemLabel(label1, label1.Width, label1.Width);
                LayoutHelper.DistributeVertically(8, label1, newFolderName, new ControlGroup(buttonOK, buttonCancel));
                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
            }

            base.OnLoad(e);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (AutoGrow autoGrow = new AutoGrow(this, AnchorStyles.Right, false))
            {
                autoGrow.AllowAnchoring = true;

                cellPropertiesControl.AdjustSize();
                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
            }
        }
Пример #7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);

            using (new AutoGrow(this, AnchorStyles.Bottom, false))
            {
                LayoutHelper.NaturalizeHeightAndDistribute(3, labelPath, new ControlGroup(textBoxPath, buttonBrowse));
                LayoutHelper.NaturalizeHeightAndDistribute(3, labelUrlMapping, textBoxUrlMapping);
                LayoutHelper.NaturalizeHeightAndDistribute(8, new ControlGroup(labelPath, textBoxPath, buttonBrowse), new ControlGroup(labelUrlMapping, textBoxUrlMapping), new ControlGroup(pictureBoxHelp, linkLabel1), new ControlGroup(buttonOK, buttonCancel));
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Bottom, true))
            {
                LayoutHelper.NaturalizeHeightAndDistribute(4, label1, linkLabel1);
                LayoutHelper.DistributeVertically(12, false, linkLabel1, picCaptcha);
                LayoutHelper.DistributeVertically(4, picCaptcha, txtCaptcha);
                LayoutHelper.DistributeVertically(12, false, txtCaptcha, new ControlGroup(btnOK, btnCancel));
                LayoutHelper.FixupOKCancel(btnOK, btnCancel);
            }
        }
Пример #9
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //Resize the form so that the panel will fit the new value's Size
            Size preferredSize = EditorControl.Size;
            int  deltaHeight   = preferredSize.Height - panelEditor.Height;
            int  deltaWidth    = preferredSize.Width - panelEditor.Width;

            Size = new Size(Width + deltaWidth, Height + deltaHeight);

            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Right | AnchorStyles.Bottom, false))
            {
                // Fix up the Size group box
                using (new AutoGrow(groupBoxSize, AnchorStyles.Right, false))
                {
                    using (new AutoGrow(panelRowsAndColumns, AnchorStyles.Right, false))
                    {
                        DisplayHelper.AutoFitSystemLabel(labelRows, 0, int.MaxValue);
                        DisplayHelper.AutoFitSystemLabel(labelColumns, 0, int.MaxValue);
                        LayoutHelper.DistributeHorizontally(8, labelRows, numericTextBoxRows);
                        LayoutHelper.DistributeHorizontally(8, labelColumns, numericTextBoxColumns);
                        LayoutHelper.DistributeHorizontally(16,
                                                            new ControlGroup(labelRows, numericTextBoxRows),
                                                            new ControlGroup(labelColumns, numericTextBoxColumns));
                    }
                }

                // Fix up the Appearance group box
                using (new AutoGrow(groupBoxAppearance, AnchorStyles.Right | AnchorStyles.Bottom, false))
                {
                    DisplayHelper.AutoFitSystemCheckBox(checkBoxShowBorder, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(label1, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(label3, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelBorderPixels, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelPaddingPixels, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemLabel(labelSpacingPixels, 0, int.MaxValue);
                    LayoutHelper.DistributeHorizontally(
                        8,
                        new ControlGroup(checkBoxShowBorder, label1, label3),
                        new ControlGroup(numericTextBoxBorder, numericTextBoxCellPadding, numericTextBoxCellSpacing),
                        new ControlGroup(labelBorderPixels, labelPaddingPixels, labelSpacingPixels)
                        );
                }

                // Make the group boxes the same width
                int maxWidth = Math.Max(groupBoxAppearance.Width, groupBoxSize.Width);
                groupBoxAppearance.Width = maxWidth;
                groupBoxSize.Width       = maxWidth;
            }

            // Align the OK/Cancel
            ControlGroup okCancelGroup = new ControlGroup(buttonOK, buttonCancel);

            okCancelGroup.Left = groupBoxAppearance.Right - okCancelGroup.Width;
            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
Пример #11
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            // size form (set anchor properties here because doing so in the designer causes
            // hosage of the designer)
            // listBoxPostSources.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom ;
            // listBoxPosts.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom ;
            // Size = PostEditorSettings.OpenPostFormSize ;

            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);

            DisplayHelper.AutoFitSystemLabel(labelShow, 0, int.MaxValue);
            //DisplayHelper.AutoFitSystemCombo(comboBoxPosts, 0, int.MaxValue, false);
            DisplayHelper.AutoFitSystemLabel(labelPosts, 0, int.MaxValue);
            DisplayHelper.AutoFitSystemRadioButton(radioButtonPosts, 0, int.MaxValue);
            DisplayHelper.AutoFitSystemRadioButton(radioButtonPages, 0, int.MaxValue);
            int growBy = GetMaxWidth() - listBoxPosts.Right;

            if (growBy > 0)
            {
                Width += growBy;
                listBoxPosts.Width += growBy;
            }

            // post sources list
            listBoxPostSources.Initialize(_includeDrafts);
            listBoxPostSources.SelectedIndexChanged += new EventHandler(listBoxPostSources_SelectedIndexChanged);

            // number of posts combo
            comboBoxPosts.SelectedIndexChanged += new EventHandler(comboBoxPosts_SelectedIndexChanged);

            // post list
            listBoxPosts.Initialize(this);
            listBoxPosts.SelectedIndexChanged += new EventHandler(listBoxPosts_SelectedIndexChanged);
            listBoxPosts.PostsRefreshed       += new EventHandler(listBoxPosts_PostsRefreshed);
            listBoxPosts.DoubleClick          += new EventHandler(listBoxPosts_DoubleClick);

            buttonDelete.Height = comboBoxPosts.Height + 2;

            textBoxFilter.Width = listBoxPosts.Width;
            int inset = Convert.ToInt32((textBoxFilter.Height - filterPictureBox.Height) / 2f);

            filterPictureBox.Top  = textBoxFilter.Top + inset;
            filterPictureBox.Left = textBoxFilter.Right - 16 - inset;

            // select post source
            SelectInitialPostSource();
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            int origY = label2.Bottom;

            LayoutHelper.NaturalizeHeight(label1, label2);
            LayoutHelper.DistributeVertically(12,
                                              new ControlGroup(rdPlainText, label1),
                                              new ControlGroup(rdFormatted, label2));

            Height += Math.Max(0, label2.Bottom - origY);

            LayoutHelper.FixupOKCancel(btnOK, btnCancel);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            using (LayoutHelper.SuspendAnchoring(blogClientLoginControl, buttonOK, buttonCancel))
            {
                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
                LayoutHelper.NaturalizeHeightAndDistribute(10, blogClientLoginControl, new ControlGroup(buttonOK, buttonCancel));
                ClientSize = new Size(ClientSize.Width, buttonOK.Bottom + 8);
            }

            if (buttonOK.Left < blogClientLoginControl.Left)
            {
                Width += (blogClientLoginControl.Left - buttonOK.Left);
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Form form = FindForm();

            form.AcceptButton = buttonOK;
            form.CancelButton = buttonCancel;

            LayoutHelper.NaturalizeHeightAndDistribute(3, labelText, textBoxText);
            LayoutHelper.NaturalizeHeightAndDistribute(3, labelFontFamily, comboBoxFontFamily);
            LayoutHelper.NaturalizeHeightAndDistribute(3, labelSize, comboBoxSize);
            LayoutHelper.NaturalizeHeightAndDistribute(3, labelPosition, comboBoxPosition);
            LayoutHelper.NaturalizeHeightAndDistribute(10, new ControlGroup(labelText, textBoxText), new ControlGroup(labelFontFamily, comboBoxFontFamily), new ControlGroup(labelSize, comboBoxSize), new ControlGroup(labelPosition, comboBoxPosition));

            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ParentForm.AcceptButton = btnOK;
            ParentForm.CancelButton = btnCancel;

            btnCancel.Text = Res.Get(StringId.CancelButton);
            btnOK.Text     = Res.Get(StringId.OKButtonText);
            labelTilt.Text = Res.Get(StringId.TiltEditorLabel);

            ParentForm.Closing += ParentForm_Closing;

            LayoutHelper.FixupOKCancel(btnOK, btnCancel);

            textBoxTilt.AccessibleName = ControlHelper.ToAccessibleName(Res.Get(StringId.TiltEditorLabel));
        }
Пример #16
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (new AutoGrow(this, AnchorStyles.Bottom, true))
            {
                LayoutHelper.NaturalizeHeightAndDistribute(16, labelBody, new ControlGroup(buttonOk, buttonCancel));
                LayoutHelper.FixupOKCancel(buttonOk, buttonCancel);

                if (buttonOk.Left < labelBody.Left)
                {
                    // go to over/under
                    LayoutHelper.DistributeVertically(10, false, buttonOk, buttonCancel);
                    buttonOk.Left = buttonCancel.Left = labelBody.Left;
                }
            }
        }
Пример #17
0
        public WebImageForm()
        {
            InitializeComponent();

            _source.Init(panelLayout.Width, panelLayout.Height);
            UserControl uc = _source.ImageSelectionControls;

            panelLayout.Controls.Add(uc);
            buttonInsert.Text         = Res.Get(StringId.InsertImageButton);
            buttonCancel.Text         = Res.Get(StringId.CancelButton);
            buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            Text = Res.Get(StringId.Plugin_WebImage_Title);
            Icon = ApplicationEnvironment.ProductIcon;

            LayoutHelper.FixupOKCancel(buttonInsert, buttonCancel);
            BidiHelper.RtlLayoutFixup(this);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            using (AutoGrow autoGrow = new AutoGrow(this, AnchorStyles.Right, false))
            {
                autoGrow.AllowAnchoring = true;

                using (new AutoGrow(groupBoxHeight, AnchorStyles.Right, false))
                {
                    DisplayHelper.AutoFitSystemRadioButton(radioButtonFixedHeight, 0, int.MaxValue);
                    DisplayHelper.AutoFitSystemRadioButton(radioButtonSizeToContent, 0, int.MaxValue);
                }

                cellPropertiesControl.AdjustSize();

                cellPropertiesControl.Width = groupBoxHeight.Width = Math.Max(cellPropertiesControl.Width, groupBoxHeight.Width);
            }
            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
Пример #19
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Label[]         leftLabels  = { label1, label2, label8, label7, label12, label11 };
            NumericUpDown[] values      = { numericSmallWidth, numericSmallHeight, numericMediumWidth, numericMediumHeight, numericLargeWidth, numericLargeHeight };
            Label[]         rightLabels = { label3, label4, label6, label5, label10, label9 };

            using (AutoGrow autoGrow = new AutoGrow(this, AnchorStyles.Right, false))
            {
                autoGrow.AllowAnchoring = true;

                int deltaX = LayoutHelper.AutoFitLabels(leftLabels);
                new ControlGroup(values).Left      += deltaX;
                new ControlGroup(rightLabels).Left += deltaX;
                LayoutHelper.AutoFitLabels(rightLabels);

                LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
            }
        }
Пример #20
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            Form form = FindForm();

            form.AcceptButton = buttonOK;
            form.CancelButton = buttonCancel;

            //Get chrome size BEFORE changing position of controls
            int chromeSize = form.Height - this.Height;

            LayoutHelper.NaturalizeHeightAndDistribute(3, labelPicture, tableLayoutPanel);
            LayoutHelper.NaturalizeHeightAndDistribute(3, labelAltText, textBoxAltText);
            LayoutHelper.NaturalizeHeightAndDistribute(3, labelTitle, textBoxTitle);
            LayoutHelper.NaturalizeHeightAndDistribute(10, new ControlGroup(labelPicture, tableLayoutPanel), new ControlGroup(labelAltText, textBoxAltText), new ControlGroup(labelTitle, textBoxTitle));
            LayoutHelper.NaturalizeHeightAndDistribute(30, new ControlGroup(labelPicture, tableLayoutPanel, labelAltText, textBoxAltText, labelTitle, textBoxTitle), new ControlGroup(buttonOK, buttonCancel));
            form.Height = buttonOK.Bottom + chromeSize + (int)Math.Ceiling(DisplayHelper.ScaleY(5));

            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
        }
Пример #21
0
        public EditTagForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            textBoxHtmlFormat.RightToLeft = RightToLeft.No;
            textBoxSeparator.RightToLeft  = RightToLeft.No;
            textBoxCaption.RightToLeft    = RightToLeft.No;
            textBoxPreview.RightToLeft    = RightToLeft.No;
            if (BidiHelper.IsRightToLeft)
            {
                textBoxHtmlFormat.TextAlign      =
                    textBoxSeparator.TextAlign   =
                        textBoxCaption.TextAlign = textBoxPreview.TextAlign = HorizontalAlignment.Right;
            }

            buttonOk.Text     = Res.Get(StringId.OKButtonText);
            buttonCancel.Text = Res.Get(StringId.CancelButton);
            label1.Text       = Res.Get(StringId.TagsHtmlTemplateLabel);
            helpProviderCreateTag.SetHelpString(textBoxHtmlFormat,
                                                string.Format(CultureInfo.InvariantCulture, Res.Get(StringId.TagsHtmlTemplateHelpString), "{tag}",
                                                              "{tag-encoded}"));
            label5.Text = Res.Get(StringId.TagsHtmlDelimiterLabel);
            helpProviderCreateTag.SetHelpString(textBoxSeparator, Res.Get(StringId.TagsHtmlDelimiterHelpString));
            labelName.Text = Res.Get(StringId.TagsProviderNameLabel);
            helpProviderCreateTag.SetHelpString(textBoxName, Res.Get(StringId.TagsProviderNameHelpString));
            label4.Text = Res.Get(StringId.TagsHtmlCaptionLabel);
            helpProviderCreateTag.SetHelpString(textBoxCaption,
                                                string.Format(CultureInfo.InvariantCulture, Res.Get(StringId.TagsHtmlCaptionHelpString), "{tag-group}"));
            label2.Text = Res.Get(StringId.TagsHtmlPreviewLabel);
            helpProviderCreateTag.SetHelpString(textBoxPreview, Res.Get(StringId.TagsHtmlPreviewHelpString));
            Text = Res.Get(StringId.TagsCreateNew);

            LayoutHelper.FixupOKCancel(buttonOk, buttonCancel);
            SinkEvents();
        }
Пример #22
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            LayoutHelper.FixupOKCancel(buttonSave, buttonCancel);
        }
 protected override void OnLoad(System.EventArgs e)
 {
     base.OnLoad(e);
     LayoutHelper.FixupOKCancel(btnSelect, btnCancel);
 }
Пример #24
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     LayoutHelper.FixupOKCancel(btnInsert, btnCancel);
 }
Пример #25
0
        protected override void OnLoad(EventArgs e)
        {
            Parent.Dock = DockStyle.Fill;

            Form form = FindForm();

            form.AcceptButton = buttonOK;
            form.CancelButton = buttonCancel;
            form.MinimumSize  = new Size(536, 320);
            form.ShowIcon     = false;
            //form.MaximizeBox = true;
            form.Closing += delegate
            {
                if (form.DialogResult == DialogResult.Cancel)
                {
                    originalState.Restore();
                    EditorContext.ApplyDecorator();
                }
                else
                {
                    // This forces the linked image to be updated as well
                    SaveSettingsAndApplyDecorator();
                }
            };

            base.OnLoad(e);

            if (EditorContext.EnforcedAspectRatio == null)
            {
                int width = cbAspectRatio.Left - lblAspectRatio.Right;

                DisplayHelper.AutoFitSystemLabel(lblAspectRatio, 0, int.MaxValue);

                DisplayHelper.AutoFitSystemCombo(cbAspectRatio, 0, int.MaxValue, false);
                buttonRotate.Width = buttonRotate.GetPreferredWidth();

                bool isButtonRotateVisible = buttonRotate.Visible;
                buttonRotate.Visible = true;
                LayoutHelper.DistributeHorizontally(width, lblAspectRatio, cbAspectRatio, buttonRotate);
                buttonRotate.Visible = isButtonRotateVisible;
                if (isButtonRotateVisible && (cbAspectRatio.Height + 2) > buttonRotate.Height)
                {
                    buttonRotate.Height = cbAspectRatio.Height + 2;
                }
            }
            else
            {
                lblAspectRatio.Visible       =
                    cbAspectRatio.Visible    =
                        buttonRotate.Visible = false;
            }

            DisplayHelper.AutoFitSystemCheckBox(chkGrid, 0, int.MaxValue);
            DisplayHelper.AutoFitSystemButton(btnRemoveCrop);
            LayoutHelper.FixupOKCancel(buttonOK, buttonCancel);
            chkGrid.Left = buttonCancel.Right - chkGrid.Width;

            panel1.Height        = Math.Max(buttonRotate.Bottom, cbAspectRatio.Bottom) + 3;
            imageCropControl.Top = panel1.Bottom;

            imageCropControl.Select();

            //int minWidth = buttonRotate.Right + width + (form.ClientSize.Width - buttonOK.Left) + SystemInformation.FrameBorderSize.Width * 2;
            //form.MinimumSize = new Size(minWidth, form.MinimumSize.Height);
        }