event.Skip();
}
-BEGIN_EVENT_TABLE(wxListCtrl, wxControl)
- EVT_LEFT_DOWN(wxListCtrl::OnLeftDown)
- EVT_LEFT_DCLICK(wxListCtrl::OnDblClick)
- EVT_MIDDLE_DOWN(wxListCtrl::OnMiddleDown)
- EVT_RIGHT_DOWN(wxListCtrl::OnRightDown)
- EVT_CHAR(wxListCtrl::OnChar)
-END_EVENT_TABLE()
-
// ============================================================================
// implementation
// ============================================================================
m_bgColor = wxNullColour;
m_textctrlWrapper = NULL;
m_current = -1;
- m_renameTimer = new wxListCtrlRenameTimer( this );
+ m_renameTimer = NULL;
}
class wxGenericListCtrlHook : public wxGenericListCtrl
(hitResult & wxLIST_HITTEST_ONITEMLABEL) &&
HasFlag(wxLC_EDIT_LABELS) )
{
- m_renameTimer->Start( 100, true );
+ if ( m_renameTimer )
+ m_renameTimer->Start( 250, true );
}
else
{
void wxListCtrl::OnDblClick(wxMouseEvent& event)
{
- if ( m_renameTimer->IsRunning() )
+ if ( m_renameTimer && m_renameTimer->IsRunning() )
m_renameTimer->Stop();
event.Skip();
}
else
{
- m_macIsUserPane = false;
+ m_macIsUserPane = false;
if ( !wxWindow::Create(parent, id, pos, size, style & ~(wxHSCROLL | wxVSCROLL), name) )
return false;
m_dbImpl = new wxMacDataBrowserListCtrlControl( this, pos, size, style );
InstallControlEventHandler( m_peer->GetControlRef() , GetwxMacListCtrlEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, this,
(EventHandlerRef *)&m_macListCtrlEventHandler);
+
+ m_renameTimer = new wxListCtrlRenameTimer( this );
+
+ Connect( wxID_ANY, wxEVT_CHAR, wxCharEventHandler(wxListCtrl::OnChar), NULL, this );
+ Connect( wxID_ANY, wxEVT_LEFT_DOWN, wxMouseEventHandler(wxListCtrl::OnLeftDown), NULL, this );
+ Connect( wxID_ANY, wxEVT_LEFT_DCLICK, wxMouseEventHandler(wxListCtrl::OnDblClick), NULL, this );
+ Connect( wxID_ANY, wxEVT_MIDDLE_DOWN, wxMouseEventHandler(wxListCtrl::OnMiddleDown), NULL, this );
+ Connect( wxID_ANY, wxEVT_RIGHT_DOWN, wxMouseEventHandler(wxListCtrl::OnRightDown), NULL, this );
}
return true;