wxRTC: fixed style selection reset after editing a style.

wxRTC: can now edit line spacing in .1 increments from 1 to 2.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2010-04-27 16:09:22 +00:00
parent 7e7ced16e4
commit 02aa812cb0
5 changed files with 40 additions and 29 deletions

View File

@@ -520,6 +520,8 @@ void wxRichTextStyleListBox::UpdateStyles()
{
if (GetStyleSheet())
{
int oldSel = GetSelection();
SetSelection(wxNOT_FOUND);
m_styleNames.Clear();
@@ -546,9 +548,15 @@ void wxRichTextStyleListBox::UpdateStyles()
Refresh();
if (GetItemCount() > 0)
int newSel = -1;
if (oldSel >= 0 && oldSel < (int) GetItemCount())
newSel = oldSel;
else if (GetItemCount() > 0)
newSel = 0;
if (newSel >= 0)
{
SetSelection(0);
SetSelection(newSel);
SendSelectedEvent();
}
}
@@ -940,6 +948,7 @@ void wxRichTextStyleListCtrl::OnChooseType(wxCommandEvent& event)
return;
wxRichTextStyleListBox::wxRichTextStyleType styleType = StyleIndexToType(event.GetSelection());
m_styleListBox->SetSelection(-1);
m_styleListBox->SetStyleType(styleType);
}
}