EVT_MENU( ID_TOGGLEROWSIZING, GridFrame::ToggleRowSizing )
EVT_MENU( ID_TOGGLECOLSIZING, GridFrame::ToggleColSizing )
EVT_MENU( ID_TOGGLEGRIDSIZING, GridFrame::ToggleGridSizing )
+ EVT_MENU( ID_TOGGLEGRIDDRAGCELL, GridFrame::ToggleGridDragCell )
EVT_MENU( ID_TOGGLEGRIDLINES, GridFrame::ToggleGridLines )
EVT_MENU( ID_AUTOSIZECOLS, GridFrame::AutoSizeCols )
EVT_MENU( ID_CELLOVERFLOW, GridFrame::CellOverflow )
EVT_GRID_SELECT_CELL( GridFrame::OnSelectCell )
EVT_GRID_RANGE_SELECT( GridFrame::OnRangeSelected )
EVT_GRID_CELL_CHANGE( GridFrame::OnCellValueChanged )
+ EVT_GRID_CELL_BEGIN_DRAG( GridFrame::OnCellBeginDrag )
EVT_GRID_EDITOR_SHOWN( GridFrame::OnEditorShown )
EVT_GRID_EDITOR_HIDDEN( GridFrame::OnEditorHidden )
viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK );
+ viewMenu->Append( ID_TOGGLEGRIDDRAGCELL, _T("&Grid drag-cell"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") );
viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") );
wxTE_MULTILINE );
logger = new wxLogTextCtrl( logWin );
- m_logOld = logger->SetActiveTarget( logger );
- logger->SetTimestamp( NULL );
+ m_logOld = wxLog::SetActiveTarget( logger );
+ wxLog::SetTimestamp( NULL );
#endif // wxUSE_LOG
// this will create a grid and, by default, an associated grid
wxEXPAND );
#endif // wxUSE_LOG
+ SetAutoLayout(true);
SetSizer( topSizer );
topSizer->Fit( this );
GetMenuBar()->Check( ID_TOGGLEROWSIZING, true );
GetMenuBar()->Check( ID_TOGGLECOLSIZING, true );
GetMenuBar()->Check( ID_TOGGLEGRIDSIZING, true );
+ GetMenuBar()->Check( ID_TOGGLEGRIDDRAGCELL, false );
GetMenuBar()->Check( ID_TOGGLEGRIDLINES, true );
GetMenuBar()->Check( ID_CELLOVERFLOW, true );
}
GetMenuBar()->IsChecked( ID_TOGGLEGRIDSIZING ) );
}
+void GridFrame::ToggleGridDragCell( wxCommandEvent& WXUNUSED(ev) )
+{
+ grid->EnableDragCell(
+ GetMenuBar()->IsChecked( ID_TOGGLEGRIDDRAGCELL ) );
+}
void GridFrame::ToggleGridLines( wxCommandEvent& WXUNUSED(ev) )
{
{
// Check the new Refresh function by passing it a rectangle
// which exactly fits the grid.
- wxRect r(wxPoint(0, 0), grid->GetSize());
+ wxPoint pt(0, 0);
+ wxRect r(pt, grid->GetSize());
grid->SetDefaultCellBackgroundColour(col);
grid->Refresh(true, &r);
}
ev.Skip();
}
+void GridFrame::OnCellBeginDrag( wxGridEvent& ev )
+{
+ logBuf = _T("");
+ logBuf << _T("Got request to drag cell at")
+ << _T(" row ") << ev.GetRow()
+ << _T(" col ") << ev.GetCol();
+
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
+
+ ev.Skip();
+}
+
void GridFrame::OnEditorShown( wxGridEvent& ev )
{
return headers[col];
}
-BugsGridTable::BugsGridTable()
-{
-}
-
// ----------------------------------------------------------------------------
// BugsGridFrame
// ----------------------------------------------------------------------------