private void RefreshAlignment()
        {
            ToolStripItemAlignment property = (ToolStripItemAlignment)this.GetProperty("Alignment");

            this.leftToolStripMenuItem.Checked  = property == ToolStripItemAlignment.Left;
            this.rightToolStripMenuItem.Checked = property == ToolStripItemAlignment.Right;
        }
 private void LayoutUnknownItems(ToolStripItemAlignment alignment)
 {
     foreach (var item in _engine.GetAvailableUnknownItems())
     {
         if (item.Alignment == alignment)
         {
             LayoutItem(item, item.GetPreferredSize(_displayRectangle.Size), item is TabStripButtonBase);
         }
     }
 }
		protected ToolStripItem (string text, Image image, EventHandler onClick, string name)
		{
			this.alignment = ToolStripItemAlignment.Left;
			this.anchor = AnchorStyles.Left | AnchorStyles.Top;
			this.auto_size = true;
			this.auto_tool_tip = this.DefaultAutoToolTip;
			this.available = true;
			this.back_color = Color.Empty;
			this.background_image_layout = ImageLayout.Tile;
			this.can_select = true;
			this.display_style = this.DefaultDisplayStyle;
			this.dock = DockStyle.None;
			this.enabled = true;
			this.fore_color = Color.Empty;
			this.image = image;
			this.image_align = ContentAlignment.MiddleCenter;
			this.image_index = -1;
			this.image_key = string.Empty;
			this.image_scaling = ToolStripItemImageScaling.SizeToFit;
			this.image_transparent_color = Color.Empty;
			this.margin = this.DefaultMargin;
			this.merge_action = MergeAction.Append;
			this.merge_index = -1;
			this.name = name;
			this.overflow = ToolStripItemOverflow.AsNeeded;
			this.padding = this.DefaultPadding;
			this.placement = ToolStripItemPlacement.None;
			this.right_to_left = RightToLeft.Inherit;
			this.bounds.Size = this.DefaultSize;
			this.text = text;
			this.text_align = ContentAlignment.MiddleCenter;
			this.text_direction = DefaultTextDirection;
			this.text_image_relation = TextImageRelation.ImageBeforeText;
			this.visible = true;

			this.Click += onClick;
			OnLayout (new LayoutEventArgs (null, string.Empty));
		}
Example #4
0
 public ToolStripBuilderStyle(ToolStripItemDisplayStyle toolStripItemDisplayStyle, ToolStripItemAlignment toolStripItemAlignment, TextImageRelation textImageRelation)
 {
     _toolStripItemAlignment = toolStripItemAlignment;
     _toolStripItemDisplayStyle = toolStripItemDisplayStyle;
     _textImageRelation = textImageRelation;
 }
 public ToolStripBuilderStyle(ToolStripItemDisplayStyle toolStripItemDisplayStyle, ToolStripItemAlignment toolStripItemAlignment, TextImageRelation textImageRelation)
 {
     _toolStripItemAlignment    = toolStripItemAlignment;
     _toolStripItemDisplayStyle = toolStripItemDisplayStyle;
     _textImageRelation         = textImageRelation;
 }
Example #6
0
        protected virtual void AgregarOpcionesToolStrip(Image image, string name, string text, EventHandler onClick, ToolStripItemAlignment alignment)
        {
            ToolStripButton toolStripButton = new ToolStripButton();

            toolStripButton.Image     = image;
            toolStripButton.Name      = name;
            toolStripButton.Text      = text;
            toolStripButton.Alignment = alignment;
            toolStripButton.Click    += new EventHandler(onClick);
            this._toolStrip.Items.Add(toolStripButton);
            _botones[name] = toolStripButton;
        }
Example #7
0
        private ToolStripButton CreateToolStripButton(string text, string toolTiptext, Padding padding, bool checkOnClick, ToolStripItemAlignment alignment, EventHandler eventHandler)
        {
            ToolStripButton button = new ToolStripButton();

            button.Text         = text;
            button.AutoToolTip  = false;
            button.ToolTipText  = toolTiptext;
            button.Margin       = padding;
            button.CheckOnClick = checkOnClick;
            button.Alignment    = alignment;
            button.Click       += eventHandler;

            return(button);
        }
Example #8
0
 public static CheckBox ToolStripAddCheckBox(ToolStrip ts, string chbText, bool check, EventHandler handler, ToolStripItemAlignment align = ToolStripItemAlignment.Right)
 {
     CheckBox chb = new CheckBox();
     chb.Text = chbText;
     chb.Checked = check;
     chb.CheckStateChanged += handler;
     ToolStripControlHost host = new ToolStripControlHost(chb);
     host.Alignment = align;
     ts.Items.Add(host);
     return chb;
 }
Example #9
0
 public IStatusBarSlider CreateStatusBarSlider(string text, Image image, ToolStripItemAlignment alignment)
 {
     return(_appForm.CreateStatusBarSlider(text, image, alignment));
 }