void PoeditListCtrl::ReadCatalog() { wxWindowUpdateLocker no_updates(this); // clear the list and its sort order too: SetItemCount(0); m_mapListToCatalog.clear(); m_mapCatalogToList.clear(); if (m_catalog == NULL) { Refresh(); return; } // sort catalog items, create indexes mapping CreateSortMap(); // now that everything is prepared, we may set the item count SetItemCount(m_catalog->GetCount()); // scroll to the top and refresh everything: if ( m_catalog->GetCount() ) { Select(0); RefreshItems(0, m_catalog->GetCount()-1); } else { Refresh(); } }
void PoeditListCtrl::Sort() { if ( m_catalog && m_catalog->GetCount() ) { SelectionPreserver preserve(this); CreateSortMap(); RefreshItems(0, m_catalog->GetCount()-1); } else { Refresh(); } }
void PoeditListCtrl::ReadCatalog() { wxWindowUpdateLocker no_updates(this); // clear the list and its sort order too: SetItemCount(0); m_mapListToCatalog.clear(); m_mapCatalogToList.clear(); if (m_catalog == NULL) { Refresh(); return; } auto lang = m_catalog->GetLanguage(); auto isRTL = lang.IsRTL(); #ifdef __WXMSW__ // a quirk of wx API: if the current locale is RTL, the meaning of L and R is reversed if (m_appIsRTL) isRTL = !isRTL; #endif m_isRTL = isRTL; wxString langname = lang.IsValid() ? lang.DisplayName() : _("unknown language"); wxListItem colInfo; colInfo.SetMask(wxLIST_MASK_TEXT); colInfo.SetText(wxString::Format(_(L"Translation — %s"), langname)); colInfo.SetAlign(isRTL ? wxLIST_FORMAT_RIGHT : wxLIST_FORMAT_LEFT); SetColumn(1, colInfo); // sort catalog items, create indexes mapping CreateSortMap(); // now that everything is prepared, we may set the item count SetItemCount(m_catalog->GetCount()); // scroll to the top and refresh everything: if ( m_catalog->GetCount() ) { SelectOnly(0); RefreshItems(0, m_catalog->GetCount()-1); } else { Refresh(); } }
void PoeditListCtrl::Sort() { if ( m_catalog && m_catalog->GetCount() ) { auto sel = GetSelectedCatalogItems(); CreateSortMap(); RefreshItems(0, m_catalog->GetCount()-1); SetSelectedCatalogItems(sel); } else { Refresh(); } }