MCPcopy Create free account
hub / github.com/GeoDaCenter/geoda / AddTimeVariantOptionsToMenu

Method AddTimeVariantOptionsToMenu

Explore/BoxNewPlotView.cpp:173–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void BoxPlotCanvas::AddTimeVariantOptionsToMenu(wxMenu* menu)
174{
175 if (!var_info[0].is_time_variant) return;
176 wxMenu* menu1 = new wxMenu(wxEmptyString);
177 {
178 wxString s = wxString::Format(_("Synchronize %s with Time Control"), var_info[0].name);
179 wxMenuItem* mi =
180 menu1->AppendCheckItem(GdaConst::ID_TIME_SYNC_VAR1+0, s, s);
181 if (mi && mi->IsCheckable() && mi->GetMenu()) mi->Check(var_info[0].sync_with_global_time);
182 }
183
184 wxMenu* menu2 = new wxMenu(wxEmptyString);
185 {
186 wxString s= _("Fixed scale over time");
187 wxMenuItem* mi =
188 menu2->AppendCheckItem(GdaConst::ID_FIX_SCALE_OVER_TIME_VAR1, s, s);
189 if (mi && mi->IsCheckable() && mi->GetMenu()) mi->Check(var_info[0].fixed_scale);
190 }
191
192 wxMenu* menu3 = new wxMenu(wxEmptyString);
193 {
194 int mppv = GdaConst::max_plots_per_view_menu_items;
195 int mp = std::min(max_plots, mppv);
196 for (int i=0; i<mp-1; i++) {
197 wxString s;
198 s << i+1;
199 wxMenuItem* mi =
200 menu3->AppendCheckItem(GdaConst::ID_PLOTS_PER_VIEW_1+i, s, s);
201 if (mi && mi->IsCheckable() && mi->GetMenu()) mi->Check(i+1 == cur_num_plots);
202 }
203 if (max_plots > 10) {
204 wxString s;
205 s << "Other...";
206 wxMenuItem* mi =
207 menu3->AppendCheckItem(GdaConst::ID_PLOTS_PER_VIEW_OTHER, s, s);
208 }
209 wxString s;
210 if (project->GetTableInt()->GetTimeSteps() <= MAX_BOX_PLOTS) {
211 s << "All";
212 } else {
213 s << MAX_BOX_PLOTS << " (max plots allowed)";
214 }
215 wxMenuItem* mi =
216 menu3->AppendCheckItem(GdaConst::ID_PLOTS_PER_VIEW_ALL, s, s);
217 if (mi && mi->IsCheckable() && mi->GetMenu()) mi->Check(cur_num_plots == max_plots);
218 }
219
220 menu->Prepend(wxID_ANY, _("Number of Box Plots"), menu3, _("Number of Box Plots"));
221 menu->Prepend(wxID_ANY, _("Scale Options"), menu2, _("Scale Options"));
222
223
224 menu->AppendSeparator();
225 menu->Append(wxID_ANY, _("Time Variable Options"), menu1,
226 _("Time Variable Options"));
227}
228
229void BoxPlotCanvas::SetCheckMarks(wxMenu* menu)
230{

Callers 1

MapMenusMethod · 0.45

Calls 5

AppendMethod · 0.80
minFunction · 0.50
CheckMethod · 0.45
GetTimeStepsMethod · 0.45
GetTableIntMethod · 0.45

Tested by

no test coverage detected