1 #include "frmSearchAccounts.h"
2 #include "../frmMain.h"
4 frmSearchAccounts::frmSearchAccounts( wxWindow* parent )
6 frmSearchAccountsADT( parent )
11 frmSearchAccounts::~frmSearchAccounts(){
15 void frmSearchAccounts::LoadSearchAccounts(std::map<wxString, bool> *SearchAccounts,
16 std::map<wxString, wxString> *SearchAccountsList)
19 SAPtr = SearchAccounts;
20 SALPtr = SearchAccountsList;
21 std::map<wxString, wxString>::iterator SALiter;
24 // Load the search accounts into the Checklist.
26 wxArrayString AccList;
28 for (std::map<wxString, bool>::iterator iter = SAPtr->begin();
29 iter != SAPtr->end(); ++iter){
31 SALiter = SALPtr->find(iter->first);
33 AccList.Add(SALiter->second, 1);
37 chlAccounts->Append(AccList);
38 //chlAccounts->SetSelection(wxNOT_FOUND);
40 // Check if each account is selected.
42 for (int i = 0; i < chlAccounts->GetCount(); i++){
44 AccDir = chlAccounts->GetString(i);
46 for (std::map<wxString, bool>::iterator iter = SAPtr->begin();
47 iter != SAPtr->end(); ++iter){
49 SALiter = SALPtr->find(iter->first);
51 if (AccDir == SALiter->second){
53 chlAccounts->Check(i, iter->second);
63 void frmSearchAccounts::UpdateSelectedAccounts( wxCommandEvent& event )
66 // Process each of the items in the Checklist box.
67 // Compare each with the ones in the std::map
68 // and adjust the bool value accordingly.
71 std::map<wxString, wxString>::iterator SALiter;
73 for (int i = 0; i < chlAccounts->GetCount(); i++){
75 AccDir = chlAccounts->GetString(i);
77 for (std::map<wxString, bool>::iterator iter = SAPtr->begin();
78 iter != SAPtr->end(); ++iter){
80 SALiter = SALPtr->find(iter->first);
82 if (AccDir == SALiter->second){
84 iter->second = chlAccounts->IsChecked(i);
96 void frmSearchAccounts::CloseWindow( wxCommandEvent& event )