X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/133506215101bd8cffbf81e6c36944f7d5e2f8db..703e3c42d11a74be69cc1dee560e2c0f359ac13f:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 34f232f3bd..45d61abdc8 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1839,58 +1839,6 @@ void wxGridWindow::OnFocus(wxFocusEvent& event) ///////////////////////////////////////////////////////////////////// -#if wxUSE_EXTENDED_RTTI -WX_DEFINE_FLAGS( wxGridStyle ) - -wxBEGIN_FLAGS( wxGridStyle ) - // new style border flags, we put them first to - // use them for streaming out - wxFLAGS_MEMBER(wxBORDER_SIMPLE) - wxFLAGS_MEMBER(wxBORDER_SUNKEN) - wxFLAGS_MEMBER(wxBORDER_DOUBLE) - wxFLAGS_MEMBER(wxBORDER_RAISED) - wxFLAGS_MEMBER(wxBORDER_STATIC) - wxFLAGS_MEMBER(wxBORDER_NONE) - - // old style border flags - wxFLAGS_MEMBER(wxSIMPLE_BORDER) - wxFLAGS_MEMBER(wxSUNKEN_BORDER) - wxFLAGS_MEMBER(wxDOUBLE_BORDER) - wxFLAGS_MEMBER(wxRAISED_BORDER) - wxFLAGS_MEMBER(wxSTATIC_BORDER) - wxFLAGS_MEMBER(wxBORDER) - - // standard window styles - wxFLAGS_MEMBER(wxTAB_TRAVERSAL) - wxFLAGS_MEMBER(wxCLIP_CHILDREN) - wxFLAGS_MEMBER(wxTRANSPARENT_WINDOW) - wxFLAGS_MEMBER(wxWANTS_CHARS) - wxFLAGS_MEMBER(wxFULL_REPAINT_ON_RESIZE) - wxFLAGS_MEMBER(wxALWAYS_SHOW_SB) - wxFLAGS_MEMBER(wxVSCROLL) - wxFLAGS_MEMBER(wxHSCROLL) - -wxEND_FLAGS( wxGridStyle ) - -IMPLEMENT_DYNAMIC_CLASS_XTI(wxGrid, wxScrolledWindow,"wx/grid.h") - -wxBEGIN_PROPERTIES_TABLE(wxGrid) - wxHIDE_PROPERTY( Children ) - wxPROPERTY_FLAGS( WindowStyle , wxGridStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , EMPTY_MACROVALUE, 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style -wxEND_PROPERTIES_TABLE() - -wxBEGIN_HANDLERS_TABLE(wxGrid) -wxEND_HANDLERS_TABLE() - -wxCONSTRUCTOR_5( wxGrid , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle ) - -/* - TODO : Expose more information of a list's layout, etc. via appropriate objects (e.g., NotebookPageInfo) -*/ -#else -IMPLEMENT_DYNAMIC_CLASS( wxGrid, wxScrolledWindow ) -#endif - BEGIN_EVENT_TABLE( wxGrid, wxScrolledWindow ) EVT_PAINT( wxGrid::OnPaint ) EVT_SIZE( wxGrid::OnSize ) @@ -4859,6 +4807,9 @@ void wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol, int bottomRow, int rightCol) { + MakeCellVisible(m_selectedBlockCorner); + m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol); + if ( m_selection ) { switch ( m_selection->GetSelectionMode() ) @@ -4895,9 +4846,6 @@ wxGrid::UpdateBlockBeingSelected(int topRow, int leftCol, } } - m_selectedBlockCorner = wxGridCellCoords(bottomRow, rightCol); - MakeCellVisible(m_selectedBlockCorner); - EnsureFirstLessThanSecond(topRow, bottomRow); EnsureFirstLessThanSecond(leftCol, rightCol); @@ -5892,8 +5840,8 @@ void wxGrid::EnableCellEditControl( bool enable ) bool wxGrid::IsCurrentCellReadOnly() const { - // const_cast - wxGridCellAttr* attr = ((wxGrid *)this)->GetCellAttr(m_currentCellCoords); + wxGridCellAttr* + attr = const_cast(this)->GetCellAttr(m_currentCellCoords); bool readonly = attr->IsReadOnly(); attr->DecRef(); @@ -6281,7 +6229,9 @@ int wxGrid::PosToEdgeOfLine(int pos, const wxGridOperations& oper) const else if ( line > 0 && pos - oper.GetLineStartPos(this, line) < WXGRID_LABEL_EDGE_ZONE ) - return line - 1; + { + return oper.GetLineBefore(this, line); + } } return -1; @@ -7259,11 +7209,18 @@ void wxGrid::ClearAttrCache() } } +void wxGrid::RefreshAttr(int row, int col) +{ + if ( m_attrCache.row == row && m_attrCache.col == col ) + ClearAttrCache(); +} + + void wxGrid::CacheAttr(int row, int col, wxGridCellAttr *attr) const { if ( attr != NULL ) { - wxGrid *self = (wxGrid *)this; // const_cast + wxGrid * const self = const_cast(this); self->ClearAttrCache(); self->m_attrCache.row = row; @@ -8157,7 +8114,7 @@ void wxGrid::AutoSizeColLabelSize( int col ) wxSize wxGrid::DoGetBestSize() const { - wxGrid *self = (wxGrid *)this; // const_cast + wxGrid * const self = const_cast(this); // we do the same as in AutoSize() here with the exception that we don't // change the column/row sizes, only calculate them