Fixed #11212 [RichText sample] Assert/Crash when Styles combo box opened
Patch by Catalin git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -753,7 +753,7 @@ void wxRichTextStyleListBox::OnLeftDown(wxMouseEvent& event)
|
|||||||
{
|
{
|
||||||
wxVListBox::OnLeftDown(event);
|
wxVListBox::OnLeftDown(event);
|
||||||
|
|
||||||
int item = HitTest(event.GetPosition());
|
int item = VirtualHitTest(event.GetPosition().y);
|
||||||
if (item != wxNOT_FOUND && GetApplyOnSelection())
|
if (item != wxNOT_FOUND && GetApplyOnSelection())
|
||||||
ApplyStyle(item);
|
ApplyStyle(item);
|
||||||
}
|
}
|
||||||
@@ -762,7 +762,7 @@ void wxRichTextStyleListBox::OnLeftDoubleClick(wxMouseEvent& event)
|
|||||||
{
|
{
|
||||||
wxVListBox::OnLeftDown(event);
|
wxVListBox::OnLeftDown(event);
|
||||||
|
|
||||||
int item = HitTest(event.GetPosition());
|
int item = VirtualHitTest(event.GetPosition().y);
|
||||||
if (item != wxNOT_FOUND && !GetApplyOnSelection())
|
if (item != wxNOT_FOUND && !GetApplyOnSelection())
|
||||||
ApplyStyle(item);
|
ApplyStyle(item);
|
||||||
}
|
}
|
||||||
@@ -1099,7 +1099,7 @@ void wxRichTextStyleComboPopup::OnMouseMove(wxMouseEvent& event)
|
|||||||
{
|
{
|
||||||
// Move selection to cursor if it is inside the popup
|
// Move selection to cursor if it is inside the popup
|
||||||
|
|
||||||
int itemHere = wxRichTextStyleListBox::HitTest(event.GetPosition());
|
int itemHere = wxRichTextStyleListBox::VirtualHitTest(event.GetPosition().y);
|
||||||
if ( itemHere >= 0 )
|
if ( itemHere >= 0 )
|
||||||
{
|
{
|
||||||
wxRichTextStyleListBox::SetSelection(itemHere);
|
wxRichTextStyleListBox::SetSelection(itemHere);
|
||||||
|
Reference in New Issue
Block a user