sparco
sparco

Reputation: 85

How to call wxGrid's Render function - sequentially to achieve pagination?

Pagination can be accomplished by using sequential Render() calls from http://docs.wxwidgets.org/trunk/classwx_grid.html

I understand How - sequential pages can be got from top left and bottom right coordinates. But I dont get what needs to be the wxDC in the Render() call . ? I want to get the first three rows in the grid

BigGridFrame::BigGridFrame(long sizeGrid)
            : wxFrame(NULL, wxID_ANY, wxT("Plugin Virtual Table"),
                    wxDefaultPosition, wxSize(500, 450))
{
    m_grid = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
    m_table = new BigGridTable(sizeGrid);
    m_grid->SetTable(m_table, true);

    //The above code gave me the table
    //trying to get first three rows by render() function but it still gets the all of the grid values 
    **const wxGridCellCoords topLeft(0, 0);
    const wxGridCellCoords bottomRight(3,4 );
    wxClientDC  clientDC(this);  //this place I am not sure.. I couldnt find documentation
    //m_grid->SelectBlock(topLeft, bottomRight, false);
    m_grid->Render(clientDC, wxDefaultPosition, wxDefaultSize, topLeft, bottomRight, wxEXPAND);**

}

Upvotes: 0

Views: 143

Answers (2)

sparco
sparco

Reputation: 85

I misunderstood Render() function .

For pagination, I used the same logic used in Changing Size of Grid when grid data is changed

Upvotes: 0

VZ.
VZ.

Reputation: 22678

The DC is whatever you want to render the grid on, typically a wxMemoryDC to save the grid as a bitmap. This can't be used to partially render the grid on screen, which you appear to want to do, because it's just a static snapshot of the control.

I also have really no idea how can the code using this->Render() above compile considering that this is a wxFrame* and not a wxGrid*.

Upvotes: 1

Related Questions