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

Method UpdateContextMenuItems

TemplateFrame.cpp:329–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void TemplateFrame::UpdateContextMenuItems(wxMenu* menu)
330{
331 // Update the checkmarks and enable/disable state for the
332 // following menu items if they were specified for this particular
333 // view in the xrc file. Items that cannot be enable/disabled,
334 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_DISPLAY_STATUS_BAR"),
335 IsStatusBarVisible());
336 if (template_canvas == 0) return;
337 // or are not checkable do not appear.
338 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECT_WITH_RECT"),
339 template_canvas->GetBrushType() ==
340 TemplateCanvas::rectangle);
341 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECT_WITH_CIRCLE"),
342 template_canvas->GetBrushType() ==
343 TemplateCanvas::circle);
344 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECT_WITH_LINE"),
345 template_canvas->GetBrushType() ==
346 TemplateCanvas::line);
347 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECT_WITH_CUSTOM"),
348 template_canvas->GetBrushType() ==
349 TemplateCanvas::custom_select);
350 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECTION_MODE"),
351 template_canvas->GetMouseMode() ==
352 TemplateCanvas::select);
353 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_FIT_TO_WINDOW_MODE"),
354 template_canvas->GetFitToWindowMode());
355 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_FIXED_ASPECT_RATIO_MODE"),
356 template_canvas->GetFixedAspectRatioMode());
357 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_ZOOM_MODE"),
358 template_canvas->GetMouseMode() ==
359 TemplateCanvas::zoom);
360 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_PAN_MODE"),
361 template_canvas->GetMouseMode() ==
362 TemplateCanvas::pan);
363 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_SELECTABLE_OUTLINE_VISIBLE"),
364 template_canvas->
365 IsSelectableOutlineVisible());
366 GeneralWxUtils::CheckMenuItem(menu, XRCID("ID_CANVAS_BACKGROUND_COLOR"),
367 template_canvas->
368 IsUserBackgroundColorVisible());
369
370}
371
372void TemplateFrame::UpdateTitle()
373{

Callers 2

DisplayRightClickMenuMethod · 0.45
DisplayRightClickMenuMethod · 0.45

Calls 6

GetBrushTypeMethod · 0.80
GetMouseModeMethod · 0.80
GetFitToWindowModeMethod · 0.80

Tested by 2

DisplayRightClickMenuMethod · 0.36
DisplayRightClickMenuMethod · 0.36