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

Method OnMSTMap

Explore/MapNewView.cpp:321–349  ·  view source on GitHub ↗

handle menu event fro MST map

Source from the content-addressed store, hash-verified

319
320// handle menu event fro MST map
321void MapCanvas::OnMSTMap(int menu_id)
322{
323 if (menu_id == XRCID("ID_MAP_MST_TOGGLE")) {
324 display_mst = !display_mst;
325 if (display_mst) {
326 if (mst_map.Create(project) == false) {
327 wxString msg = _("Failed to create the Minimum Spanning Tree.");
328 wxMessageDialog dlg (this, msg, _("Information"),
329 wxOK | wxICON_INFORMATION);
330 dlg.ShowModal();
331 display_mst = false;
332 }
333 }
334 RedrawMap();
335 } else if (menu_id == XRCID("ID_MAP_MST_SAVE")) {
336 // save MST to a weights file
337 mst_map.SaveToWeightsFile(project);
338 } else if (display_mst) {
339 if (menu_id == XRCID("ID_MAP_MST_COLOR")) {
340 mst_map.ChangeColor(this);
341 } else if (menu_id == XRCID("ID_MAP_MST_THICKNESS_LIGHT")) {
342 mst_map.ChangeThickness(this, 0);
343 } else if (menu_id == XRCID("ID_MAP_MST_THICKNESS_NORM")) {
344 mst_map.ChangeThickness(this, 1);
345 } else if (menu_id == XRCID("ID_MAP_MST_THICKNESS_STRONG")) {
346 mst_map.ChangeThickness(this, 2);
347 }
348 }
349}
350
351void MapCanvas::UpdateSelection(bool shiftdown, bool pointsel)
352{

Callers 1

OnMapMSTMethod · 0.80

Calls 4

SaveToWeightsFileMethod · 0.80
ChangeColorMethod · 0.80
ChangeThicknessMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected