1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184
|
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma implementation "BOINCBaseView.h"
#endif
#include "stdwx.h"
#include "BOINCGUIApp.h"
#include "MainDocument.h"
#include "BOINCBaseView.h"
#include "BOINCTaskCtrl.h"
#include "BOINCListCtrl.h"
#include "Events.h"
#include "res/boinc.xpm"
#include "res/sortascending.xpm"
#include "res/sortdescending.xpm"
IMPLEMENT_DYNAMIC_CLASS(CBOINCBaseView, wxPanel)
CBOINCBaseView::CBOINCBaseView() {}
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) :
wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
m_bProcessingTaskRenderEvent = false;
m_bProcessingListRenderEvent = false;
m_bForceUpdateSelection = true;
m_bIgnoreUIEvents = false;
m_bNeedSort = false;
m_iPreviousSelectionCount = 0;
m_lPreviousFirstSelection = -1;
//
// Setup View
//
m_pTaskPane = NULL;
m_pListPane = NULL;
m_iProgressColumn = -1;
m_iSortColumnID = -1;
m_SortArrows = NULL;
m_aStdColNameOrder = NULL;
m_iDefaultShownColumns = NULL;
m_iNumDefaultShownColumns = 0;
SetName(GetViewName());
SetAutoLayout(TRUE);
}
CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, int iTaskWindowFlags, wxWindowID iListWindowID, int iListWindowFlags) :
wxPanel(pNotebook, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
{
m_bProcessingTaskRenderEvent = false;
m_bProcessingListRenderEvent = false;
m_bForceUpdateSelection = true;
m_bIgnoreUIEvents = false;
m_iPreviousSelectionCount = 0;
m_lPreviousFirstSelection = -1;
//
// Setup View
//
m_pTaskPane = NULL;
m_pListPane = NULL;
SetName(GetViewName());
SetAutoLayout(TRUE);
wxFlexGridSizer* itemFlexGridSizer = new wxFlexGridSizer(2, 0, 0);
wxASSERT(itemFlexGridSizer);
itemFlexGridSizer->AddGrowableRow(0);
itemFlexGridSizer->AddGrowableCol(1);
m_pTaskPane = new CBOINCTaskCtrl(this, iTaskWindowID, iTaskWindowFlags);
wxASSERT(m_pTaskPane);
m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags);
wxASSERT(m_pListPane);
itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1);
itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1);
SetSizer(itemFlexGridSizer);
UpdateSelection();
m_iProgressColumn = -1;
m_iSortColumnID = -1;
m_bReverseSort = false;
m_SortArrows = new wxImageList(16, 16, true);
m_SortArrows->Add( wxIcon( sortascending_xpm ) );
m_SortArrows->Add( wxIcon( sortdescending_xpm ) );
m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL);
m_aStdColNameOrder = NULL;
m_iDefaultShownColumns = NULL;
m_iNumDefaultShownColumns = 0;
}
CBOINCBaseView::~CBOINCBaseView() {
if (m_SortArrows) {
delete m_SortArrows;
}
m_arrSelectedKeys1.Clear();
m_arrSelectedKeys2.Clear();
m_iSortedIndexes.Clear();
if (m_aStdColNameOrder) {
delete m_aStdColNameOrder;
}
}
// The name of the view.
// If it has not been defined by the view "Undefined" is returned.
//
wxString& CBOINCBaseView::GetViewName() {
static wxString strViewName(wxT("Undefined"));
return strViewName;
}
// The user friendly name of the view.
// If it has not been defined by the view "Undefined" is returned.
//
wxString& CBOINCBaseView::GetViewDisplayName() {
static wxString strViewName(wxT("Undefined"));
return strViewName;
}
// The user friendly icon of the view.
// If it has not been defined by the view the BOINC icon is returned.
//
const char** CBOINCBaseView::GetViewIcon() {
wxASSERT(boinc_xpm);
return boinc_xpm;
}
// The rate at which the view is refreshed.
// If it has not been defined by the view 1 second is retrned.
//
int CBOINCBaseView::GetViewRefreshRate() {
return 1;
}
// Get bit mask of current view(s).
//
int CBOINCBaseView::GetViewCurrentViewPage() {
return 0;
}
wxString CBOINCBaseView::GetKeyValue1(int) {
return wxEmptyString;
}
wxString CBOINCBaseView::GetKeyValue2(int) {
return wxEmptyString;
}
int CBOINCBaseView::FindRowIndexByKeyValues(wxString&, wxString&) {
return -1;
}
bool CBOINCBaseView::FireOnSaveState(wxConfigBase* pConfig) {
return OnSaveState(pConfig);
}
bool CBOINCBaseView::FireOnRestoreState(wxConfigBase* pConfig) {
return OnRestoreState(pConfig);
}
int CBOINCBaseView::GetListRowCount() {
wxASSERT(m_pListPane);
return m_pListPane->GetItemCount();
}
void CBOINCBaseView::FireOnListRender(wxTimerEvent& event) {
OnListRender(event);
}
void CBOINCBaseView::FireOnListSelected(wxListEvent& event) {
OnListSelected(event);
}
void CBOINCBaseView::FireOnListDeselected(wxListEvent& event) {
OnListDeselected(event);
}
wxString CBOINCBaseView::FireOnListGetItemText(long item, long column) const {
return OnListGetItemText(item, column);
}
int CBOINCBaseView::FireOnListGetItemImage(long item) const {
return OnListGetItemImage(item);
}
void CBOINCBaseView::OnListRender(wxTimerEvent& event) {
if (!m_bProcessingListRenderEvent) {
m_bProcessingListRenderEvent = true;
wxASSERT(m_pListPane);
// Remember the key values of currently selected items
SaveSelections();
int iDocCount = GetDocCount();
int iCacheCount = GetCacheCount();
if (iDocCount != iCacheCount) {
if (0 >= iDocCount) {
EmptyCache();
m_pListPane->DeleteAllItems();
} else {
int iIndex = 0;
int iReturnValue = -1;
if (iDocCount > iCacheCount) {
for (iIndex = 0; iIndex < (iDocCount - iCacheCount); iIndex++) {
iReturnValue = AddCacheElement();
wxASSERT(!iReturnValue);
}
wxASSERT(GetDocCount() == GetCacheCount());
m_pListPane->SetItemCount(iDocCount);
m_bNeedSort = true;
} else {
// The virtual ListCtrl keeps a separate its list of selected rows;
// make sure it does not reference any rows beyond the new last row.
// We can ClearSelections() because we called SaveSelections() above.
ClearSelections();
m_pListPane->SetItemCount(iDocCount);
for (iIndex = (iCacheCount - 1); iIndex >= iDocCount; --iIndex) {
iReturnValue = RemoveCacheElement();
wxASSERT(!iReturnValue);
}
wxASSERT(GetDocCount() == GetCacheCount());
//fprintf(stderr, "CBOINCBaseView::OnListRender(): m_pListPane->RefreshItems(0, %d)\n", iDocCount - 1);
m_pListPane->RefreshItems(0, iDocCount - 1);
#ifdef __WXGTK__
// Work around an apparent bug in wxWidgets 3.0
// which drew blank lines at the top and failed
// to draw the bottom items. This could happen
// if the list was scrolled near the bottom and
// the user selected "Show active tasks."
m_pListPane->EnsureVisible(iDocCount - 1);
#endif
m_bNeedSort = true;
}
}
}
if (iDocCount > 0) {
SynchronizeCache();
if (iDocCount > 1) {
if (_EnsureLastItemVisible() && (iDocCount != iCacheCount)) {
m_pListPane->EnsureVisible(iDocCount - 1);
}
}
}
// Find the previously selected items by their key values and reselect them
RestoreSelections();
UpdateSelection();
m_bProcessingListRenderEvent = false;
}
event.Skip();
}
bool CBOINCBaseView::OnSaveState(wxConfigBase* pConfig) {
bool bReturnValue = true;
wxASSERT(pConfig);
wxASSERT(m_pTaskPane);
wxASSERT(m_pListPane);
if (!m_pTaskPane->OnSaveState(pConfig)) {
bReturnValue = false;
}
if (!m_pListPane->OnSaveState(pConfig)) {
bReturnValue = false;
}
return bReturnValue;
}
bool CBOINCBaseView::OnRestoreState(wxConfigBase* pConfig) {
wxASSERT(pConfig);
wxASSERT(m_pTaskPane);
wxASSERT(m_pListPane);
if (!m_pTaskPane->OnRestoreState(pConfig)) {
return false;
}
if (!m_pListPane->OnRestoreState(pConfig)) {
return false;
}
return true;
}
// We don't use this because multiple selection virtual
// wxListCtrl does not generate selection events for
// shift-click; see OnCheckSelectionChanged() below.
void CBOINCBaseView::OnListSelected(wxListEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function Begin"));
if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListSelected - Function End"));
}
// We don't use this because multiple selection virtual
// wxListCtrl does generates deselection events only for
// control-click; see OnCheckSelectionChanged() below.
void CBOINCBaseView::OnListDeselected(wxListEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function Begin"));
if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
event.Skip();
}
wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseView::OnListDeselected - Function End"));
}
void CBOINCBaseView::OnCheckSelectionChanged(CCheckSelectionChangedEvent& ) {
CheckSelectionChanged();
}
void CBOINCBaseView::OnCacheHint(wxListEvent& ) {
CheckSelectionChanged();
}
// Work around features in multiple selection virtual wxListCtrl:
// * It does not send deselection events (except ctrl-click).
// * It does not send selection events if you add to selection
// using Shift_Click.
//
// We currently handle all selections and deselections here.
// On the Mac, this is called due to an event posted by CBOINCListCtrl::OnMouseDown().
// On Windows, it is called due to a EVT_LIST_CACHE_HINT from wxListCtrl.
void CBOINCBaseView::CheckSelectionChanged() {
int newSelectionCount = m_pListPane->GetSelectedItemCount();
long currentSelection = m_pListPane->GetFirstSelected();
if ((newSelectionCount != m_iPreviousSelectionCount) ||
(currentSelection != m_lPreviousFirstSelection)
) {
if (!m_bIgnoreUIEvents) {
m_bForceUpdateSelection = true;
UpdateSelection();
}
}
m_iPreviousSelectionCount = newSelectionCount;
m_lPreviousFirstSelection = currentSelection;
}
wxString CBOINCBaseView::OnListGetItemText(long WXUNUSED(item), long WXUNUSED(column)) const {
return wxString(wxT("Undefined"));
}
int CBOINCBaseView::OnListGetItemImage(long WXUNUSED(item)) const {
return -1;
}
int CBOINCBaseView::GetDocCount() {
return 0;
}
wxString CBOINCBaseView::OnDocGetItemImage(long WXUNUSED(item)) const {
return wxString(wxT("Undefined"));
}
wxString CBOINCBaseView::OnDocGetItemAttr(long WXUNUSED(item)) const {
return wxString(wxT("Undefined"));
}
int CBOINCBaseView::AddCacheElement() {
return -1;
}
int CBOINCBaseView::EmptyCache() {
return -1;
}
int CBOINCBaseView::GetCacheCount() {
return -1;
}
int CBOINCBaseView::RemoveCacheElement() {
return -1;
}
int CBOINCBaseView::SynchronizeCache() {
int iRowIndex = 0;
int iRowTotal = 0;
int iColumnIndex = 0;
int iColumnTotal = 0;
bool bNeedRefreshData = false;
iRowTotal = GetDocCount();
iColumnTotal = m_pListPane->GetColumnCount();
for (iRowIndex = 0; iRowIndex < iRowTotal; iRowIndex++) {
bNeedRefreshData = false;
for (iColumnIndex = 0; iColumnIndex < iColumnTotal; iColumnIndex++) {
if (SynchronizeCacheItem(iRowIndex, iColumnIndex)) {
#ifdef __WXMAC__
bNeedRefreshData = true;
#else
// To reduce flicker, refresh only changed columns
m_pListPane->RefreshCell(iRowIndex, iColumnIndex);
#endif
if (iColumnIndex >= 0) {
if (m_iColumnIndexToColumnID[iColumnIndex] == m_iSortColumnID) {
m_bNeedSort = true;
}
}
}
}
// Mac is double-buffered to avoid flicker, so this is more efficient
if (bNeedRefreshData) {
m_pListPane->RefreshItem(iRowIndex);
}
}
if (m_bNeedSort) {
sortData(); // Will mark moved items as needing refresh
m_bNeedSort = false;
}
return 0;
}
bool CBOINCBaseView::SynchronizeCacheItem(wxInt32 WXUNUSED(iRowIndex), wxInt32 WXUNUSED(iColumnIndex)) {
return false;
}
void CBOINCBaseView::OnColClick(wxListEvent& event) {
wxListItem item;
int newSortColIndex = event.GetColumn();
int oldSortColIndex = -1;
if (newSortColIndex < 0) return; // Clicked past last column
if (m_iSortColumnID >= 0) {
oldSortColIndex = m_iColumnIDToColumnIndex[m_iSortColumnID];
}
item.SetMask(wxLIST_MASK_IMAGE);
if (newSortColIndex == oldSortColIndex) {
m_bReverseSort = !m_bReverseSort;
SetSortColumn(newSortColIndex);
} else {
// Remove sort arrow from old sort column
if (oldSortColIndex >= 0) {
item.SetImage(-1);
m_pListPane->SetColumn(oldSortColIndex, item);
}
m_iSortColumnID = m_iColumnIndexToColumnID[newSortColIndex];
m_bReverseSort = false;
SetSortColumn(newSortColIndex);
}
// Write the change to the registry
// Do this here because SetListColumnOrder() can call SetSortColumn()
// even when neither m_iSortColumnID nor m_bReverseSort changes
wxConfigBase* pConfig = wxConfigBase::Get(false);
pConfig->SetPath(wxT("/") + GetViewName());
m_pListPane->OnSaveState(pConfig);
}
void CBOINCBaseView::SetSortColumn(int newSortColIndex) {
wxListItem item;
int i, j, m;
wxArrayInt selections;
item.SetImage(m_bReverseSort ? 0 : 1);
m_pListPane->SetColumn(newSortColIndex, item);
Freeze(); // To reduce flicker
// Remember which cache elements are selected and deselect them
m_bIgnoreUIEvents = true;
i = -1;
while (1) {
i = m_pListPane->GetNextSelected(i);
if (i < 0) break;
selections.Add(m_iSortedIndexes[i]);
m_pListPane->SelectRow(i, false);
}
sortData();
// Reselect previously selected cache elements in the sorted list
m = (int)selections.GetCount();
for (i=0; i<m; i++) {
if (selections[i] >= 0) {
j = m_iSortedIndexes.Index(selections[i]);
m_pListPane->SelectRow(j, true);
}
}
m_bIgnoreUIEvents = false;
Thaw();
}
void CBOINCBaseView::InitSort() {
wxListItem item;
if (m_iSortColumnID < 0) return;
int newSortColIndex = m_iColumnIDToColumnIndex[m_iSortColumnID];
if (newSortColIndex < 0) return;
item.SetMask(wxLIST_MASK_IMAGE);
item.SetImage(m_bReverseSort ? 0 : 1);
m_pListPane->SetColumn(newSortColIndex, item);
Freeze(); // To reduce flicker
sortData();
Thaw();
}
void CBOINCBaseView::sortData() {
if (m_iSortColumnID < 0) return;
if (m_iColumnIDToColumnIndex[m_iSortColumnID] < 0) return;
wxArrayInt oldSortedIndexes(m_iSortedIndexes);
int i, n = (int)m_iSortedIndexes.GetCount();
std::stable_sort(m_iSortedIndexes.begin(), m_iSortedIndexes.end(), m_funcSortCompare);
// Refresh rows which have moved
for (i=0; i<n; i++) {
if (m_iSortedIndexes[i] != oldSortedIndexes[i]) {
m_pListPane->RefreshItem(i);
}
}
}
void CBOINCBaseView::EmptyTasks() {
unsigned int i;
unsigned int j;
for (i=0; i<m_TaskGroups.size(); i++) {
for (j=0; j<m_TaskGroups[i]->m_Tasks.size(); j++) {
delete m_TaskGroups[i]->m_Tasks[j];
}
m_TaskGroups[i]->m_Tasks.clear();
delete m_TaskGroups[i];
}
m_TaskGroups.clear();
}
void CBOINCBaseView::ClearSavedSelections() {
m_arrSelectedKeys1.Clear();
m_arrSelectedKeys2.Clear();
}
// Save the key values of the currently selected rows for later restore
void CBOINCBaseView::SaveSelections() {
if (!_IsSelectionManagementNeeded()) {
return;
}
m_arrSelectedKeys1.Clear();
m_arrSelectedKeys2.Clear();
m_bIgnoreUIEvents = true;
int i = -1;
while (1) {
i = m_pListPane->GetNextSelected(i);
if (i < 0) break;
m_arrSelectedKeys1.Add(GetKeyValue1(i));
m_arrSelectedKeys2.Add(GetKeyValue2(i));
}
m_bIgnoreUIEvents = false;
}
// Select all rows with formerly selected data based on key values
//
// Each RPC may add (insert) or delete items from the list, so
// the selected row numbers may now point to different data.
// We called SaveSelections() before updating the underlying
// data; this routine finds the data corresponding to each
// previous selection and makes any adjustments to ensure that
// the rows containing the originally selected data are selected.
void CBOINCBaseView::RestoreSelections() {
if (!_IsSelectionManagementNeeded()) {
return;
}
// To minimize flicker, this method selects or deselects only
// those rows which actually need their selection status changed.
// First, get a list of which rows should be selected
int i, j, m = 0, newCount = 0, oldCount = (int)m_arrSelectedKeys1.size();
bool found;
wxArrayInt arrSelRows;
for(i=0; i< oldCount; ++i) {
int index = FindRowIndexByKeyValues(m_arrSelectedKeys1[i], m_arrSelectedKeys2[i]);
if(index >= 0) {
arrSelRows.Add(index);
}
}
newCount = (int)arrSelRows.GetCount();
// Step through the currently selected row numbers and for each one determine
// whether it should remain selected.
m_bIgnoreUIEvents = true;
i = -1;
while (1) {
found = false;
i = m_pListPane->GetNextSelected(i);
if (i < 0) break;
m = (int)arrSelRows.GetCount();
for (j=0; j<m; ++j) {
if (arrSelRows[j] == i) {
arrSelRows.RemoveAt(j); // We have handled this one so remove from list
found = true; // Already selected, so no change needed
break;
}
}
if (!found) {
m_pListPane->SelectRow(i, false); // This row should no longer be selected
}
}
// Now select those rows which were not previously selected but should now be
m = (int)arrSelRows.GetCount();
for (j=0; j<m; ++j) {
m_pListPane->SelectRow(arrSelRows[j], true);
}
m_bIgnoreUIEvents = false;
if (oldCount != newCount) {
m_bForceUpdateSelection = true; // OnListRender() will call UpdateSelection()
}
}
void CBOINCBaseView::ClearSelections() {
if (!m_pListPane) return;
m_bIgnoreUIEvents = true;
int i = -1;
while (1) {
i = m_pListPane->GetNextSelected(i);
if (i < 0) break;
m_pListPane->SelectRow(i, false);
}
m_bIgnoreUIEvents = false;
}
void CBOINCBaseView::PreUpdateSelection(){
}
void CBOINCBaseView::UpdateSelection(){
}
void CBOINCBaseView::PostUpdateSelection(){
wxASSERT(m_pTaskPane);
if (m_pTaskPane->UpdateControls()) {
// Under wxWidgets 2.9.4, Layout() causes ListCtrl
// to repaint, so call only when actually needed.
Layout();
}
}
void CBOINCBaseView::UpdateWebsiteSelection(long lControlGroup, PROJECT* project){
unsigned int i;
CTaskItemGroup* pGroup = NULL;
CTaskItem* pItem = NULL;
wxASSERT(m_pTaskPane);
wxASSERT(m_pListPane);
if (m_bForceUpdateSelection) {
// Update the websites list
//
if (m_TaskGroups.size() > 1) {
// Delete task group, objects, and controls.
pGroup = m_TaskGroups[lControlGroup];
m_pTaskPane->DeleteTaskGroupAndTasks(pGroup);
for (i=0; i<pGroup->m_Tasks.size(); i++) {
delete pGroup->m_Tasks[i];
}
pGroup->m_Tasks.clear();
delete pGroup;
pGroup = NULL;
m_TaskGroups.erase( m_TaskGroups.begin() + 1 );
}
// If something is selected create the tasks and controls
//
if (m_pListPane->GetSelectedItemCount()) {
if (project) {
// Create the web sites task group
pGroup = new CTaskItemGroup( _("Project web pages") );
m_TaskGroups.push_back( pGroup );
// Default project url
pItem = new CTaskItem(
wxString("Home page", wxConvUTF8),
wxString(project->project_name.c_str(), wxConvUTF8) + wxT(" web site"),
wxString(project->master_url, wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN
);
pGroup->m_Tasks.push_back(pItem);
// Project defined urls
for (i=0;(i<project->gui_urls.size())&&(i<=ID_TASK_PROJECT_WEB_PROJDEF_MAX);i++) {
pItem = new CTaskItem(
wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8)),
wxGetTranslation(wxString(project->gui_urls[i].description.c_str(), wxConvUTF8)),
wxString(project->gui_urls[i].url.c_str(), wxConvUTF8),
ID_TASK_PROJECT_WEB_PROJDEF_MIN + 1 + i
);
pGroup->m_Tasks.push_back(pItem);
}
}
}
m_pTaskPane->FitInside();
m_bForceUpdateSelection = false;
}
}
// Make sure task pane background is properly erased
void CBOINCBaseView::RefreshTaskPane() {
if (m_pTaskPane) {
m_pTaskPane->Refresh(true);
}
}
#ifdef __WXMAC__
// Fix Keyboard navigation on Mac
//
// NOTE: to select an item in wxListCtrl when none
// has yet been selected, press tab and then space.
#define SHIFT_MASK (1<<17)
void CBOINCBaseView::OnKeyPressed(wxKeyEvent &event) {
wxWindow next;
CTaskItemGroup* pGroup = NULL;
CTaskItem* pItem = NULL;
int i, j;
bool focusOK = false;
if (m_pTaskPane) {
int keyCode = event.GetKeyCode();
wxUint32 keyFlags = event.GetRawKeyFlags();
if (keyCode == WXK_TAB) {
wxWindow* focused = wxWindow::FindFocus();
if (!m_pTaskPane->IsDescendant(focused)) {
if (keyFlags & SHIFT_MASK) {
for (i=m_TaskGroups.size()-1; i>=0; --i) {
pGroup = m_TaskGroups[i];
for (j=pGroup->m_Tasks.size()-1; j>=0; --j) {
pItem = pGroup->m_Tasks[j];
if (pItem->m_pButton) {
if (pItem->m_pButton->CanAcceptFocus()) {
focusOK = true;
break;
}
}
}
if (focusOK) break;
}
} else {
for (i=0; i<m_TaskGroups.size(); ++i) {
pGroup = m_TaskGroups[i];
for (j=0; j<pGroup->m_Tasks.size(); ++j) {
pItem = pGroup->m_Tasks[j];
if (pItem->m_pButton) {
if (pItem->m_pButton->CanAcceptFocus()) {
focusOK = true;
break;
}
}
}
if (focusOK) break;
}
}
if (focusOK) {
pItem->m_pButton->SetFocus();
return;
}
}
wxNavigationKeyEvent evt;
evt.SetDirection((keyFlags & SHIFT_MASK) == 0);
evt.SetFromTab(true);
m_pTaskPane->GetEventHandler()->AddPendingEvent(evt);
return;
}
}
event.Skip();
}
#endif
bool CBOINCBaseView::_IsSelectionManagementNeeded() {
return IsSelectionManagementNeeded();
}
bool CBOINCBaseView::IsSelectionManagementNeeded() {
return false;
}
bool CBOINCBaseView::_EnsureLastItemVisible() {
return EnsureLastItemVisible();
}
bool CBOINCBaseView::EnsureLastItemVisible() {
return false;
}
double CBOINCBaseView::GetProgressValue(long) {
return 0.0;
}
wxString CBOINCBaseView::GetProgressText( long ) {
return wxEmptyString;
}
void CBOINCBaseView::AppendColumn(int){
}
void CBOINCBaseView::append_to_status(wxString& existing, const wxString& additional) {
if (existing.size() == 0) {
existing = additional;
} else {
existing += wxT(", ") + additional;
}
}
// HTML Entity Conversion:
// http://www.webreference.com/html/reference/character/
// Completed: The ISO Latin 1 Character Set
//
wxString CBOINCBaseView::HtmlEntityEncode(wxString strRaw) {
wxString strEncodedHtml(strRaw);
#ifdef __WXMSW__
strEncodedHtml.Replace(wxT("&"), wxT("&"), true);
strEncodedHtml.Replace(wxT("\""), wxT("""), true);
strEncodedHtml.Replace(wxT("<"), wxT("<"), true);
strEncodedHtml.Replace(wxT(">"), wxT(">"), true);
strEncodedHtml.Replace(wxT("‚"), wxT("‚"), true);
strEncodedHtml.Replace(wxT("ƒ"), wxT("ƒ"), true);
strEncodedHtml.Replace(wxT("„"), wxT("„"), true);
strEncodedHtml.Replace(wxT("…"), wxT("…"), true);
strEncodedHtml.Replace(wxT("†"), wxT("†"), true);
strEncodedHtml.Replace(wxT("‡"), wxT("‡"), true);
strEncodedHtml.Replace(wxT("Š"), wxT("Š"), true);
strEncodedHtml.Replace(wxT("Œ"), wxT("Œ"), true);
strEncodedHtml.Replace(wxT("‘"), wxT("‘"), true);
strEncodedHtml.Replace(wxT("’"), wxT("’"), true);
strEncodedHtml.Replace(wxT("“"), wxT("“"), true);
strEncodedHtml.Replace(wxT("”"), wxT("”"), true);
strEncodedHtml.Replace(wxT("•"), wxT("•"), true);
strEncodedHtml.Replace(wxT("–"), wxT("–"), true);
strEncodedHtml.Replace(wxT("—"), wxT("—"), true);
strEncodedHtml.Replace(wxT("˜˜~"), wxT("˜"), true);
strEncodedHtml.Replace(wxT("™"), wxT("™"), true);
strEncodedHtml.Replace(wxT("š"), wxT("š"), true);
strEncodedHtml.Replace(wxT("œ"), wxT("œ"), true);
strEncodedHtml.Replace(wxT("Ÿ"), wxT("Ÿ"), true);
strEncodedHtml.Replace(wxT("¡"), wxT("¡"), true);
strEncodedHtml.Replace(wxT("¢"), wxT("¢"), true);
strEncodedHtml.Replace(wxT("£"), wxT("£"), true);
strEncodedHtml.Replace(wxT("¤"), wxT("¤"), true);
strEncodedHtml.Replace(wxT("¥"), wxT("¥"), true);
strEncodedHtml.Replace(wxT("¦"), wxT("¦"), true);
strEncodedHtml.Replace(wxT("§"), wxT("§"), true);
strEncodedHtml.Replace(wxT("¨"), wxT("¨"), true);
strEncodedHtml.Replace(wxT("©"), wxT("©"), true);
strEncodedHtml.Replace(wxT("ª"), wxT("ª"), true);
strEncodedHtml.Replace(wxT("«"), wxT("«"), true);
strEncodedHtml.Replace(wxT("¬"), wxT("¬"), true);
strEncodedHtml.Replace(wxT("®"), wxT("®"), true);
strEncodedHtml.Replace(wxT("¯"), wxT("¯"), true);
strEncodedHtml.Replace(wxT("°"), wxT("°"), true);
strEncodedHtml.Replace(wxT("±"), wxT("±"), true);
strEncodedHtml.Replace(wxT("²"), wxT("²"), true);
strEncodedHtml.Replace(wxT("³"), wxT("³"), true);
strEncodedHtml.Replace(wxT("´"), wxT("´"), true);
strEncodedHtml.Replace(wxT("µ"), wxT("µ"), true);
strEncodedHtml.Replace(wxT("¶"), wxT("¶"), true);
strEncodedHtml.Replace(wxT("·"), wxT("·"), true);
strEncodedHtml.Replace(wxT("¸"), wxT("¸"), true);
strEncodedHtml.Replace(wxT("¹"), wxT("¹"), true);
strEncodedHtml.Replace(wxT("º"), wxT("º"), true);
strEncodedHtml.Replace(wxT("»"), wxT("»"), true);
strEncodedHtml.Replace(wxT("¼"), wxT("¼"), true);
strEncodedHtml.Replace(wxT("½"), wxT("½"), true);
strEncodedHtml.Replace(wxT("¾"), wxT("¾"), true);
strEncodedHtml.Replace(wxT("¿"), wxT("¿"), true);
strEncodedHtml.Replace(wxT("À"), wxT("À"), true);
strEncodedHtml.Replace(wxT("Á"), wxT("Á"), true);
strEncodedHtml.Replace(wxT("Â"), wxT("Â"), true);
strEncodedHtml.Replace(wxT("Ã"), wxT("Ã"), true);
strEncodedHtml.Replace(wxT("Ä"), wxT("Ä"), true);
strEncodedHtml.Replace(wxT("Å"), wxT("Å"), true);
strEncodedHtml.Replace(wxT("Æ"), wxT("Æ"), true);
strEncodedHtml.Replace(wxT("Ç"), wxT("Ç"), true);
strEncodedHtml.Replace(wxT("È"), wxT("È"), true);
strEncodedHtml.Replace(wxT("É"), wxT("É"), true);
strEncodedHtml.Replace(wxT("Ê"), wxT("Ê"), true);
strEncodedHtml.Replace(wxT("Ë"), wxT("Ë"), true);
strEncodedHtml.Replace(wxT("Ì"), wxT("Ì"), true);
strEncodedHtml.Replace(wxT("Í"), wxT("Í"), true);
strEncodedHtml.Replace(wxT("Î"), wxT("Î"), true);
strEncodedHtml.Replace(wxT("Ï"), wxT("Ï"), true);
strEncodedHtml.Replace(wxT("Ð"), wxT("Ð"), true);
strEncodedHtml.Replace(wxT("Ñ"), wxT("Ñ"), true);
strEncodedHtml.Replace(wxT("Ò"), wxT("Ò"), true);
strEncodedHtml.Replace(wxT("Ó"), wxT("Ó"), true);
strEncodedHtml.Replace(wxT("Ô"), wxT("Ô"), true);
strEncodedHtml.Replace(wxT("Õ"), wxT("Õ"), true);
strEncodedHtml.Replace(wxT("Ö"), wxT("Ö"), true);
strEncodedHtml.Replace(wxT("×"), wxT("×"), true);
strEncodedHtml.Replace(wxT("Ø"), wxT("Ø"), true);
strEncodedHtml.Replace(wxT("Ù"), wxT("Ù"), true);
strEncodedHtml.Replace(wxT("Ú"), wxT("Ú"), true);
strEncodedHtml.Replace(wxT("Û"), wxT("Û"), true);
strEncodedHtml.Replace(wxT("Ü"), wxT("Ü"), true);
strEncodedHtml.Replace(wxT("Ý"), wxT("Ý"), true);
strEncodedHtml.Replace(wxT("Þ"), wxT("Þ"), true);
strEncodedHtml.Replace(wxT("ß"), wxT("ß"), true);
strEncodedHtml.Replace(wxT("à"), wxT("à"), true);
strEncodedHtml.Replace(wxT("á"), wxT("á"), true);
strEncodedHtml.Replace(wxT("â"), wxT("â"), true);
strEncodedHtml.Replace(wxT("ã"), wxT("ã"), true);
strEncodedHtml.Replace(wxT("ä"), wxT("ä"), true);
strEncodedHtml.Replace(wxT("å"), wxT("å"), true);
strEncodedHtml.Replace(wxT("æ"), wxT("æ"), true);
strEncodedHtml.Replace(wxT("ç"), wxT("ç"), true);
strEncodedHtml.Replace(wxT("è"), wxT("è"), true);
strEncodedHtml.Replace(wxT("é"), wxT("é"), true);
strEncodedHtml.Replace(wxT("ê"), wxT("ê"), true);
strEncodedHtml.Replace(wxT("ë"), wxT("ë"), true);
strEncodedHtml.Replace(wxT("ì"), wxT("ì"), true);
strEncodedHtml.Replace(wxT("í"), wxT("í"), true);
strEncodedHtml.Replace(wxT("î"), wxT("î"), true);
strEncodedHtml.Replace(wxT("ï"), wxT("ï"), true);
strEncodedHtml.Replace(wxT("ð"), wxT("ð"), true);
strEncodedHtml.Replace(wxT("ñ"), wxT("ñ"), true);
strEncodedHtml.Replace(wxT("ò"), wxT("ò"), true);
strEncodedHtml.Replace(wxT("ó"), wxT("ó"), true);
strEncodedHtml.Replace(wxT("ô"), wxT("ô"), true);
strEncodedHtml.Replace(wxT("õ"), wxT("õ"), true);
strEncodedHtml.Replace(wxT("ö"), wxT("ö"), true);
strEncodedHtml.Replace(wxT("÷"), wxT("÷"), true);
strEncodedHtml.Replace(wxT("ø"), wxT("ø"), true);
strEncodedHtml.Replace(wxT("ù"), wxT("ù"), true);
strEncodedHtml.Replace(wxT("ú"), wxT("ú"), true);
strEncodedHtml.Replace(wxT("û"), wxT("û"), true);
strEncodedHtml.Replace(wxT("ü"), wxT("ü"), true);
strEncodedHtml.Replace(wxT("ý"), wxT("ý"), true);
strEncodedHtml.Replace(wxT("þ"), wxT("þ"), true);
strEncodedHtml.Replace(wxT("ÿ"), wxT("ÿ"), true);
#endif
return strEncodedHtml;
}
wxString CBOINCBaseView::HtmlEntityDecode(wxString strRaw) {
wxString strDecodedHtml(strRaw);
if (0 <= strDecodedHtml.Find(wxT("&"))) {
#ifdef __WXMSW__
strDecodedHtml.Replace(wxT("&"), wxT("&"), true);
strDecodedHtml.Replace(wxT("""), wxT("\""), true);
strDecodedHtml.Replace(wxT("<"), wxT("<"), true);
strDecodedHtml.Replace(wxT(">"), wxT(">"), true);
strDecodedHtml.Replace(wxT("‚"), wxT("‚"), true);
strDecodedHtml.Replace(wxT("ƒ"), wxT("ƒ"), true);
strDecodedHtml.Replace(wxT("„"), wxT("„"), true);
strDecodedHtml.Replace(wxT("…"), wxT("…"), true);
strDecodedHtml.Replace(wxT("†"), wxT("†"), true);
strDecodedHtml.Replace(wxT("‡"), wxT("‡"), true);
strDecodedHtml.Replace(wxT("Š"), wxT("Š"), true);
strDecodedHtml.Replace(wxT("Œ"), wxT("Œ"), true);
strDecodedHtml.Replace(wxT("‘"), wxT("‘"), true);
strDecodedHtml.Replace(wxT("’"), wxT("’"), true);
strDecodedHtml.Replace(wxT("“"), wxT("“"), true);
strDecodedHtml.Replace(wxT("”"), wxT("”"), true);
strDecodedHtml.Replace(wxT("•"), wxT("•"), true);
strDecodedHtml.Replace(wxT("–"), wxT("–"), true);
strDecodedHtml.Replace(wxT("—"), wxT("—"), true);
strDecodedHtml.Replace(wxT("˜"), wxT("˜˜~"), true);
strDecodedHtml.Replace(wxT("™"), wxT("™"), true);
strDecodedHtml.Replace(wxT("š"), wxT("š"), true);
strDecodedHtml.Replace(wxT("œ"), wxT("œ"), true);
strDecodedHtml.Replace(wxT("Ÿ"), wxT("Ÿ"), true);
strDecodedHtml.Replace(wxT("¡"), wxT("¡"), true);
strDecodedHtml.Replace(wxT("¢"), wxT("¢"), true);
strDecodedHtml.Replace(wxT("£"), wxT("£"), true);
strDecodedHtml.Replace(wxT("¤"), wxT("¤"), true);
strDecodedHtml.Replace(wxT("¥"), wxT("¥"), true);
strDecodedHtml.Replace(wxT("¦"), wxT("¦"), true);
strDecodedHtml.Replace(wxT("§"), wxT("§"), true);
strDecodedHtml.Replace(wxT("¨"), wxT("¨"), true);
strDecodedHtml.Replace(wxT("©"), wxT("©"), true);
strDecodedHtml.Replace(wxT("ª"), wxT("ª"), true);
strDecodedHtml.Replace(wxT("«"), wxT("«"), true);
strDecodedHtml.Replace(wxT("¬"), wxT("¬"), true);
strDecodedHtml.Replace(wxT("®"), wxT("®"), true);
strDecodedHtml.Replace(wxT("¯"), wxT("¯"), true);
strDecodedHtml.Replace(wxT("°"), wxT("°"), true);
strDecodedHtml.Replace(wxT("±"), wxT("±"), true);
strDecodedHtml.Replace(wxT("²"), wxT("²"), true);
strDecodedHtml.Replace(wxT("³"), wxT("³"), true);
strDecodedHtml.Replace(wxT("´"), wxT("´"), true);
strDecodedHtml.Replace(wxT("µ"), wxT("µ"), true);
strDecodedHtml.Replace(wxT("¶"), wxT("¶"), true);
strDecodedHtml.Replace(wxT("·"), wxT("·"), true);
strDecodedHtml.Replace(wxT("¸"), wxT("¸"), true);
strDecodedHtml.Replace(wxT("¹"), wxT("¹"), true);
strDecodedHtml.Replace(wxT("º"), wxT("º"), true);
strDecodedHtml.Replace(wxT("»"), wxT("»"), true);
strDecodedHtml.Replace(wxT("¼"), wxT("¼"), true);
strDecodedHtml.Replace(wxT("½"), wxT("½"), true);
strDecodedHtml.Replace(wxT("¾"), wxT("¾"), true);
strDecodedHtml.Replace(wxT("¿"), wxT("¿"), true);
strDecodedHtml.Replace(wxT("À"), wxT("À"), true);
strDecodedHtml.Replace(wxT("Á"), wxT("Á"), true);
strDecodedHtml.Replace(wxT("Â"), wxT("Â"), true);
strDecodedHtml.Replace(wxT("Ã"), wxT("Ã"), true);
strDecodedHtml.Replace(wxT("Ä"), wxT("Ä"), true);
strDecodedHtml.Replace(wxT("Å"), wxT("Å"), true);
strDecodedHtml.Replace(wxT("Æ"), wxT("Æ"), true);
strDecodedHtml.Replace(wxT("Ç"), wxT("Ç"), true);
strDecodedHtml.Replace(wxT("È"), wxT("È"), true);
strDecodedHtml.Replace(wxT("É"), wxT("É"), true);
strDecodedHtml.Replace(wxT("Ê"), wxT("Ê"), true);
strDecodedHtml.Replace(wxT("Ë"), wxT("Ë"), true);
strDecodedHtml.Replace(wxT("Ì"), wxT("Ì"), true);
strDecodedHtml.Replace(wxT("Í"), wxT("Í"), true);
strDecodedHtml.Replace(wxT("Î"), wxT("Î"), true);
strDecodedHtml.Replace(wxT("Ï"), wxT("Ï"), true);
strDecodedHtml.Replace(wxT("Ð"), wxT("Ð"), true);
strDecodedHtml.Replace(wxT("Ñ"), wxT("Ñ"), true);
strDecodedHtml.Replace(wxT("Ò"), wxT("Ò"), true);
strDecodedHtml.Replace(wxT("Ó"), wxT("Ó"), true);
strDecodedHtml.Replace(wxT("Ô"), wxT("Ô"), true);
strDecodedHtml.Replace(wxT("Õ"), wxT("Õ"), true);
strDecodedHtml.Replace(wxT("Ö"), wxT("Ö"), true);
strDecodedHtml.Replace(wxT("×"), wxT("×"), true);
strDecodedHtml.Replace(wxT("Ø"), wxT("Ø"), true);
strDecodedHtml.Replace(wxT("Ù"), wxT("Ù"), true);
strDecodedHtml.Replace(wxT("Ú"), wxT("Ú"), true);
strDecodedHtml.Replace(wxT("Û"), wxT("Û"), true);
strDecodedHtml.Replace(wxT("Ü"), wxT("Ü"), true);
strDecodedHtml.Replace(wxT("Ý"), wxT("Ý"), true);
strDecodedHtml.Replace(wxT("Þ"), wxT("Þ"), true);
strDecodedHtml.Replace(wxT("ß"), wxT("ß"), true);
strDecodedHtml.Replace(wxT("à"), wxT("à"), true);
strDecodedHtml.Replace(wxT("á"), wxT("á"), true);
strDecodedHtml.Replace(wxT("â"), wxT("â"), true);
strDecodedHtml.Replace(wxT("ã"), wxT("ã"), true);
strDecodedHtml.Replace(wxT("ä"), wxT("ä"), true);
strDecodedHtml.Replace(wxT("å"), wxT("å"), true);
strDecodedHtml.Replace(wxT("æ"), wxT("æ"), true);
strDecodedHtml.Replace(wxT("ç"), wxT("ç"), true);
strDecodedHtml.Replace(wxT("è"), wxT("è"), true);
strDecodedHtml.Replace(wxT("é"), wxT("é"), true);
strDecodedHtml.Replace(wxT("ê"), wxT("ê"), true);
strDecodedHtml.Replace(wxT("ë"), wxT("ë"), true);
strDecodedHtml.Replace(wxT("ì"), wxT("ì"), true);
strDecodedHtml.Replace(wxT("í"), wxT("í"), true);
strDecodedHtml.Replace(wxT("î"), wxT("î"), true);
strDecodedHtml.Replace(wxT("ï"), wxT("ï"), true);
strDecodedHtml.Replace(wxT("ð"), wxT("ð"), true);
strDecodedHtml.Replace(wxT("ñ"), wxT("ñ"), true);
strDecodedHtml.Replace(wxT("ò"), wxT("ò"), true);
strDecodedHtml.Replace(wxT("ó"), wxT("ó"), true);
strDecodedHtml.Replace(wxT("ô"), wxT("ô"), true);
strDecodedHtml.Replace(wxT("õ"), wxT("õ"), true);
strDecodedHtml.Replace(wxT("ö"), wxT("ö"), true);
strDecodedHtml.Replace(wxT("÷"), wxT("÷"), true);
strDecodedHtml.Replace(wxT("ø"), wxT("ø"), true);
strDecodedHtml.Replace(wxT("ù"), wxT("ù"), true);
strDecodedHtml.Replace(wxT("ú"), wxT("ú"), true);
strDecodedHtml.Replace(wxT("û"), wxT("û"), true);
strDecodedHtml.Replace(wxT("ü"), wxT("ü"), true);
strDecodedHtml.Replace(wxT("ý"), wxT("ý"), true);
strDecodedHtml.Replace(wxT("þ"), wxT("þ"), true);
strDecodedHtml.Replace(wxT("ÿ"), wxT("ÿ"), true);
#endif
}
return strDecodedHtml;
}
|