wxDataViewCtrl::~wxDataViewCtrl()
{
  ClearColumns();

  // Ensure that the already destructed controls is not notified about changes
  // in the model any more.
  if (m_ModelNotifier != NULL)
    m_ModelNotifier->GetOwner()->RemoveNotifier(m_ModelNotifier);
}
Exemple #2
0
void
THDContentGrid::Refresh()
{
    // Update the table to account for current index state.

    BeginBatch();

    // Give wxGrid ownership over the pointer, so it's destroyed at the proper time.
    table = new THDContentTable(model);
    ClearColumns();

    SetTable(table, true);
    SetRowLabelSize(0);
    SetColLabelSize(0);

    EnableEditing(false);
    EnableDragRowSize(false);
    EnableDragColSize(false);

    if (GetNumberRows() > 0) {
        // Scroll by entire rows
        int rowSize = GetRowSize(0);
        if (rowSize > 0)
            SetScrollLineY(rowSize);

        // Size all columns
        for (int col = 0; col < table->columns.size(); col++) {
            THDContentColumn &colObj = table->columns[col];
            
            wxClientDC dc(GetParent());
            int width = colObj.visualizer->GetWidth(dc);

            SetColMinimalWidth(col, width);
            SetColSize(col, width);
        }
    }

    EndBatch();
}
wxDataViewCtrl::~wxDataViewCtrl()
{
  ClearColumns();
}