diff --git a/DataViewer/DataViewerDeleteColDlg.cpp b/DataViewer/DataViewerDeleteColDlg.cpp index 7522e83eb..ecf15c891 100644 --- a/DataViewer/DataViewerDeleteColDlg.cpp +++ b/DataViewer/DataViewerDeleteColDlg.cpp @@ -106,7 +106,7 @@ void DataViewerDeleteColDlg::OnDelete( wxCommandEvent& ev ) int idx = selections[i]; wxString nm = name_to_nm[m_field->GetString(idx)]; int col = table_int->FindColId(nm); - wxLogMessage(nm); + wxLogMessage("%s", nm); try{ table_int->DeleteCol(col); diff --git a/DataViewer/DataViewerEditFieldPropertiesDlg.cpp b/DataViewer/DataViewerEditFieldPropertiesDlg.cpp index 68a96f83b..8f4351ff4 100644 --- a/DataViewer/DataViewerEditFieldPropertiesDlg.cpp +++ b/DataViewer/DataViewerEditFieldPropertiesDlg.cpp @@ -362,7 +362,7 @@ void DataViewerEditFieldPropertiesDlg::OnCellChanging( wxGridEvent& ev ) wxString msg; msg << "changing row " << row << ", col " << col << " from "; msg << cur_str << " to " << new_str; - wxLogMessage(msg); + wxLogMessage("%s", msg); GdaConst::FieldType type = GdaConst::unknown_type; wxString type_str = field_grid->GetCellValue(row, COL_T); diff --git a/DialogTools/AddIdVariable.cpp b/DialogTools/AddIdVariable.cpp index be1a6339b..6ae054e6f 100644 --- a/DialogTools/AddIdVariable.cpp +++ b/DialogTools/AddIdVariable.cpp @@ -92,7 +92,7 @@ void AddIdVariable::OnOkClick( wxCommandEvent& event ) return; } - wxLogMessage(wxString::Format("Try to insert unique id (integer, %s) column in table.", new_id_var_name)); + wxLogMessage("%s", wxString::Format("Try to insert unique id (integer, %s) column in table.", new_id_var_name)); int col_insert_pos = 0; int add_pos = table_int->InsertCol(GdaConst::long64_type,new_id_var_name, col_insert_pos); diff --git a/DialogTools/CatClassifDlg.cpp b/DialogTools/CatClassifDlg.cpp index f9dfd2e74..9dc0e8693 100644 --- a/DialogTools/CatClassifDlg.cpp +++ b/DialogTools/CatClassifDlg.cpp @@ -949,8 +949,8 @@ CatClassifState* CatClassifPanel::PromptNew(const CatClassifDef& ccd, } wxLogMessage("In CatClassifPanel::PromptNew"); - wxLogMessage(_("suggested title:") + suggested_title); - wxLogMessage(_("field name:") + field_name); + wxLogMessage("%s", _("suggested title:") + suggested_title); + wxLogMessage("%s", _("field name:") + field_name); if (success || (prompt_title_dlg == false && !new_title.IsEmpty()) ) { cc_data = ccd; @@ -1205,7 +1205,7 @@ void CatClassifPanel::OnAssocVarChoice(wxCommandEvent& ev) wxString cur_fc_str = assoc_var_choice->GetStringSelection(); - wxLogMessage(cur_fc_str); + wxLogMessage("%s", cur_fc_str); bool is_tm_var = table_int->IsColTimeVariant(cur_fc_str); if (is_tm_var) diff --git a/DialogTools/ConnectDatasourceDlg.cpp b/DialogTools/ConnectDatasourceDlg.cpp index 6e1355fda..195ffe0b3 100644 --- a/DialogTools/ConnectDatasourceDlg.cpp +++ b/DialogTools/ConnectDatasourceDlg.cpp @@ -773,7 +773,7 @@ void ConnectDatasourceDlg::OnOkClick( wxCommandEvent& event ) GdaFrame* gda_frame = GdaFrame::GetGdaFrame(); if (gda_frame) { gda_frame->OpenProject(ds_file_path.GetFullPath()); - wxLogMessage(_("Open project file:") + ds_file_path.GetFullPath()); + wxLogMessage("%s", _("Open project file:") + ds_file_path.GetFullPath()); try { Project* project = gda_frame->GetProject(); wxString layer_name; @@ -847,8 +847,8 @@ void ConnectDatasourceDlg::OnOkClick( wxCommandEvent& event ) if (layer_name.IsEmpty()) layer_name = layername; - wxLogMessage(_("Open Datasource:") + datasource->ToString()); - wxLogMessage(_("Open Layer:") + layername); + wxLogMessage("%s", _("Open Datasource:") + datasource->ToString()); + wxLogMessage("%s", _("Open Layer:") + layername); SaveRecentDataSource(datasource, layer_name); diff --git a/DialogTools/CreateGridDlg.cpp b/DialogTools/CreateGridDlg.cpp index 493f228b7..ea403fe8b 100644 --- a/DialogTools/CreateGridDlg.cpp +++ b/DialogTools/CreateGridDlg.cpp @@ -470,7 +470,7 @@ void CreateGridDlg::OnCEdit1Updated( wxCommandEvent& event ) wxLogMessage("In CreateGridDlg::OnCEdit1Updated()"); if (!isCreated) return; wxString input = m_lower_x->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToDouble(&m_xBot); EnableItems(); @@ -481,7 +481,7 @@ void CreateGridDlg::OnCEdit2Updated( wxCommandEvent& event ) wxLogMessage("In CreateGridDlg::OnCEdit2Updated()"); if (!isCreated) return; wxString input = m_lower_y->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToDouble(&m_yBot); EnableItems(); } @@ -491,7 +491,7 @@ void CreateGridDlg::OnCEdit3Updated( wxCommandEvent& event ) wxLogMessage("In CreateGridDlg::OnCEdit3Updated()"); if (!isCreated) return; wxString input = m_upper_x->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToDouble(&m_xTop); EnableItems(); } @@ -501,7 +501,7 @@ void CreateGridDlg::OnCEdit4Updated( wxCommandEvent& event ) wxLogMessage("In CreateGridDlg::OnCEdit4Updated()"); if (!isCreated) return; wxString input = m_upper_y->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToDouble(&m_yTop); EnableItems(); } diff --git a/DialogTools/CreatingWeightDlg.cpp b/DialogTools/CreatingWeightDlg.cpp index 916871f3a..96d14963c 100644 --- a/DialogTools/CreatingWeightDlg.cpp +++ b/DialogTools/CreatingWeightDlg.cpp @@ -568,8 +568,6 @@ void CreatingWeightDlg::OnCThresholdTextEdit( wxCommandEvent& event ) wxString val = m_threshold->GetValue(); val.Trim(false); val.Trim(true); - - wxLogMessage(val); int dist_var_type = m_nb_distance_variables->GetSelection(); if (dist_var_type == 0) { @@ -612,8 +610,6 @@ void CreatingWeightDlg::OnCBandwidthThresholdTextEdit( wxCommandEvent& event ) wxString val = m_manu_bandwidth->GetValue(); val.Trim(false); val.Trim(true); - - wxLogMessage(val); int dist_var_type = m_nb_distance_variables->GetSelection(); if (dist_var_type == 0) { @@ -661,18 +657,12 @@ void CreatingWeightDlg::OnCThresholdSliderUpdated( wxCommandEvent& event ) if (m_threshold_val > 0) { FindWindow(XRCID("wxID_OK"))->Enable(true); } - wxString str_val; - str_val << m_threshold_val; - wxLogMessage(str_val); } else { m_threshold_val_multivars = (m_sliderdistance->GetValue() * (m_thres_max_multivars-m_thres_min_multivars)/100.0) + m_thres_min_multivars; m_threshold->ChangeValue( wxString::Format("%f", (double) m_threshold_val_multivars)); if (m_threshold_val_multivars > 0) { FindWindow(XRCID("wxID_OK"))->Enable(true); } - wxString str_val; - str_val << m_threshold_val_multivars; - wxLogMessage(str_val); } } @@ -689,18 +679,12 @@ void CreatingWeightDlg::OnCBandwidthThresholdSliderUpdated( wxCommandEvent& even if (m_bandwidth_thres_val > 0) { m_btn_ok->Enable(true); } - wxString str_val; - str_val << m_bandwidth_thres_val; - wxLogMessage(str_val); } else { m_bandwidth_thres_val_multivars = (m_bandwidth_slider->GetValue() * (m_thres_max_multivars-m_thres_min_multivars)/100.0) + m_thres_min_multivars; m_manu_bandwidth->ChangeValue( wxString::Format("%f", (double) m_bandwidth_thres_val_multivars)); if (m_bandwidth_thres_val_multivars > 0) { m_btn_ok->Enable(true); } - wxString str_val; - str_val << m_bandwidth_thres_val_multivars; - wxLogMessage(str_val); } } @@ -1043,10 +1027,6 @@ void CreatingWeightDlg::OnXSelected(wxCommandEvent& event ) UpdateTmSelEnableState(); UpdateThresholdValues(); UpdateCreateButtonState(); - - wxString msg; - msg << _("selected:") << m_X->GetSelection(); - wxLogMessage(msg); } void CreatingWeightDlg::OnYSelected(wxCommandEvent& event ) @@ -1066,10 +1046,6 @@ void CreatingWeightDlg::OnYSelected(wxCommandEvent& event ) UpdateTmSelEnableState(); UpdateThresholdValues(); UpdateCreateButtonState(); - - wxString msg; - msg << "selected:" << m_Y->GetSelection(); - wxLogMessage(msg); } void CreatingWeightDlg::OnXTmSelected(wxCommandEvent& event ) @@ -1159,10 +1135,6 @@ void CreatingWeightDlg::OnIdVariableSelected( wxCommandEvent& event ) UpdateThresholdValuesMultiVars(); } UpdateCreateButtonState(); - - wxString msg; - msg << _("selected:") << m_id_field->GetSelection(); - wxLogMessage(msg); } double CreatingWeightDlg::GetBandwidth() @@ -1457,7 +1429,7 @@ void CreatingWeightDlg::CreateWeights() project->SetWorkingDir(new_dir); } wxLogMessage("CreateWeights()"); - wxLogMessage(outputfile); + wxLogMessage("%s", outputfile); // 1/2 case social weights: if (m_nb_weights_type->GetSelection() == 1 && diff --git a/DialogTools/ExportCsvDlg.cpp b/DialogTools/ExportCsvDlg.cpp index 5db3ef80f..cd7493061 100644 --- a/DialogTools/ExportCsvDlg.cpp +++ b/DialogTools/ExportCsvDlg.cpp @@ -103,7 +103,7 @@ void ExportCsvDlg::OnOkClick( wxCommandEvent& event ) } } - wxLogMessage(_("csv file:") + new_csv); + wxLogMessage("%s", _("csv file:") + new_csv); #ifdef __WIN32__ std::ofstream out_file(new_csv.wc_str(),std::ios::out | std::ios::binary); #else diff --git a/DialogTools/ExportDataDlg.cpp b/DialogTools/ExportDataDlg.cpp index b9bc837c4..db54197cc 100644 --- a/DialogTools/ExportDataDlg.cpp +++ b/DialogTools/ExportDataDlg.cpp @@ -336,7 +336,7 @@ void ExportDataDlg::OnOkClick( wxCommandEvent& event ) datasource_name = ds_name; GdaConst::DataSourceType ds_type = datasource->GetType(); - wxLogMessage(_("ds:") + ds_name); + wxLogMessage("%s", _("ds:") + ds_name); if (ds_name.length() <= 0 ) { wxMessageDialog dlg(this, _("Please specify a valid data source name."), _("Warning"), wxOK | wxICON_WARNING); diff --git a/DialogTools/FieldNameCorrectionDlg.cpp b/DialogTools/FieldNameCorrectionDlg.cpp index f340056fb..14d5964f9 100644 --- a/DialogTools/FieldNameCorrectionDlg.cpp +++ b/DialogTools/FieldNameCorrectionDlg.cpp @@ -424,7 +424,7 @@ wxString ScrolledWidgetsPane::TruncateFieldName(const wxString& old_name, int max_len) { wxLogMessage("ScrolledWidgetsPane::TruncateFieldName"); - wxLogMessage(old_name); + wxLogMessage("%s", old_name); if (GdaConst::datasrc_field_lens.find(ds_type) == GdaConst::datasrc_field_lens.end()) { @@ -446,14 +446,14 @@ wxString ScrolledWidgetsPane::TruncateFieldName(const wxString& old_name, new_name << old_name.substr(0, front_chars) << separator << old_name.substr(str_len - back_chars); - wxLogMessage(new_name); + wxLogMessage("%s", new_name); return new_name; } wxString ScrolledWidgetsPane::RemoveIllegalChars(const wxString& old_name) { wxLogMessage("ScrolledWidgetsPane::RemoveIllegalChars"); - wxLogMessage(old_name); + wxLogMessage("%s", old_name); if (GdaConst::datasrc_field_illegal_regex.find(ds_type) == GdaConst::datasrc_field_illegal_regex.end()) { @@ -469,7 +469,7 @@ wxString ScrolledWidgetsPane::RemoveIllegalChars(const wxString& old_name) if (new_name.size()==0) new_name = "NONAME"; - wxLogMessage(new_name); + wxLogMessage("%s", new_name); return new_name; } @@ -477,7 +477,7 @@ wxString ScrolledWidgetsPane::RemoveIllegalChars(const wxString& old_name) wxString ScrolledWidgetsPane::RenameDupFieldName(const wxString& old_name) { wxLogMessage("ScrolledWidgetsPane::RenameDupFieldName"); - wxLogMessage(old_name); + wxLogMessage("%s", old_name); wxString new_name(old_name); @@ -509,14 +509,14 @@ wxString ScrolledWidgetsPane::RenameDupFieldName(const wxString& old_name) new_name = first_part + "_" + last_part; } } - wxLogMessage(new_name); + wxLogMessage("%s", new_name); return new_name; } bool ScrolledWidgetsPane::IsFieldNameValid(const wxString& col_name) { wxLogMessage("ScrolledWidgetsPane::IsFieldNameValid"); - //wxLogMessage(col_name); + //wxLogMessage("%s", col_name); if ( GdaConst::datasrc_field_lens.find(ds_type) == GdaConst::datasrc_field_lens.end() ) diff --git a/DialogTools/FieldNewCalcSheetDlg.cpp b/DialogTools/FieldNewCalcSheetDlg.cpp index 63319f30f..d83604e85 100644 --- a/DialogTools/FieldNewCalcSheetDlg.cpp +++ b/DialogTools/FieldNewCalcSheetDlg.cpp @@ -102,7 +102,7 @@ void FieldNewCalcSheetDlg::CreateControls() { wxXmlResource::Get()->LoadDialog(this, GetParent(), "IDD_FIELDCALC_SHEET"); m_note = XRCCTRL(*this, "ID_NOTEBOOK", wxNotebook); -} +} void FieldNewCalcSheetDlg::OnPageChange( wxBookCtrlEvent& event ) { @@ -122,25 +122,22 @@ void FieldNewCalcSheetDlg::OnPageChange( wxBookCtrlEvent& event ) else if (tab_idx == 5) var_sel_idx = pDT->m_result->GetCurrentSelection(); - { + { /* - pSpecial->m_result->SetSelection(var_sel_idx); + pSpecial->m_result->SetSelection(var_sel_idx); pSpecial->InitFieldChoices(); - pUni->m_result->SetSelection(var_sel_idx); + pUni->m_result->SetSelection(var_sel_idx); pUni->InitFieldChoices(); - pBin->m_result->SetSelection(var_sel_idx); + pBin->m_result->SetSelection(var_sel_idx); pBin->InitFieldChoices(); - pLag->m_result->SetSelection(var_sel_idx); + pLag->m_result->SetSelection(var_sel_idx); pLag->InitFieldChoices(); - pRate->m_result->SetSelection(var_sel_idx); + pRate->m_result->SetSelection(var_sel_idx); pRate->InitFieldChoices(); - pDT->m_result->SetSelection(var_sel_idx); - pDT->InitFieldChoices(); + pDT->m_result->SetSelection(var_sel_idx); + pDT->InitFieldChoices(); */ } - wxString msg; - msg << "page idx: " << var_sel_idx; - wxLogMessage(msg); } void FieldNewCalcSheetDlg::OnApplyClick( wxCommandEvent& event ) diff --git a/DialogTools/RegressionDlg.cpp b/DialogTools/RegressionDlg.cpp index 93388988a..d92f94940 100644 --- a/DialogTools/RegressionDlg.cpp +++ b/DialogTools/RegressionDlg.cpp @@ -278,7 +278,7 @@ void RegressionDlg::OnRunClick( wxCommandEvent& event ) wxString m_Yname = m_dependent->GetValue(); - wxLogMessage(_("y:") + m_Yname); + wxLogMessage("%s", _("y:") + m_Yname); // Y and X's data //wxString st; @@ -305,7 +305,7 @@ void RegressionDlg::OnRunClick( wxCommandEvent& event ) for (int i=0; i < m_independentlist->GetCount(); i++) { wxString nm = name_to_nm[m_independentlist->GetString(i)]; - wxLogMessage(nm); + wxLogMessage("%s", nm); int col = table_int->FindColId(nm); if (col == wxNOT_FOUND) { @@ -839,7 +839,7 @@ void RegressionDlg::SetupXNames(bool m_constant_term) } void RegressionDlg::OnViewResultsClick( wxCommandEvent& event ) { - wxLogMessage(_("Click RegressionDlg::OnViewResultsClick")); + wxLogMessage("Click RegressionDlg::OnViewResultsClick"); if (m_OpenDump) { GdaFrame::GetGdaFrame()->DisplayRegression(logReport); } @@ -847,7 +847,7 @@ void RegressionDlg::OnViewResultsClick( wxCommandEvent& event ) void RegressionDlg::OnSaveToTxtFileClick( wxCommandEvent& event ) { - wxLogMessage(_("Click RegressionDlg::OnSaveToTxtFileClick")); + wxLogMessage("Click RegressionDlg::OnSaveToTxtFileClick"); if (!m_OpenDump) return; diff --git a/DialogTools/ReportBugDlg.cpp b/DialogTools/ReportBugDlg.cpp index a58315b7f..834da112d 100644 --- a/DialogTools/ReportBugDlg.cpp +++ b/DialogTools/ReportBugDlg.cpp @@ -318,7 +318,7 @@ void ReportBugDlg::OnOkClick(wxCommandEvent& event) wxLogMessage("Submit Bug Report Error:"); wxLogMessage("title:"); - wxLogMessage(title); + wxLogMessage("%s", title); } void ReportBugDlg::OnCancelClick(wxCommandEvent& event) diff --git a/DialogTools/VariableSettingsDlg.cpp b/DialogTools/VariableSettingsDlg.cpp index 5d1428845..1a3c31bc0 100644 --- a/DialogTools/VariableSettingsDlg.cpp +++ b/DialogTools/VariableSettingsDlg.cpp @@ -354,7 +354,7 @@ all_init(false), var1_str(_var1_str), var2_str(_var2_str), var3_str(_var3_str), -var4_str(_var4_str), +var4_str(_var4_str), style(0) { wxLogMessage("Open VariableSettingsDlg"); @@ -378,61 +378,61 @@ style(0) Centre(); all_init = true; } - -VariableSettingsDlg::VariableSettingsDlg(Project* project_s, - VarType v_type_s, - int style_s, - const wxString& title_s, - const wxString& var1_title_s, - const wxString& var2_title_s, - const wxString& var3_title_s, - const wxString& var4_title_s) -: project(project_s), -table_int(project_s->GetTableInt()), -no_weights_found_fail(false), -is_time(project_s->GetTableInt()->IsTimeVariant()), -time_steps(project_s->GetTableInt()->GetTimeSteps()), -title(title_s), -var1_title(var1_title_s), -var2_title(var2_title_s), -var3_title(var3_title_s), -var4_title(var4_title_s), -num_cats_spin(0), -num_categories(4), -hide_time(!(style & SHOW_TIME)), -all_init(false), -style(style_s), -show_weights(style & SHOW_WEIGHTS), -show_distance(style & SHOW_DISTANCE), -set_second_from_first_mode(style & SET_SECOND_FROM_FIRST), -set_fourth_from_third_mode(style & SET_FOURTH_FROM_THIRD), -var1_str(style & ALLOW_STRING_IN_FIRST), -var2_str(style & ALLOW_STRING_IN_SECOND), -var3_str(style & ALLOW_STRING_IN_THIRD), -var4_str(style & ALLOW_STRING_IN_FOURTH) -{ - wxLogMessage("Open VariableSettingsDlg"); - - default_var_name1 = project->GetDefaultVarName(0); - default_var_name2 = project->GetDefaultVarName(1); - default_var_name3 = project->GetDefaultVarName(2); - default_var_name4 = project->GetDefaultVarName(3); - - if (show_weights && project->GetWManInt()->GetIds().size() == 0) { - no_weights_found_fail = true; - wxXmlResource::Get()->LoadDialog(this, GetParent(), - "ID_VAR_SETTINGS_NO_W_FAIL_DLG"); - SetTitle("No Weights Found"); - } else { - Init(v_type_s); - } - SetParent(0); - GetSizer()->Fit(this); - GetSizer()->SetSizeHints(this); - Centre(); - all_init = true; -} - + +VariableSettingsDlg::VariableSettingsDlg(Project* project_s, + VarType v_type_s, + int style_s, + const wxString& title_s, + const wxString& var1_title_s, + const wxString& var2_title_s, + const wxString& var3_title_s, + const wxString& var4_title_s) +: project(project_s), +table_int(project_s->GetTableInt()), +no_weights_found_fail(false), +is_time(project_s->GetTableInt()->IsTimeVariant()), +time_steps(project_s->GetTableInt()->GetTimeSteps()), +title(title_s), +var1_title(var1_title_s), +var2_title(var2_title_s), +var3_title(var3_title_s), +var4_title(var4_title_s), +num_cats_spin(0), +num_categories(4), +hide_time(!(style & SHOW_TIME)), +all_init(false), +style(style_s), +show_weights(style & SHOW_WEIGHTS), +show_distance(style & SHOW_DISTANCE), +set_second_from_first_mode(style & SET_SECOND_FROM_FIRST), +set_fourth_from_third_mode(style & SET_FOURTH_FROM_THIRD), +var1_str(style & ALLOW_STRING_IN_FIRST), +var2_str(style & ALLOW_STRING_IN_SECOND), +var3_str(style & ALLOW_STRING_IN_THIRD), +var4_str(style & ALLOW_STRING_IN_FOURTH) +{ + wxLogMessage("Open VariableSettingsDlg"); + + default_var_name1 = project->GetDefaultVarName(0); + default_var_name2 = project->GetDefaultVarName(1); + default_var_name3 = project->GetDefaultVarName(2); + default_var_name4 = project->GetDefaultVarName(3); + + if (show_weights && project->GetWManInt()->GetIds().size() == 0) { + no_weights_found_fail = true; + wxXmlResource::Get()->LoadDialog(this, GetParent(), + "ID_VAR_SETTINGS_NO_W_FAIL_DLG"); + SetTitle("No Weights Found"); + } else { + Init(v_type_s); + } + SetParent(0); + GetSizer()->Fit(this); + GetSizer()->SetSizeHints(this); + Centre(); + all_init = true; +} + VariableSettingsDlg::~VariableSettingsDlg() { @@ -764,7 +764,7 @@ void VariableSettingsDlg::OnVar1Change(wxCommandEvent& event) { if (!all_init) return; - lb1_cur_sel = lb1->GetSelection(); + lb1_cur_sel = lb1->GetSelection(); if (lb1_cur_sel >= 0) { int x_pos = sel1_idx_map[lb1_cur_sel]; @@ -785,7 +785,7 @@ void VariableSettingsDlg::OnVar2Change(wxCommandEvent& event) { if (!all_init) return; - lb2_cur_sel = lb2->GetSelection(); + lb2_cur_sel = lb2->GetSelection(); if (lb2_cur_sel >= 0) { int x_pos = sel2_idx_map[lb2_cur_sel]; @@ -846,22 +846,22 @@ void VariableSettingsDlg::OnCancelClick(wxCommandEvent& event) event.Skip(); EndDialog(wxID_CANCEL); } - -bool VariableSettingsDlg::IsFirstVariableEmpty() -{ - if (style & ALLOW_EMPTY_IN_FIRST) { - return lb1->GetSelection() == 0; - } - return false; -} - -bool VariableSettingsDlg::IsSecondVariableEmpty() -{ - if (style & ALLOW_EMPTY_IN_SECOND) { - return lb2->GetSelection() == 0; - } - return false; -} + +bool VariableSettingsDlg::IsFirstVariableEmpty() +{ + if (style & ALLOW_EMPTY_IN_FIRST) { + return lb1->GetSelection() == 0; + } + return false; +} + +bool VariableSettingsDlg::IsSecondVariableEmpty() +{ + if (style & ALLOW_EMPTY_IN_SECOND) { + return lb2->GetSelection() == 0; + } + return false; +} void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) { @@ -871,15 +871,15 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) EndDialog(wxID_CANCEL); return; } - - if ((style & ALLOW_EMPTY_IN_FIRST) && (style & ALLOW_EMPTY_IN_SECOND)) { - if (lb1->GetSelection() == 0 && lb2->GetSelection() == 0) { - wxString msg(_("No field chosen for first and second variable.")); - wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR); - dlg.ShowModal(); - return; - } - } + + if ((style & ALLOW_EMPTY_IN_FIRST) && (style & ALLOW_EMPTY_IN_SECOND)) { + if (lb1->GetSelection() == 0 && lb2->GetSelection() == 0) { + wxString msg(_("No field chosen for first and second variable.")); + wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR); + dlg.ShowModal(); + return; + } + } if (map_theme_ch) { m_theme = map_theme_ch->GetSelection(); @@ -902,7 +902,7 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) if (!table_int->IsColTimeVariant(v1_col_id)) v1_time = 0; } - wxLogMessage(v1_name); + wxLogMessage("%s", v1_name); if (num_var >= 2) { if (lb2->GetSelection() == wxNOT_FOUND) { @@ -910,7 +910,7 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) wxMessageDialog dlg (this, msg, _("Error"), wxOK | wxICON_ERROR); dlg.ShowModal(); return; - } + } int sel_idx = lb2->GetSelection(); v2_col_id = col_id_map[sel2_idx_map[sel_idx]]; v2_name = table_int->GetColName(v2_col_id); @@ -921,7 +921,7 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) if (!table_int->IsColTimeVariant(v2_col_id)) v2_time = 0; } - wxLogMessage(v2_name); + wxLogMessage("%s", v2_name); } if (num_var >= 3) { if (lb3->GetSelection() == wxNOT_FOUND) { @@ -939,7 +939,7 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) if (!table_int->IsColTimeVariant(v3_col_id)) v3_time = 0; } - wxLogMessage(v3_name); + wxLogMessage("%s", v3_name); } if (num_var >= 4) { if (lb4->GetSelection() == wxNOT_FOUND) { @@ -957,7 +957,7 @@ void VariableSettingsDlg::OnOkClick(wxCommandEvent& event) if (!table_int->IsColTimeVariant(v4_col_id)) v4_time = 0; } - wxLogMessage(v4_name); + wxLogMessage("%s", v4_name); } wxString emptyVar = FillData(); @@ -1036,7 +1036,7 @@ boost::uuids::uuid VariableSettingsDlg::GetWeightsId() wxString s; s << "VariableSettingsDlg::GetWeightsId() weight: "; s << project->GetWManInt()->GetShortDispName(weights_ids[sel]); - wxLogMessage(s); + wxLogMessage("%s", s); return weights_ids[sel]; } @@ -1134,16 +1134,16 @@ void VariableSettingsDlg::InitFieldChoices() int sel2_idx = 0; int sel3_idx = 0; int sel4_idx = 0; - - if (style & ALLOW_EMPTY_IN_FIRST) { - lb1->Append(" "); // empty selection - sel1_idx += 1; - } - - if (style & ALLOW_EMPTY_IN_SECOND) { - lb2->Append(" "); // empty selection - sel2_idx += 1; - } + + if (style & ALLOW_EMPTY_IN_FIRST) { + lb1->Append(" "); // empty selection + sel1_idx += 1; + } + + if (style & ALLOW_EMPTY_IN_SECOND) { + lb2->Append(" "); // empty selection + sel2_idx += 1; + } for (int i=0, iend=col_id_map.size(); iGetColType(col_id_map[i]); @@ -1165,7 +1165,7 @@ void VariableSettingsDlg::InitFieldChoices() if (num_var >= 2) { wxString name = table_int->GetColName(col_id_map[i]); if (table_int->IsColTimeVariant(col_id_map[i])) { - name << t2; + name << t2; } if ((var2_str) || (!var2_str && ftype == GdaConst::double_type) || @@ -1181,7 +1181,7 @@ void VariableSettingsDlg::InitFieldChoices() if (num_var >= 3) { wxString name = table_int->GetColName(col_id_map[i]); if (table_int->IsColTimeVariant(col_id_map[i])) { - name << t3; + name << t3; } if ((var3_str) || (!var3_str && ftype == GdaConst::double_type) || @@ -1197,7 +1197,7 @@ void VariableSettingsDlg::InitFieldChoices() if (num_var >= 4) { wxString name = table_int->GetColName(col_id_map[i]); if (table_int->IsColTimeVariant(col_id_map[i])) { - name << t4; + name << t4; } if ((var4_str) || (!var4_str && ftype == GdaConst::double_type) || @@ -1215,9 +1215,9 @@ void VariableSettingsDlg::InitFieldChoices() for (int i=0, iend=col_id_map.size(); iGetColName(col_id_map[i]); if (item_str == default_var_name1) { - lb1_cur_sel = idx_sel1_map[i]; - if (style & ALLOW_EMPTY_IN_FIRST) { - //lb1_cur_sel = lb1_cur_sel > 0 ? lb1_cur_sel + 1 : 0; + lb1_cur_sel = idx_sel1_map[i]; + if (style & ALLOW_EMPTY_IN_FIRST) { + //lb1_cur_sel = lb1_cur_sel > 0 ? lb1_cur_sel + 1 : 0; } if (set_second_from_first_mode && num_var >= 2) { lb2_cur_sel = lb1_cur_sel; @@ -1225,9 +1225,9 @@ void VariableSettingsDlg::InitFieldChoices() } if (num_var >= 2 && item_str == default_var_name2) { if (!set_second_from_first_mode) { - lb2_cur_sel = idx_sel2_map[i]; - if (style & ALLOW_EMPTY_IN_SECOND) { - //lb2_cur_sel = lb2_cur_sel > 0 ? lb2_cur_sel + 1 : 0; + lb2_cur_sel = idx_sel2_map[i]; + if (style & ALLOW_EMPTY_IN_SECOND) { + //lb2_cur_sel = lb2_cur_sel > 0 ? lb2_cur_sel + 1 : 0; } } } @@ -1282,19 +1282,19 @@ bool VariableSettingsDlg::CheckEmptyColumn(int col_id, int time) wxString VariableSettingsDlg::FillData() { wxString emptyVar; - + col_ids.resize(num_var); var_info.resize(num_var); - if (num_var >= 1) { - var_info[0].is_hide = false; - int sel_idx = lb1->GetSelection(); - if (style & ALLOW_EMPTY_IN_FIRST) { - if (sel_idx == 0) { - // no selection: case ConditionalMap, - sel_idx = table_int->GetFirstNumericCol(); - var_info[0].is_hide = true; - } + if (num_var >= 1) { + var_info[0].is_hide = false; + int sel_idx = lb1->GetSelection(); + if (style & ALLOW_EMPTY_IN_FIRST) { + if (sel_idx == 0) { + // no selection: case ConditionalMap, + sel_idx = table_int->GetFirstNumericCol(); + var_info[0].is_hide = true; + } } int col_idx = sel1_idx_map[sel_idx]; v1_col_id = col_id_map[col_idx]; @@ -1306,24 +1306,24 @@ wxString VariableSettingsDlg::FillData() emptyVar = v1_name; } } - if (num_var >= 2) { - var_info[1].is_hide = false; - int sel_idx = lb2->GetSelection(); - if (style & ALLOW_EMPTY_IN_SECOND) { - if (sel_idx == 0) { - // no selection: case ConditionalMap, - sel_idx = table_int->GetFirstNumericCol(); - var_info[1].is_hide = true; - } - } - int col_idx = sel2_idx_map[sel_idx]; - v2_col_id = col_id_map[col_idx]; - v2_name = table_int->GetColName(v2_col_id); - col_ids[1] = v2_col_id; - var_info[1].time = v2_time; - - if (emptyVar.empty() && CheckEmptyColumn(v2_col_id, v2_time)) { - emptyVar = v2_name; + if (num_var >= 2) { + var_info[1].is_hide = false; + int sel_idx = lb2->GetSelection(); + if (style & ALLOW_EMPTY_IN_SECOND) { + if (sel_idx == 0) { + // no selection: case ConditionalMap, + sel_idx = table_int->GetFirstNumericCol(); + var_info[1].is_hide = true; + } + } + int col_idx = sel2_idx_map[sel_idx]; + v2_col_id = col_id_map[col_idx]; + v2_name = table_int->GetColName(v2_col_id); + col_ids[1] = v2_col_id; + var_info[1].time = v2_time; + + if (emptyVar.empty() && CheckEmptyColumn(v2_col_id, v2_time)) { + emptyVar = v2_name; } } if (num_var >= 3) { diff --git a/DialogTools/nbrMatchDlg.cpp b/DialogTools/nbrMatchDlg.cpp index 6edc44504..47fd4b378 100644 --- a/DialogTools/nbrMatchDlg.cpp +++ b/DialogTools/nbrMatchDlg.cpp @@ -1549,7 +1549,7 @@ void LocalMatchSignificanceFrame::OnSpecifySeedDlg(wxCommandEvent& event) if (dlg.ShowModal() != wxID_OK) return; dlg_val = dlg.GetValue(); - wxLogMessage(dlg_val); + //wxLogMessage(dlg_val); dlg_val.Trim(true); dlg_val.Trim(false); diff --git a/Explore/AbstractClusterMap.cpp b/Explore/AbstractClusterMap.cpp index e3434b65e..f604a2c8a 100644 --- a/Explore/AbstractClusterMap.cpp +++ b/Explore/AbstractClusterMap.cpp @@ -592,7 +592,7 @@ void AbstractMapFrame::OnRanOtherPer(wxCommandEvent& event) long num; wxString input = dlg.m_number->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToLong(&num); RanXPer(num); diff --git a/Explore/ConditionalNewView.cpp b/Explore/ConditionalNewView.cpp index 539766cc0..67b13bb26 100644 --- a/Explore/ConditionalNewView.cpp +++ b/Explore/ConditionalNewView.cpp @@ -104,7 +104,6 @@ full_map_redraw_needed(true) } table_int->GetColUndefined(col_ids[i], data_undef[i]); template_frame->AddGroupDependancy(var_info[i].name); - wxLogMessage(var_info[i].name); } //setup horizontal data diff --git a/Explore/CorrelogramAlgs.cpp b/Explore/CorrelogramAlgs.cpp index 767013d4d..5111d216f 100644 --- a/Explore/CorrelogramAlgs.cpp +++ b/Explore/CorrelogramAlgs.cpp @@ -274,13 +274,7 @@ bool CorrelogramAlgs::MakeCorrAllPairs(const std::vector& pts, out[b].corr_avg /= ((double) out[b].num_pairs); } } - - /* - stringstream ss; - ss << "MakeCorrMakeCorrAllPairs with " << pairs - << " pairs finished in " << sw.Time() << " ms."; - wxLogMessage(ss.str()); - */ + wxLogMessage("Exiting CorrelogramAlgs::MakeCorrAllPairs"); return true; } @@ -364,12 +358,6 @@ bool CorrelogramAlgs::MakeCorrThresh(const rtree_pt_2d_t& rtree, } } - /* - stringstream ss; - ss << "MakeCorrThresh with threshold " << thresh - << " finished in " << sw.Time() << " ms."; - wxLogMessage(ss.str()); - */ wxLogMessage("Exiting CorrelogramAlgs::MakeCorrThresh (plane)"); return true; } @@ -457,13 +445,7 @@ bool CorrelogramAlgs::MakeCorrThresh(const rtree_pt_3d_t& rtree, out[b].corr_avg /= ((double) out[b].num_pairs); } } - - /* - stringstream ss; - ss << "MakeCorrThresh with threshold " << thresh - << " finished in " << sw.Time() << " ms."; - wxLogMessage(ss.str()); - */ + wxLogMessage("Exiting CorrelogramAlgs::MakeCorrThresh (sphere)"); return true; } diff --git a/Explore/GetisOrdMapNewView.cpp b/Explore/GetisOrdMapNewView.cpp index 02d549ae1..373b4cf72 100644 --- a/Explore/GetisOrdMapNewView.cpp +++ b/Explore/GetisOrdMapNewView.cpp @@ -688,9 +688,7 @@ void GetisOrdMapFrame::OnRanOtherPer(wxCommandEvent& event) if (dlg.ShowModal() == wxID_OK) { long num; wxString input = dlg.m_number->GetValue(); - - wxLogMessage(input); - + input.ToLong(&num); RanXPer(num); } @@ -717,9 +715,7 @@ void GetisOrdMapFrame::OnSpecifySeedDlg(wxCommandEvent& event) wxTextEntryDialog dlg(NULL, m, "\nEnter a seed value", cur_val); if (dlg.ShowModal() != wxID_OK) return; dlg_val = dlg.GetValue(); - - wxLogMessage(dlg_val); - + dlg_val.Trim(true); dlg_val.Trim(false); if (dlg_val.IsEmpty()) return; diff --git a/Explore/LineChartView.cpp b/Explore/LineChartView.cpp index a9d44e0fc..c5e4a8632 100644 --- a/Explore/LineChartView.cpp +++ b/Explore/LineChartView.cpp @@ -404,9 +404,7 @@ void LineChartFrame::OnSelectionChange() TableInterface* table_int = project->GetTableInt(); wxString col_name = variable_names[var_selection]; int col = table_int->FindColId(col_name); - - wxLogMessage(wxString::Format("var: %s, time1:%d, time2:%d, group1:%d, group2:%d", col_name, time1, time2, group1, group2)); - + std::vector min_vals; std::vector max_vals; table_int->GetMinMaxVals(col, min_vals, max_vals); @@ -605,7 +603,6 @@ void LineChartFrame::OnGroupsChoice(wxCommandEvent& event) return; wxString col_name = variable_names[variable_selection]; - wxLogMessage(_("var name:") + col_name); TableInterface* table_int = project->GetTableInt(); if (!table_int->IsColTimeVariant(col_name) ||table_int->GetTimeSteps() <= 1) { diff --git a/Explore/LisaCoordinator.cpp b/Explore/LisaCoordinator.cpp index 19de454bd..2105a4811 100644 --- a/Explore/LisaCoordinator.cpp +++ b/Explore/LisaCoordinator.cpp @@ -583,7 +583,7 @@ void LisaCoordinator::CalcPseudoP() CalcPseudoP_threaded(); } } - wxLogMessage(wxString::Format("GPU took %ld ms", sw_vd.Time())); + LOG_MSG(wxString::Format("GPU took %ld ms", sw_vd.Time())); } void LisaCoordinator::ComputeLarger(int cnt, std::vector& permNeighbors, std::vector& countLarger) diff --git a/Explore/LisaScatterPlotView.cpp b/Explore/LisaScatterPlotView.cpp index 80e0c50ef..131b3d1ff 100644 --- a/Explore/LisaScatterPlotView.cpp +++ b/Explore/LisaScatterPlotView.cpp @@ -1154,7 +1154,6 @@ void LisaScatterPlotFrame::OnRanOtherPer(wxCommandEvent& event) if (dlg.ShowModal() == wxID_OK) { long num; wxString input = dlg.m_number->GetValue(); - wxLogMessage(input); input.ToLong(&num); RanXPer(num); } diff --git a/Explore/LocalGearyMapNewView.cpp b/Explore/LocalGearyMapNewView.cpp index af0c0a073..0541897d0 100644 --- a/Explore/LocalGearyMapNewView.cpp +++ b/Explore/LocalGearyMapNewView.cpp @@ -761,7 +761,7 @@ void LocalGearyMapFrame::RanXPer(int permutation) { wxString msg; msg << "Entering LocalGearyMapFrame::RanXPer() " << permutation; - wxLogMessage(msg); + wxLogMessage("%s", msg); if (permutation < 9) permutation = 9; if (permutation > 99999) permutation = 99999; @@ -800,7 +800,7 @@ void LocalGearyMapFrame::OnRanOtherPer(wxCommandEvent& event) wxString input = dlg.m_number->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToLong(&num); RanXPer(num); @@ -832,9 +832,7 @@ void LocalGearyMapFrame::OnSpecifySeedDlg(wxCommandEvent& event) wxTextEntryDialog dlg(NULL, m, _("Enter a seed value"), cur_val); if (dlg.ShowModal() != wxID_OK) return; dlg_val = dlg.GetValue(); - - wxLogMessage(dlg_val); - + dlg_val.Trim(true); dlg_val.Trim(false); if (dlg_val.IsEmpty()) return; @@ -855,7 +853,7 @@ void LocalGearyMapFrame::SetSigFilterX(int filter) { wxString msg; msg << "Entering LocalGearyMapFrame::SetSigFilterX() " << filter; - wxLogMessage(msg); + wxLogMessage("%s", msg); if (filter == local_geary_coord->GetSignificanceFilter()) return; local_geary_coord->SetSignificanceFilter(filter); diff --git a/Explore/MLJCMapNewView.cpp b/Explore/MLJCMapNewView.cpp index c64b8f2ae..c0ac7b55c 100644 --- a/Explore/MLJCMapNewView.cpp +++ b/Explore/MLJCMapNewView.cpp @@ -642,7 +642,7 @@ void MLJCMapFrame::OnRanOtherPer(wxCommandEvent& event) long num; wxString input = dlg.m_number->GetValue(); - wxLogMessage(input); + wxLogMessage("%s", input); input.ToLong(&num); RanXPer(num); @@ -671,7 +671,7 @@ void MLJCMapFrame::OnSpecifySeedDlg(wxCommandEvent& event) if (dlg.ShowModal() != wxID_OK) return; dlg_val = dlg.GetValue(); - wxLogMessage(dlg_val); + wxLogMessage("%s", dlg_val); dlg_val.Trim(true); dlg_val.Trim(false); diff --git a/Explore/MapLayoutView.cpp b/Explore/MapLayoutView.cpp index 7bf016fbc..dd5ea79d5 100644 --- a/Explore/MapLayoutView.cpp +++ b/Explore/MapLayoutView.cpp @@ -557,7 +557,6 @@ void CanvasLayoutDialog::SaveToPS(wxString path) int w, h; dc.GetSize(&w, &h); // A4 paper like? - wxLogMessage(wxString::Format("wxPostScriptDC GetSize = (%d,%d)", w, h)); if (dc.IsOk()) { dc.StartDoc("printing..."); diff --git a/GeoDa.cpp b/GeoDa.cpp index f4615ff08..adbc93429 100644 --- a/GeoDa.cpp +++ b/GeoDa.cpp @@ -408,7 +408,7 @@ bool GdaApp::OnInit(void) Gda::version_build, Gda::version_subbuild); wxLogMessage(versionlog); - wxLogMessage(loggerFile); + wxLogMessage("%s", loggerFile); if (!cmd_line_proj_file_name.IsEmpty()) { @@ -453,7 +453,7 @@ void GdaApp::OnInitCmdLine(wxCmdLineParser& parser) void GdaApp::MacOpenFiles(const wxArrayString& fileNames) { wxLogMessage("MacOpenFiles"); - wxLogMessage(fileNames[0]); + wxLogMessage("%s", fileNames[0]); int sz=fileNames.GetCount(); if (sz > 0) { @@ -1198,7 +1198,7 @@ void GdaFrame::OnRecentDSClick(wxCommandEvent& event) if (ds_name.IsEmpty()) return; - wxLogMessage(ds_name); + wxLogMessage("%s", ds_name); if (ds_name.EndsWith(".gda")) { OpenProject(ds_name); @@ -1344,7 +1344,7 @@ void GdaFrame::ShowOpenDatasourceDlg(wxPoint pos, bool init) void GdaFrame::OpenProject(const wxString& full_proj_path) { wxLogMessage("GdaFrame::OpenProject()"); - wxLogMessage(full_proj_path); + wxLogMessage("%s", full_proj_path); wxString msg; wxFileName fn(full_proj_path); @@ -1556,7 +1556,7 @@ void GdaFrame::OnSaveAsProject(wxCommandEvent& event) dlg.ShowModal(); return; } - wxLogMessage(_("Wrote GeoDa Project File: ") + proj_fname); + wxLogMessage("%s", _("Wrote GeoDa Project File: ") + proj_fname); } void GdaFrame::OnSelectWithRect(wxCommandEvent& event) diff --git a/Project.cpp b/Project.cpp index ff48861a3..3a366bac5 100644 --- a/Project.cpp +++ b/Project.cpp @@ -93,7 +93,7 @@ sourceSR(NULL), rtree_bbox_ready(false), has_null_geometry(false) { wxLogMessage("Entering Project::Project (existing project)"); - wxLogMessage(proj_fname); + wxLogMessage("%s", proj_fname); SetProjectFullPath(proj_fname); bool wd_success = SetWorkingDir(proj_fname); @@ -1610,7 +1610,7 @@ bool Project::InitFromOgrLayer() wxLogMessage("Datasource name:"); wxString ds_str = datasource->ToString(); - wxLogMessage(ds_str); + wxLogMessage("%s", ds_str); GdaConst::DataSourceType ds_type = datasource->GetType(); OGRDataAdapter& ogr_adapter = OGRDataAdapter::GetInstance(); @@ -1891,7 +1891,7 @@ bool Project::IsTableOnlyProject() void Project::SetupEncoding(wxString encode_str) { wxLogMessage("Project::SetupEncoding()"); - wxLogMessage(encode_str); + wxLogMessage("%s", encode_str); if (table_int == NULL || encode_str.IsEmpty() ) return;