Added option to set style from style listbox when single

clicking or not. Changed DoSelection name to ApplyStyle.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-10-08 14:02:28 +00:00
parent 7b907278ef
commit 86015e55eb
2 changed files with 18 additions and 7 deletions

View File

@@ -380,8 +380,8 @@ void wxRichTextStyleListBox::OnLeftDown(wxMouseEvent& event)
wxVListBox::OnLeftDown(event);
int item = HitTest(event.GetPosition());
if (item != wxNOT_FOUND)
DoSelection(item);
if (item != wxNOT_FOUND && GetApplyOnSelection())
ApplyStyle(item);
}
/// Auto-select from style under caret in idle time
@@ -429,7 +429,7 @@ void wxRichTextStyleListBox::OnIdle(wxIdleEvent& event)
}
/// Do selection
void wxRichTextStyleListBox::DoSelection(int item)
void wxRichTextStyleListBox::ApplyStyle(int item)
{
if ( item != wxNOT_FOUND )
{
@@ -508,11 +508,11 @@ void wxRichTextStyleComboPopup::OnMouseClick(wxMouseEvent& WXUNUSED(event))
m_value = m_itemHere;
// Ordering is important, so we don't dismiss this popup accidentally
// by setting the focus elsewhere e.g. in DoSelection
// by setting the focus elsewhere e.g. in ApplyStyle
Dismiss();
if (m_itemHere >= 0)
wxRichTextStyleListBox::DoSelection(m_itemHere);
wxRichTextStyleListBox::ApplyStyle(m_itemHere);
}
/*!