예제 #1
0
        private void DrawCell(TreePath path, GridViewColumn col,
                              Rectangle clip)
        {
            Widget w;

            Rectangle rect = CellRect(path, col, out w);

            if (!clip.Intersect(rect, out clip))
            {
                return;
            }

            CellRendererState crs = 0;

            if (w != fda)
            {
                w.GdkWindow.DrawRectangle(w.Style.MidGC(w.State), true,
                                          rect);
            }
            else
            {
                TreePath       spath;
                GridViewColumn scol;
                selection.GetSelected(out spath, out scol);

                if (spath != null && path.Compare(spath) == 0 && col == scol)
                {
                    crs = CellRendererState.Selected;
                    Style.PaintFlatBox(w.Style, w.GdkWindow,
                                       StateType.Selected, ShadowType.None,
                                       clip, this, "cell_odd", rect.X, rect.Y,
                                       rect.Width, rect.Height);
                }
            }

            w.GdkWindow.DrawLine(w.Style.BackgroundGC(w.State),
                                 rect.X, rect.Bottom - 1,
                                 rect.Right, rect.Bottom - 1);
            w.GdkWindow.DrawLine(w.Style.BackgroundGC(w.State),
                                 rect.Right - 1, rect.Y,
                                 rect.Right - 1, rect.Bottom);

            TreeIter     i;
            bool         header   = path.Indices[0] < c_span;
            CellRenderer renderer = header && col.HeaderRenderer != null ?
                                    col.HeaderRenderer : col.FieldRenderer;

            model.GetIter(out i, path);
            col.CellSetCellData(model, i, header);
            renderer.Render(w.GdkWindow, this, rect, rect, clip, crs);
        }
예제 #2
0
 public void SetUp(Cell cell)
 {
     _inputController.SetCell(cell);
     _highlightController.SetCell(cell);
     _renderer.Render(cell != null);
 }