Use wxDynamicCast() instead of IsKindOf() checks.
This commit is contained in:
@@ -353,7 +353,7 @@ void wxPGTextCtrlEditor::DrawValue( wxDC& dc, wxPGProperty* property, const wxRe
|
|||||||
// Code below should no longer be needed, as the obfuscation
|
// Code below should no longer be needed, as the obfuscation
|
||||||
// is now done in GetValueAsString.
|
// is now done in GetValueAsString.
|
||||||
/*if ( property->HasFlag(wxPG_PROP_PASSWORD) &&
|
/*if ( property->HasFlag(wxPG_PROP_PASSWORD) &&
|
||||||
property->IsKindOf(WX_PG_CLASSINFO(wxStringProperty)) )
|
wxDynamicCast(property, wxStringProperty) )
|
||||||
{
|
{
|
||||||
size_t a = drawStr.length();
|
size_t a = drawStr.length();
|
||||||
drawStr.Empty();
|
drawStr.Empty();
|
||||||
|
@@ -345,18 +345,16 @@ private:
|
|||||||
|
|
||||||
virtual bool ProcessEvent( wxEvent& event ) wxOVERRIDE
|
virtual bool ProcessEvent( wxEvent& event ) wxOVERRIDE
|
||||||
{
|
{
|
||||||
if ( event.IsKindOf(wxCLASSINFO(wxHeaderCtrlEvent)) )
|
wxHeaderCtrlEvent* hcEvent = wxDynamicCast(&event, wxHeaderCtrlEvent);
|
||||||
|
if ( hcEvent )
|
||||||
{
|
{
|
||||||
wxHeaderCtrlEvent& hcEvent =
|
|
||||||
static_cast<wxHeaderCtrlEvent&>(event);
|
|
||||||
|
|
||||||
wxPropertyGrid* pg = m_manager->GetGrid();
|
wxPropertyGrid* pg = m_manager->GetGrid();
|
||||||
int col = hcEvent.GetColumn();
|
int col = hcEvent->GetColumn();
|
||||||
wxEventType evtType = event.GetEventType();
|
wxEventType evtType = event.GetEventType();
|
||||||
|
|
||||||
if ( evtType == wxEVT_HEADER_RESIZING )
|
if ( evtType == wxEVT_HEADER_RESIZING )
|
||||||
{
|
{
|
||||||
int colWidth = hcEvent.GetWidth();
|
int colWidth = hcEvent->GetWidth();
|
||||||
|
|
||||||
OnSetColumnWidth(col, colWidth);
|
OnSetColumnWidth(col, colWidth);
|
||||||
|
|
||||||
@@ -370,12 +368,12 @@ private:
|
|||||||
{
|
{
|
||||||
// Never allow column resize if layout is static
|
// Never allow column resize if layout is static
|
||||||
if ( m_manager->HasFlag(wxPG_STATIC_SPLITTER) )
|
if ( m_manager->HasFlag(wxPG_STATIC_SPLITTER) )
|
||||||
hcEvent.Veto();
|
hcEvent->Veto();
|
||||||
// Allow application to veto dragging
|
// Allow application to veto dragging
|
||||||
else if ( pg->SendEvent(wxEVT_PG_COL_BEGIN_DRAG,
|
else if ( pg->SendEvent(wxEVT_PG_COL_BEGIN_DRAG,
|
||||||
NULL, NULL, 0,
|
NULL, NULL, 0,
|
||||||
(unsigned int)col) )
|
(unsigned int)col) )
|
||||||
hcEvent.Veto();
|
hcEvent->Veto();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -504,7 +504,7 @@ void wxPGProperty::InitAfterAdded( wxPropertyGridPageState* pageState,
|
|||||||
// (so propgrid can be NULL, too).
|
// (so propgrid can be NULL, too).
|
||||||
|
|
||||||
wxPGProperty* parent = m_parent;
|
wxPGProperty* parent = m_parent;
|
||||||
bool parentIsRoot = parent->IsKindOf(wxCLASSINFO(wxPGRootProperty));
|
bool parentIsRoot = wxDynamicCast(parent, wxPGRootProperty) != NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Convert invalid cells to default ones in this grid
|
// Convert invalid cells to default ones in this grid
|
||||||
|
Reference in New Issue
Block a user