| 327 | } |
| 328 | |
| 329 | void 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 | |
| 372 | void TemplateFrame::UpdateTitle() |
| 373 | { |