Recently I've been getting back into C++, as well as wxWidgets. I'm currently trying to write a variation on the wxGrid component, in particular attempting to change the way it draws the divider lines through the cells. I noticed in the documentation that it was mentioned to override "GetRowGridLinePen" and return the pen desired to draw out the grid lines. Below is a sampling of what I'm attempting to do.
Code: Select all
MainApp::MainApp(const wxString &title) : wxFrame(NULL, wxID_ANY, title)
{
GridComponent *gridCompOne = new GridComponent(this, wxID_ANY, wxDefaultPosition, wxSide(400, 400));
}
Code: Select all
GridComponent::GridComponent(wxWindow *parent, wxWindowID id, const wxPoint &gridPos, const wxSize &gridSize) : wxGrid(parent, wxID_ANY, gridPos, gridSize)
{
wxGrid *gridInstance = new wxGrid(parent, wxID_ANY, gridPos, gridSize);
gridInstance -> CreateGrid(numRows, 3, wxGridSelectCells);
}
wxPen GridComponent::GetRowGridLinePen()
{
return wxPen(*wxBLACK, 1, wxPENSTYLE_SHORT_DASH);
}
Thanks