protected virtual void RaiseSaveButtonClick(MyGridView gv)
        {
            SaveButtonHandler handler = Events[saveButtonClick] as SaveButtonHandler;

            if (handler != null)
            {
                handler(this, gv);
            }
        }
        protected override void OnMouseDown(MouseEventArgs ev)
        {
            base.OnMouseDown(ev);

            BaseView gv = GetViewAt(ev.Location);

            if (gv != null)
            {
                MyGridView gView = null;
                if ((gv as MyGridView).IsSaveButtonHit(ev, out gView))
                {
                    RaiseSaveButtonClick(gView);
                }
            }
        }
Ejemplo n.º 3
0
        internal bool IsSaveButtonHit(MouseEventArgs ev, out MyGridView gridView)
        {
            gridView = null;
            bool result = false;

            if (IsDetailView)
            {
                if (HitMouseSaveButton(ev.Location))
                {
                    gridView = this;
                    result   = true;
                }
            }

            return(result);
        }
Ejemplo n.º 4
0
        protected virtual void CalcButtonInfo()
        {
            MyGridView gv = View as MyGridView;

            if (gv.SaveButton != null)
            {
                int rowsCount = RowsLoadInfo.ResultRows.Count;
                if (RowsInfo.Count > 0 && RowsInfo.Count == rowsCount &&
                    (RowsInfo[RowsInfo.Count - 1].Bounds.Bottom) < ViewRects.Rows.Bottom)
                {
                    GridRowInfo gri = RowsInfo[RowsInfo.Count - 1];
                    if (buttonInfo == null)
                    {
                        buttonInfo = new EditorButtonObjectInfoArgs(gv.SaveButton, gv.SaveButton.Appearance);
                    }
                    buttonInfo.Bounds = new Rectangle(gri.Bounds.X + 2, gri.Bounds.Bottom + 2, 40, 18);
                    return;
                }
            }

            buttonInfo = null;
        }