added wxListBox::HitTest() from Ryan (patch 1446207)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
		@@ -124,6 +124,7 @@ protected:
 | 
			
		||||
 | 
			
		||||
    void OnListbox(wxCommandEvent& event);
 | 
			
		||||
    void OnListboxDClick(wxCommandEvent& event);
 | 
			
		||||
    void OnListboxRDown(wxMouseEvent& event);
 | 
			
		||||
 | 
			
		||||
    void OnCheckOrRadioBox(wxCommandEvent& event);
 | 
			
		||||
 | 
			
		||||
@@ -487,6 +488,9 @@ LboxTestFrame::LboxTestFrame(const wxString& title)
 | 
			
		||||
    m_logTarget = new LboxLogger(m_lboxLog, wxLog::GetActiveTarget());
 | 
			
		||||
    wxLog::SetActiveTarget(m_logTarget);
 | 
			
		||||
#endif // wxUSE_LOG
 | 
			
		||||
 | 
			
		||||
    m_lbox->Connect(wxEVT_RIGHT_DOWN, 
 | 
			
		||||
        wxMouseEventHandler(LboxTestFrame::OnListboxRDown), NULL, this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
LboxTestFrame::~LboxTestFrame()
 | 
			
		||||
@@ -699,6 +703,18 @@ void LboxTestFrame::OnListboxDClick(wxCommandEvent& event)
 | 
			
		||||
    wxLogMessage(_T("Listbox item %d double clicked"), sel);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LboxTestFrame::OnListboxRDown(wxMouseEvent& event)
 | 
			
		||||
{
 | 
			
		||||
    int item = m_lbox->HitTest(event.GetPosition());
 | 
			
		||||
 | 
			
		||||
    if ( item != wxNOT_FOUND )
 | 
			
		||||
        wxLogMessage(_T("Listbox item %d right clicked"), item);
 | 
			
		||||
    else
 | 
			
		||||
        wxLogMessage(_T("Listbox right clicked but no item clicked upon"));
 | 
			
		||||
 | 
			
		||||
    event.Skip();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void LboxTestFrame::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
 | 
			
		||||
{
 | 
			
		||||
    m_dirty = true;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user