internal void RequestNewHeight(HeaderLabel header, int height)
        {
            int offset = height - header.Height;

            try
            {
                // This is a workaround for a RTB issue that causes their
                // algorithm to ---- up if OnContentsResize recurses.  (Now
                // that HeaderLabel does not resize the text untill after
                // autoscaling, we do not seem to hit this, but just in case).
                //
                // On the first call the RTB guesses its best dimensions
                // for the given text.  We correct the Width which may cause
                // a second recursive call to adjust the height.

                if (_recursionCount < 2)
                {
                    _recursionCount++;
                    header.Height = height;

                    //
                    foreach (Control child in Controls)
                    {
                        if (child.Top > header.Top)
                        {
                            child.Top += offset;
                        }
                    }

                    for (
                        Control controlIterator = this;
                        controlIterator != null;
                        controlIterator = controlIterator.Parent
                        )
                    {
                        controlIterator.Height += offset;
                    }
                }
                else
                {
                    Debug.Assert(offset == 0,
                                 "On 3rd recursive call offset is not yet stabalized."
                                 );
                }
            }
            finally
            {
                _recursionCount = 0;
            }
        }
Exemplo n.º 2
0
        internal void RequestNewHeight(HeaderLabel header, int height)
        {
            int offset = height - header.Height;
 
            try
            {
                // This is a workaround for a RTB issue that causes their
                // algorithm to ---- up if OnContentsResize recurses.  (Now
                // that HeaderLabel does not resize the text untill after
                // autoscaling, we do not seem to hit this, but just in case).
                // 
                // On the first call the RTB guesses its best dimensions
                // for the given text.  We correct the Width which may cause
                // a second recursive call to adjust the height.

                if(_recursionCount < 2)
                {
                    _recursionCount++;
                    header.Height = height;
                    
                    // 
                    foreach(Control child in Controls)
                    {
                        if(child.Top > header.Top)
                        {
                            child.Top += offset;
                        }
                    }

                    for(
                        Control controlIterator = this;
                        controlIterator != null;
                        controlIterator = controlIterator.Parent
                    ) {
                        controlIterator.Height += offset;
                    }
                }
                else
                {
                    Debug.Assert(offset == 0,
                        "On 3rd recursive call offset is not yet stabalized."
                    );
                }
            }
            finally
            {
                _recursionCount = 0;
            }
        }
        void IDeviceSpecificDesigner.InitHeader(int mergingContext)
        {
            HeaderPanel panel = new HeaderPanel();
            HeaderLabel lblDescription = new HeaderLabel();

            lblDescription.TabIndex = 0;
            lblDescription.Text = SR.GetString(SR.MobileControl_SettingGenericChoiceDescription);
            
            panel.Height = lblDescription.Height;
            panel.Width = lblDescription.Width;
            panel.Controls.Add(lblDescription);
            _header = panel;
        }
        private void InitializeComponent()
        {
            this._pnlHeader = new HeaderPanel();
            this._lblHeader = new HeaderLabel();
            this._glAttributes = new GroupLabel();
            this._glType = new GroupLabel();
            this._txtType = new System.Windows.Forms.TextBox();
            this._pnlMain = new System.Windows.Forms.Panel();
            this._filterList = new EditableTreeList();
            this._rbCompare = new System.Windows.Forms.RadioButton();
            this._lblCompare = new System.Windows.Forms.Label();
            this._dialogButtons = new DefaultDialogButtons();
            this._lblType = new System.Windows.Forms.Label();
            this._txtMethod = new System.Windows.Forms.TextBox();
            this._txtArgument = new System.Windows.Forms.TextBox();
            this._pnlRight = new System.Windows.Forms.Panel();
            this._lblMethod = new System.Windows.Forms.Label();
            this._rbDelegate = new System.Windows.Forms.RadioButton();
            this._pnlCompare = new System.Windows.Forms.Panel();
            this._cbCompare = new System.Windows.Forms.ComboBox();
            this._lblArgument = new System.Windows.Forms.Label();
            this._pnlDelegate = new System.Windows.Forms.Panel();
            this._txtType.Location = new System.Drawing.Point(0, 20);
            this._txtType.Size = new System.Drawing.Size(211, 20);

            this._lblHeader.Location = new System.Drawing.Point(0, 0);
            this._lblHeader.Size = new System.Drawing.Size(434, 16);
            this._lblHeader.Anchor = (System.Windows.Forms.AnchorStyles.Top
                | System.Windows.Forms.AnchorStyles.Left);
            this._pnlHeader.Controls.AddRange(new System.Windows.Forms.Control[] {
                this._lblHeader
            });
            this._pnlHeader.Location = new System.Drawing.Point(6, 5);
            this._pnlHeader.Size = new System.Drawing.Size(434, 16);
            this._pnlHeader.Anchor = (System.Windows.Forms.AnchorStyles.Top
                | System.Windows.Forms.AnchorStyles.Left);
            this._pnlMain.Controls.AddRange(new System.Windows.Forms.Control[] {this._dialogButtons,
                                                                                  this._pnlRight,
                                                                                  this._filterList});
            this._pnlMain.Location = new System.Drawing.Point(6, 27);
            this._pnlMain.Size = new System.Drawing.Size(434, 253);
            this._pnlMain.Anchor = (System.Windows.Forms.AnchorStyles.Bottom
                | System.Windows.Forms.AnchorStyles.Left);
            this._filterList.Size = new System.Drawing.Size(198, 224);
            this._filterList.Location = new System.Drawing.Point(0, 0);
            this._rbCompare.Location = new System.Drawing.Point(8, 21);
            this._rbCompare.Size = new System.Drawing.Size(211, 17);
            this._lblCompare.Location = new System.Drawing.Point(0, 4);
            this._lblCompare.Size = new System.Drawing.Size(211, 16);
            this._dialogButtons.Location = new System.Drawing.Point(197, 230);
            this._dialogButtons.Size = new System.Drawing.Size(237, 23);
            this._lblType.Location = new System.Drawing.Point(0, 4);
            this._lblType.Size = new System.Drawing.Size(211, 16);
            this._txtMethod.Location = new System.Drawing.Point(0, 64);
            this._txtMethod.Size = new System.Drawing.Size(211, 20);
            this._txtArgument.Location = new System.Drawing.Point(0, 64);
            this._txtArgument.Size = new System.Drawing.Size(211, 20);
            this._pnlRight.Controls.AddRange(new System.Windows.Forms.Control[] {this._pnlCompare,
                                                                                 this._pnlDelegate,
                                                                                 this._glAttributes,
                                                                                 this._glType,
                                                                                 this._rbDelegate,
                                                                                 this._rbCompare});
            this._pnlRight.Location = new System.Drawing.Point(215, 0);
            this._pnlRight.Size = new System.Drawing.Size(219, 226);
            this._lblMethod.Location = new System.Drawing.Point(0, 48);
            this._lblMethod.Size = new System.Drawing.Size(211, 16);
            this._glAttributes.Location = new System.Drawing.Point(0, 73);
            this._glAttributes.Size = new System.Drawing.Size(216, 16);
            this._rbDelegate.Location = new System.Drawing.Point(8, 46);
            this._rbDelegate.Size = new System.Drawing.Size(211, 17);
            this._glType.Size = new System.Drawing.Size(216, 16);
            this._pnlCompare.Controls.AddRange(new System.Windows.Forms.Control[] {this._txtArgument,
                                                                                     this._lblArgument,
                                                                                     this._cbCompare,
                                                                                     this._lblCompare});
            this._pnlCompare.Location = new System.Drawing.Point(8, 90);
            this._pnlCompare.Size = new System.Drawing.Size(211, 136);
            this._cbCompare.DropDownWidth = 211;
            this._cbCompare.Location = new System.Drawing.Point(0, 20);
            this._cbCompare.Size = new System.Drawing.Size(211, 21);
            this._cbCompare.Sorted = true;
            this._lblArgument.Location = new System.Drawing.Point(0, 48);
            this._lblArgument.Size = new System.Drawing.Size(211, 16);
            this._pnlDelegate.Controls.AddRange(new System.Windows.Forms.Control[] {this._txtType,
                                                                                      this._txtMethod,
                                                                                      this._lblMethod,
                                                                                      this._lblType});
            this._pnlDelegate.Location = new System.Drawing.Point(8, 90);
            this._pnlDelegate.Size = new System.Drawing.Size(211, 136);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.ClientSize = new System.Drawing.Size(448, 289);
            this.AcceptButton = _dialogButtons.CmdOK;
            this.CancelButton = _dialogButtons.CmdCancel;
            this.Controls.AddRange(new System.Windows.Forms.Control[] {this._pnlHeader, this._pnlMain});
        }
        void IDeviceSpecificDesigner.InitHeader(int mergingContext)
        {
            HeaderPanel panel = new HeaderPanel();
            HeaderLabel lblDescription = new HeaderLabel();

            lblDescription.TabIndex = 0;
            lblDescription.Height = 24;
            lblDescription.Width = 204;
            panel.Height = 28;
            panel.Width = 204;
            panel.Controls.Add(lblDescription);

            switch (mergingContext)
            {
                case MobileControlDesigner.MergingContextTemplates:
                {
                    lblDescription.Text = SR.GetString(SR.TemplateableDesigner_SettingTemplatingChoiceDescription);
                    break;
                }

                default:
                {
                    lblDescription.Text = SR.GetString(SR.TemplateableDesigner_SettingGenericChoiceDescription);
                    break;
                }
            }

            _header = panel;
        }
            internal MergedUI()
            {
                this.LblStyles = new System.Windows.Forms.Label();
                this.CbStyles = new System.Windows.Forms.ComboBox();
                this.BtnEdit = new System.Windows.Forms.Button();
                this.LblHeader = new HeaderLabel();
//                this.LblStyles.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
//                    | System.Windows.Forms.AnchorStyles.Right);
                this.LblStyles.Location = new System.Drawing.Point(0, 24);
                this.LblStyles.Size = new System.Drawing.Size(160, 16);
//                this.CbStyles.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
//                    | System.Windows.Forms.AnchorStyles.Right);
                this.CbStyles.DropDownWidth = 124;
                this.CbStyles.Location = new System.Drawing.Point(0, 40);
                this.CbStyles.Size = new System.Drawing.Size(160, 21);
//                this.BtnEdit.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
                this.BtnEdit.Location = new System.Drawing.Point(164, 39);
                this.BtnEdit.Size = new System.Drawing.Size(75, 23);
                this.LblHeader.Location = new System.Drawing.Point(0, 0);
                this.LblHeader.Size = new System.Drawing.Size(240, 16);
                this.Controls.AddRange(new System.Windows.Forms.Control[] {this.CbStyles,
                                                                           this.LblStyles,
                                                                           this.BtnEdit,
                                                                           this.LblHeader});
                this.Size = new System.Drawing.Size(240, 70);
                this.Location = new System.Drawing.Point(5,6);
            }