void CalcButtonsBoundsCore(EditorButtonObjectCollection collection)
 {
     for (int n = collection.Count - 1; n >= 0; n--)
     {
         EditorButtonObjectInfoArgs button = collection[n];
         button.Bounds = CalcButtonsBounds(button.Bounds);
     }
 }
Example #2
0
        public virtual int GetButtonsWidth(EditorButtonObjectCollection collection)
        {
            int width = 0;

            foreach (EditorButtonObjectInfoArgs btn in collection)
            {
                width += GetButtonWidth(btn.Bounds);
            }
            return(width);
        }
 public CustomCalc(EditorButtonObjectCollection leftButtons, EditorButtonObjectCollection rightButtons, Rectangle clientRect)
 {
     ClearAutoWidthInfo();
     this.UseAutoFit   = false;
     this.LeftButtons  = leftButtons;
     this.RightButtons = rightButtons;
     this.ClientRect   = clientRect;
     this.IsLeft       = false;
     this.StopCalc     = false;
     this.NeedRecalc   = false;
     this.ViewInfo     = null;
 }
 protected override void CalcButtonRectsCore(EditorButtonObjectCollection collection)
 {
     for (int n = collection.Count - 1; n >= 0; n--)
     {
         EditorButtonObjectInfoArgs info = collection[n];
         ObjectPainter painter           = ViewInfo.GetButtonPainter(info);
         Rectangle     buttonRect        = painter.CalcObjectMinBounds(info);
         buttonRect.Width += 10;
         buttonRect        = new Rectangle(this.ClientRect.X, this.ClientRect.Y, buttonRect.Width, this.ClientRect.Height);
         Rectangle realButtonRect = buttonRect;
         info.Bounds = realButtonRect;
         painter.CalcObjectBounds(info);
         this.ClientRect.Width -= buttonRect.Width;
         if (this.IsLeft)
         {
             this.ClientRect.X += buttonRect.Width;
         }
     }
 }
Example #5
0
        void DrawButtons(GraphicsCache cache, EditorButtonObjectCollection collection)
        {
            CustomGridControlView view = viewInfo.View as CustomGridControlView;

            foreach (EditorButtonObjectInfoArgs button in collection)
            {
                if (view.CustomFilterPanelButtons.IndexOf(button.Button) < viewInfo.CustomButtonsCountToDraw)
                {
                    if (button.Cache == null)
                    {
                        button.Cache = cache;
                    }
                    EditorButtonHelper.GetPainter(BorderStyles.Default).DrawObject(button);
                }
                else
                {
                    break;
                }
            }
        }
 private void UpdateButtonCollection(object view, RowCellCustomDrawEventArgs e, EditorButtonObjectCollection buttonCollection, ExtendedButtonEditViewInfo viewInfo)
 {
     foreach (EditorButtonObjectInfoArgs args in buttonCollection)
     {
         viewInfo.CustomButtonCaptions[args.Button] = GetButtonCaption(view as GridView, e.RowHandle, e.Column, args.Button);
     }
 }
Example #7
0
 public void ClearButtons()
 {
     leftButtons  = null;
     rightButtons = null;
 }