2970{
2971#ifdef __APPLE__
2973#endif
2974
2975
2976 wxMenu* fileMenu = new wxMenu;
2977 {
2978#ifdef __APPLE__
2979
2982 [
this] {
return m_plater !=
nullptr && wxGetApp().app_config->get(
"app",
"single_instance") ==
"false"; },
this);
2983#endif
2984
2986 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->new_project(); },
"",
nullptr,
2988
2989
2990#ifndef __APPLE__
2992 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->load_project(); },
"menu_open",
nullptr,
2994#else
2996 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->load_project(); },
"",
nullptr,
2998#endif
2999
3000
3001 wxMenu* recent_projects_menu = new wxMenu();
3002 wxMenuItem* recent_projects_submenu =
append_submenu(fileMenu, recent_projects_menu, wxID_ANY,
_L(
"Recent files"),
"");
3004 Bind(wxEVT_MENU, [this](wxCommandEvent& evt) {
3005 size_t file_id = evt.GetId() - wxID_FILE1;
3008 }, wxID_FILE1, wxID_FILE1 + 49);
3009
3010 std::vector<std::string> recent_projects = wxGetApp().app_config->get_recent_projects();
3011 std::reverse(recent_projects.begin(), recent_projects.end());
3012 for (const std::string& project : recent_projects)
3013 {
3015 }
3017
3018 Bind(wxEVT_UPDATE_UI, [
this](wxUpdateUIEvent& evt) { evt.Enable(
can_open_project() && (
m_recent_projects.GetCount() > 0)); }, recent_projects_submenu->GetId());
3019
3020
3021#ifndef __APPLE__
3023 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->save_project(); },
"menu_save",
nullptr,
3025#else
3027 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->save_project(); },
"",
nullptr,
3029#endif
3030
3031#ifndef __APPLE__
3033 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->save_project(
true); },
"menu_save",
nullptr,
3035#else
3037 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->save_project(
true); },
"",
nullptr,
3039#endif
3040
3041
3042 fileMenu->AppendSeparator();
3043 auto publish_handler = [
this](wxCommandEvent&) {
publish_project(); };
3044
3045#ifndef __APPLE__
3047 publish_handler, "menu_publish", nullptr,
3049#else
3051 publish_handler, "", nullptr,
3053#endif
3054
3055
3056 fileMenu->AppendSeparator();
3057
3058
3059 wxMenu *import_menu = new wxMenu();
3060#ifndef __APPLE__
3062 [
this](wxCommandEvent&) {
if (
m_plater) {
3064 } }, "menu_import", nullptr,
3066#else
3068 [
this](wxCommandEvent&) {
if (
m_plater) {
m_plater->add_model(); } },
"",
nullptr,
3070#endif
3071 append_menu_item(import_menu, wxID_ANY,
_L(
"Import ZIP Archive") +
dots,
_L(
"Load models contained within a ZIP archive"),
3072 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->import_zip_archive(); },
"menu_import",
nullptr,
3076 [](){return true; }, this);
3077
3079
3080
3081 wxMenu* export_menu = new wxMenu();
3082
3083 append_menu_item(export_menu, wxID_ANY,
_L(
"Export all objects as one STL") +
dots,
_L(
"Export all objects as one STL"),
3084 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_stl(); },
"menu_export_stl",
nullptr,
3087 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_stl(
false,
false,
true); },
"menu_export_stl",
nullptr,
3089 append_menu_item(export_menu, wxID_ANY,
_L(
"Export all objects as one DRC") +
dots,
_L(
"Export all objects as one DRC"),
3090 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_stl(
false,
false,
false,
FT_DRC); },
"menu_export_stl",
nullptr,
3093 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_stl(
false,
false,
true,
FT_DRC); },
"menu_export_stl",
nullptr,
3095 append_menu_item(export_menu, wxID_ANY,
_L(
"Export Generic 3MF") +
dots,
_L(
"Export 3MF file without using some 3mf-extensions"),
3096 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_core_3mf(); },
"menu_export_sliced_file",
nullptr,
3098
3100 [
this](wxCommandEvent&) {
if (
m_plater) wxPostEvent(
m_plater, SimpleEvent(EVT_GLTOOLBAR_EXPORT_SLICED_FILE)); },
"menu_export_sliced_file",
nullptr,
3102
3103 append_menu_item(export_menu, wxID_ANY,
_L(
"Export all plate sliced file") +
dots,
_L(
"Export all plate sliced file"),
3104 [
this](wxCommandEvent&) {
if (
m_plater) wxPostEvent(
m_plater, SimpleEvent(EVT_GLTOOLBAR_EXPORT_ALL_SLICED_FILE)); },
"menu_export_sliced_file",
nullptr,
3106
3108 [
this](wxCommandEvent&) {
if (
m_plater)
m_plater->export_gcode(
false); },
"menu_export_gcode",
nullptr,
3110
3112 [
this](wxCommandEvent&) {
if (
m_plater !=
nullptr)
m_plater->export_toolpaths_to_obj(); },
"menu_export_toolpaths",
nullptr,
3114
3116 export_menu, wxID_ANY,
_L(
"Export Preset Bundle") +
dots ,
_L(
"Export current configuration to files"),
3118 "menu_export_config", nullptr,
3119 []() { return true; }, this);
3120
3122
3123 fileMenu->AppendSeparator();
3124
3125#ifndef __APPLE__
3127 [this](wxCommandEvent&) { Close(false); }, "menu_exit", nullptr);
3128#else
3130 [this](wxCommandEvent&) { Close(false); }, "", nullptr);
3131#endif
3132 }
3133
3134
3135 wxMenu* editMenu = nullptr;
3137 {
3138 editMenu = new wxMenu();
3139
3140
3141
3142 auto handle_key_event = [](wxKeyEvent& evt) {
3144 if (imgui == nullptr || !imgui->owns_keyboard())
3145 return false;
3146 wxGetApp().imgui()->update_key_data(evt);
3147 wxGetApp().plater()->get_current_canvas3D()->render();
3148 return true;
3149 };
3150#ifndef __APPLE__
3151
3153 _L(
"Undo"), [
this](wxCommandEvent&) {
3154#ifdef SLIC3R_CAD
3155 if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(false); return; }
3156#endif
3158 "menu_undo", nullptr, [this](){
3159#ifdef SLIC3R_CAD
3160 if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(false);
3161#endif
3162 return m_plater->can_undo(); },
this);
3163
3165 _L(
"Redo"), [
this](wxCommandEvent&) {
3166#ifdef SLIC3R_CAD
3167 if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(true); return; }
3168#endif
3170 "menu_redo", nullptr, [this](){
3171#ifdef SLIC3R_CAD
3172 if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(true);
3173#endif
3174 return m_plater->can_redo(); },
this);
3175 editMenu->AppendSeparator();
3176
3178 _L(
"Cut selection to clipboard"), [
this](wxCommandEvent&) {
m_plater->cut_selection_to_clipboard(); },
3179 "menu_cut",
nullptr, [
this]() {
return m_plater->can_copy_to_clipboard(); },
this);
3180
3182 _L(
"Copy selection to clipboard"), [
this](wxCommandEvent&) {
m_plater->copy_selection_to_clipboard(); },
3183 "menu_copy",
nullptr, [
this](){
return m_plater->can_copy_to_clipboard(); },
this);
3184
3186 _L(
"Paste clipboard"), [
this](wxCommandEvent&) {
m_plater->paste_from_clipboard(); },
3187 "menu_paste",
nullptr, [
this](){
return m_plater->can_paste_from_clipboard(); },
this);
3188
3190 _L(
"Deletes the current selection"),[
this](wxCommandEvent&) {
m_plater->remove_selected(); },
3191 "menu_remove",
nullptr, [
this](){
return can_delete(); },
this);
3192
3194 _L(
"Deletes all objects"),[
this](wxCommandEvent&) {
m_plater->delete_all_objects_from_model(); },
3195 "menu_remove",
nullptr, [
this](){
return can_delete_all(); },
this);
3196 editMenu->AppendSeparator();
3197
3199 _L(
"Clone copies of selections"),[
this](wxCommandEvent&) {
3201 },
3202 "menu_remove",
nullptr, [
this](){
return can_clone(); },
this);
3203 editMenu->AppendSeparator();
3205 _L(
"Duplicate the current plate"),[
this](wxCommandEvent&) {
3207 },
3208 "menu_remove", nullptr, [](){return true;}, this);
3209 editMenu->AppendSeparator();
3210#else
3211
3213 _L(
"Undo"), [
this, handle_key_event](wxCommandEvent&) {
3214 wxKeyEvent e;
3215 e.SetEventType(wxEVT_KEY_DOWN);
3216 e.SetControlDown(true);
3217 e.m_keyCode = 'Z';
3218 if (handle_key_event(e)) {
3219 return;
3220 }
3221#ifdef SLIC3R_CAD
3222 if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(false); return; }
3223#endif
3225 "", nullptr, [this](){
3226#ifdef SLIC3R_CAD
3227 if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(false);
3228#endif
3229 return m_plater->can_undo(); },
this);
3230
3232 _L(
"Redo"), [
this, handle_key_event](wxCommandEvent&) {
3233 wxKeyEvent e;
3234 e.SetEventType(wxEVT_KEY_DOWN);
3235 e.SetControlDown(true);
3236 e.m_keyCode = 'Y';
3237 if (handle_key_event(e)) {
3238 return;
3239 }
3240#ifdef SLIC3R_CAD
3241 if (DesignPanel* dp = shown_design_panel()) { dp->menu_undo_redo(true); return; }
3242#endif
3244 "", nullptr, [this](){
3245#ifdef SLIC3R_CAD
3246 if (DesignPanel* dp = shown_design_panel()) return dp->menu_can_undo_redo(true);
3247#endif
3248 return m_plater->can_redo(); },
this);
3249 editMenu->AppendSeparator();
3250
3252 _L(
"Cut selection to clipboard"), [
this, handle_key_event](wxCommandEvent&) {
3253 wxKeyEvent e;
3254 e.SetEventType(wxEVT_KEY_DOWN);
3255 e.SetControlDown(true);
3256 e.m_keyCode = 'X';
3257 if (handle_key_event(e)) {
3258 return;
3259 }
3260 m_plater->cut_selection_to_clipboard(); },
3261 "",
nullptr, [
this]() {
return m_plater->can_copy_to_clipboard(); },
this);
3262
3264 _L(
"Copy selection to clipboard"), [
this, handle_key_event](wxCommandEvent&) {
3265 wxKeyEvent e;
3266 e.SetEventType(wxEVT_KEY_DOWN);
3267 e.SetControlDown(true);
3268 e.m_keyCode = 'C';
3269 if (handle_key_event(e)) {
3270 return;
3271 }
3272 m_plater->copy_selection_to_clipboard(); },
3273 "",
nullptr, [
this](){
return m_plater->can_copy_to_clipboard(); },
this);
3274
3276 _L(
"Paste clipboard"), [
this, handle_key_event](wxCommandEvent&) {
3277 wxKeyEvent e;
3278 e.SetEventType(wxEVT_KEY_DOWN);
3279 e.SetControlDown(true);
3280 e.m_keyCode = 'V';
3281 if (handle_key_event(e)) {
3282 return;
3283 }
3284 m_plater->paste_from_clipboard(); },
3285 "",
nullptr, [
this](){
return m_plater->can_paste_from_clipboard(); },
this);
3286#if 0
3287
3289 _L(
"Deletes the current selection"),[
this](wxCommandEvent&) {
3291 },
3292 "",
nullptr, [
this](){
return can_delete(); },
this);
3293#endif
3294
3296 _L(
"Deletes all objects"),[
this, handle_key_event](wxCommandEvent&) {
3297 wxKeyEvent e;
3298 e.SetEventType(wxEVT_KEY_DOWN);
3299 e.SetControlDown(true);
3300 e.m_keyCode = 'D';
3301 if (handle_key_event(e)) {
3302 return;
3303 }
3304 m_plater->delete_all_objects_from_model(); },
3306 editMenu->AppendSeparator();
3307
3309 _L(
"Clone copies of selections"),[
this, handle_key_event](wxCommandEvent&) {
3310 wxKeyEvent e;
3311 e.SetEventType(wxEVT_KEY_DOWN);
3312 e.SetControlDown(true);
3313 e.m_keyCode = 'M';
3314 if (handle_key_event(e)) {
3315 return;
3316 }
3318 },
3319 "",
nullptr, [
this](){
return can_clone(); },
this);
3320 editMenu->AppendSeparator();
3322 _L(
"Duplicate the current plate"),[
this](wxCommandEvent&) {
3324 },
3325 "", nullptr, [](){return true;}, this);
3326 editMenu->AppendSeparator();
3327
3328#endif
3329
3330
3332 _L(
"Selects all objects"), [
this, handle_key_event](wxCommandEvent&) {
3333 wxKeyEvent e;
3334 e.SetEventType(wxEVT_KEY_DOWN);
3335 e.SetControlDown(true);
3336 e.m_keyCode = 'A';
3337 if (handle_key_event(e)) {
3338 return;
3339 }
3341 "",
nullptr, [
this](){
return can_select(); },
this);
3342
3344 _L(
"Deselects all objects"), [
this, handle_key_event](wxCommandEvent&) {
3345 wxKeyEvent e;
3346 e.SetEventType(wxEVT_KEY_DOWN);
3347 e.m_keyCode = WXK_ESCAPE;
3348 if (handle_key_event(e)) {
3349 return;
3350 }
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367 }
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380 wxMenu* viewMenu = nullptr;
3382 viewMenu = new wxMenu();
3384 viewMenu->AppendSeparator();
3385
3386
3389 [](wxCommandEvent&) {
3390 wxGetApp().app_config->set_bool("use_perspective_camera", true);
3391 wxGetApp().update_ui_from_settings();
3392 }, nullptr);
3393
3395 [](wxCommandEvent&) {
3396 wxGetApp().app_config->set_bool("use_perspective_camera", false);
3397 wxGetApp().update_ui_from_settings();
3398 }, nullptr);
3399 this->Bind(wxEVT_UPDATE_UI, [viewMenu, camera_id_base](wxUpdateUIEvent& evt) {
3400 if (wxGetApp().app_config->get("use_perspective_camera").compare("true") == 0)
3402 else
3404 }, perspective_item->GetId());
3405 append_menu_check_item(viewMenu, wxID_ANY,
_L(
"Auto Perspective"),
_L(
"Automatically switch between orthographic and perspective when changing from top/bottom/side views."),
3406 [this](wxCommandEvent&) {
3407 wxGetApp().app_config->set_bool("auto_perspective", !wxGetApp().app_config->get_bool("auto_perspective"));
3408 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3409 },
3411 []() { return wxGetApp().app_config->get_bool("auto_perspective"); }, this);
3412
3413 viewMenu->AppendSeparator();
3415 [this](wxCommandEvent &) {
3416 wxGetApp().toggle_show_gcode_window();
3417 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3418 },
3420 []() { return wxGetApp().show_gcode_window(); }, this);
3422
3424 viewMenu, wxID_ANY,
_L(
"Show 3D Navigator"),
_L(
"Show 3D navigator in Prepare and Preview scene."),
3425 [this](wxCommandEvent&) {
3426 wxGetApp().toggle_show_3d_navigator();
3427 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3428 },
3430 []() { return wxGetApp().show_3d_navigator(); }, this);
3431
3433 [this](wxCommandEvent&) {
3434 wxGetApp().toggle_show_plate_gridlines();
3435 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3436 }, this,
3438 []() { return wxGetApp().show_plate_gridlines(); }, this);
3439
3440
3441
3442
3443
3444
3446 _L(
"Show the IDEX/IQEX toolhead representation around each active nozzle in the G-code preview."),
3447 [this](wxCommandEvent&) {
3448 const bool current = wxGetApp().app_config->get("show_imex_toolhead_boxes") != "false";
3449 wxGetApp().app_config->set("show_imex_toolhead_boxes", current ? "false" : "true");
3450 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3451 },
3452 this,
3453 [this]() {
3455 if (auto* pb = wxGetApp().preset_bundle) {
3456 auto* o = pb->printers.get_edited_preset().config.option<ConfigOptionBool>("is_imex");
3457 return o && o->value;
3458 }
3459 return false;
3460 },
3461 []() { return wxGetApp().app_config->get("show_imex_toolhead_boxes") != "false"; },
3462 this);
3463
3465 viewMenu, wxID_ANY,
_L(
"Reset Window Layout"),
_L(
"Reset to default window layout"),
3466 [
this](wxCommandEvent&) {
m_plater->reset_window_layout(); },
"",
this,
3467 [this]() {
3468#ifdef SLIC3R_CAD
3469 if (shown_design_panel() != nullptr)
3470 return true;
3471#endif
3473 },
3474 this);
3475
3476 viewMenu->AppendSeparator();
3478 _L(
"Show/Hide 3Dconnexion devices settings dialog"),
3479 [this](wxCommandEvent&) {
3480 Mouse3DController& controller =
m_plater->get_mouse3d_controller();
3481 controller.show_settings_dialog(!controller.is_settings_dialog_shown());
3482 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3483 },
3485 [
this]() {
return m_plater->get_mouse3d_controller().is_settings_dialog_shown(); },
this);
3487
3488 viewMenu->AppendSeparator();
3490 [
this](wxCommandEvent&) {
m_plater->show_view3D_labels(!
m_plater->are_view3D_labels_shown());
m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT)); },
this,
3491 [
this]() {
return m_plater->is_view3D_shown(); }, [
this]() {
return m_plater->are_view3D_labels_shown(); },
this);
3493
3496 _L(
"Show the full height of every configured collision volume, including on an empty bed."),
3497 [
this](wxCommandEvent&) {
m_plater->show_collision_volumes(!
m_plater->are_collision_volumes_shown()); },
this,
3499 [
this]() {
return m_plater->are_collision_volumes_shown(); },
this);
3501
3503 [this](wxCommandEvent &) {
3505 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3506 },
3507 this, [
this]() {
return m_plater->is_view3D_shown(); }, [
this]() {
return m_plater->is_view3D_overhang_shown(); },
this);
3508
3510 viewMenu, wxID_ANY,
_L(
"Show Selected Outline (beta)"),
_L(
"Show outline around selected object in 3D scene."),
3511 [this](wxCommandEvent&) {
3512 wxGetApp().toggle_show_outline();
3513 m_plater->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT));
3514 },
3516 []() { return wxGetApp().show_outline(); }, this);
3517
3518
3519
3520
3521
3522
3523
3525
3526
3527
3528
3529
3530
3531
3532 }
3533
3534 wxWindowID config_id_base = wxWindow::NewControlId(
int(
ConfigMenuCnt));
3535
3536
3537
3538
3539#ifdef __APPLE__
3540 wxWindowID bambu_studio_id_base = wxWindow::NewControlId(int(2));
3541 wxMenu* parent_menu =
m_menubar->OSXGetAppleMenu();
3542
3543#else
3544 wxMenu* parent_menu =
m_topbar->GetTopMenu();
3545#endif
3546
3547#ifdef __APPLE__
3550 parent_menu, wxID_ANY,
_L(about_title),
"",
3552 "", nullptr, []() { return true; }, this, 0);
3555 [](wxCommandEvent &) {
3556 wxGetApp().open_preferences();
3557 },
3558 "", nullptr, []() { return true; }, this, 1);
3559
3560#endif
3561
3563
3564#ifndef __APPLE__
3566 if (editMenu)
3568 if (viewMenu)
3569 m_topbar->AddDropDownSubMenu(viewMenu,
_L(
"View"));
3570
3571
3574 [](wxCommandEvent &) {
3575
3576 wxGetApp().open_preferences();
3577 },
3578 "", nullptr, []() { return true; }, this);
3579
3580 auto top_menu =
m_topbar->GetTopMenu();
3581 top_menu->AppendSeparator();
3582
3585 [](wxCommandEvent &) { wxGetApp().open_speed_dial(); },
3586 "", nullptr, []() { return true; }, this);
3587 top_menu->AppendSeparator();
3588
3590 top_menu, wxID_ANY,
_L(
"Preset Bundle") +
"\t",
"",
3591 [this](wxCommandEvent &) {
3592
3593 wxGetApp().open_presetbundledialog();
3595 },
3596 "", nullptr, []() { return true; }, this);
3597
3599 top_menu, wxID_ANY,
_L(
"Sync Presets"),
_L(
"Pull and apply the latest presets from OrcaCloud"),
3600 [this](wxCommandEvent&) {
3601 if (!wxGetApp().is_user_login()) {
3602 MessageDialog info_dlg(
this,
_L(
"You must be logged in to sync presets from cloud."),
3603 _L(
"Sync Presets"), wxOK | wxICON_INFORMATION);
3604 info_dlg.ShowModal();
3605 return;
3606 }
3608 m_plater->get_notification_manager()->push_notification(
3609 into_u8(
_L(
"Syncing presets from cloud\u2026")));
3610 wxGetApp().restart_sync_user_preset();
3611 }, "", nullptr,
3612 []() {
3613 return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
3614 }, this);
3615
3616 top_menu->AppendSeparator();
3618 top_menu, wxID_ANY,
_L(
"Plugins") +
"\t",
"",
3619 [](wxCommandEvent &) {
3620 wxGetApp().open_plugins_dialog();
3621 },
3622 "", nullptr, []() { return true; }, this);
3623
3624
3625
3626
3627
3628 top_menu->AppendSeparator();
3629 m_topbar->AddDropDownSubMenu(helpMenu,
_L(
"Help"));
3630
3631
3632
3633
3636 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3637
3638
3641 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3642
3643
3646 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3647
3648
3651 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3652
3653
3656 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3657
3658
3661 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3662
3663
3664 auto input_shaping_menu = new wxMenu();
3666 input_shaping_menu, wxID_ANY,
_L(
"Input Shaping Frequency"),
_L(
"Input Shaping Frequency"),
3668 "", nullptr,
3669 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3671 input_shaping_menu, wxID_ANY,
_L(
"Input Shaping Damping/zeta factor"),
_L(
"Input Shaping Damping/zeta factor"),
3673 "", nullptr,
3674 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3675 m_topbar->GetCalibMenu()->AppendSubMenu(input_shaping_menu,
_L(
"Input Shaping"));
3676
3677
3680 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3681
3682
3684 { wxLaunchDefaultBrowser("https://www.orcaslicer.com/wiki/calibration_guide", wxBROWSER_NEW_WINDOW); }, "", nullptr, [this]()
3685 {
return m_plater->is_view3D_shown();; },
this);
3686
3687#else
3688
3689 fileMenu->AppendSeparator();
3692 [](wxCommandEvent&) { wxGetApp().open_speed_dial(); },
3693 "", nullptr, []() { return true; }, this);
3695 fileMenu, wxID_ANY,
_L(
"Preset Bundle"),
"",
3696 [this](wxCommandEvent&) {
3697 wxGetApp().open_presetbundledialog();
3699 },
3700 "", nullptr, []() { return true; }, this);
3701
3703 fileMenu, wxID_ANY,
_L(
"Sync Presets"),
_L(
"Pull and apply the latest presets from OrcaCloud"),
3704 [this](wxCommandEvent&) {
3705 if (!wxGetApp().is_user_login()) {
3706 MessageDialog info_dlg(
this,
_L(
"You must be logged in to sync presets from cloud."),
3707 _L(
"Sync Presets"), wxOK | wxICON_INFORMATION);
3708 info_dlg.ShowModal();
3709 return;
3710 }
3712 m_plater->get_notification_manager()->push_notification(
3713 into_u8(
_L(
"Syncing presets from cloud\u2026")));
3714 wxGetApp().restart_sync_user_preset();
3715 }, "", nullptr,
3716 []() {
3717 return wxGetApp().is_user_login() && !wxGetApp().app_config->get_stealth_mode();
3718 }, this);
3719
3720 fileMenu->AppendSeparator();
3722 fileMenu, wxID_ANY,
_L(
"Plugins"),
"", [](wxCommandEvent&) { wxGetApp().open_plugins_dialog(); },
"",
nullptr,
3723 []() { return true; }, this);
3724
3725 fileMenu->AppendSeparator();
3726
3727 m_menubar->Append(fileMenu, wxString::Format(
"&%s",
_L(
"File")));
3728 if (editMenu)
3730 if (viewMenu)
3731 m_menubar->Append(viewMenu, wxString::Format(
"&%s",
_L(
"View")));
3732
3733
3734
3735
3736 auto calib_menu = new wxMenu();
3737
3738
3741 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3742
3743
3746 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3747
3748
3751 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3752
3753
3754
3757 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3758
3759
3762 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3763
3764
3767 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3768
3769
3770 auto input_shaping_menu = new wxMenu();
3772 input_shaping_menu, wxID_ANY,
_L(
"Input Shaping Frequency"),
_L(
"Input Shaping Frequency"),
3774 "", nullptr,
3775 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3777 input_shaping_menu, wxID_ANY,
_L(
"Input Shaping Damping/zeta factor"),
_L(
"Input Shaping Damping/zeta factor"),
3779 "", nullptr,
3780 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3781 calib_menu->AppendSubMenu(input_shaping_menu,
_L(
"Input Shaping"));
3782
3783
3786 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3787
3789 [](wxCommandEvent&) { wxLaunchDefaultBrowser("https://www.orcaslicer.com/wiki/calibration_guide", wxBROWSER_NEW_WINDOW); }, "", nullptr,
3790 [
this]() {
return m_plater->is_view3D_shown();; },
this);
3791
3792 m_menubar->Append(calib_menu,wxString::Format(
"&%s",
_L(
"Calibration")));
3793 if (helpMenu)
3794 m_menubar->Append(helpMenu, wxString::Format(
"&%s",
_L(
"Help")));
3796
3797#endif
3798
3799#ifdef _MSW_DARK_MODE
3800 if (wxGetApp().tabs_as_menu())
3802#endif
3803
3804#ifdef __APPLE__
3805
3806
3807 wxMenu* apple_menu =
m_menubar->OSXGetAppleMenu();
3808 if (apple_menu != nullptr) {
3809 apple_menu->Bind(wxEVT_MENU, [this](wxCommandEvent &) {
3810 Close();
3811 }, wxID_EXIT);
3812 }
3813#endif
3814}
bool can_open_project() const
Definition MainFrame.cpp:1914
void add_common_view_menu_items(wxMenu *view_menu, std::function< bool(void)> can_change_view)
Definition MainFrame.cpp:2945
wxMenu * generate_help_menu()
Definition MainFrame.cpp:2849
bool can_export_all_gcode() const
Definition MainFrame.cpp:2021
void open_recent_project(size_t file_id, wxString const &filename)
Definition MainFrame.cpp:4529
bool can_export_toolpaths() const
Definition MainFrame.cpp:1978
bool can_deselect() const
Definition MainFrame.cpp:2112
bool can_delete() const
Definition MainFrame.cpp:2117
bool can_delete_all() const
Definition MainFrame.cpp:2122
bool can_clone() const
Definition MainFrame.cpp:2103
void load_config_file()
Definition MainFrame.cpp:3986
bool can_start_new_project() const
Definition MainFrame.cpp:1905
void run_calibration(CalibKind calib_kind)
Definition MainFrame.cpp:4654
void export_config()
Definition MainFrame.cpp:3951
wxMenuBar * m_menubar
Definition MainFrame.hpp:198
@ wxID_CAMERA_COUNT
Definition GUI_App.hpp:169
@ wxID_CAMERA_ORTHOGONAL
Definition GUI_App.hpp:168
@ wxID_CAMERA_PERSPECTIVE
Definition GUI_App.hpp:167
@ Cornering
Definition MainFrame.hpp:140
@ MaxVolumetric
Definition MainFrame.hpp:136
@ VFA
Definition MainFrame.hpp:143
@ InputShapingFreq
Definition MainFrame.hpp:141
@ FlowRatio
Definition MainFrame.hpp:138
@ PressureAdvance
Definition MainFrame.hpp:137
@ InputShapingDamp
Definition MainFrame.hpp:142
@ Retraction
Definition MainFrame.hpp:139
@ Temperature
Definition MainFrame.hpp:135
static const wxString sep
Definition MainFrame.cpp:2828
@ Undo
Definition Shortcuts.hpp:33
@ Paste
Definition Shortcuts.hpp:33
@ Mouse3DSettings
Definition Shortcuts.hpp:47
@ Redo
Definition Shortcuts.hpp:33
@ DeleteAll
Definition Shortcuts.hpp:33
@ Copy
Definition Shortcuts.hpp:33
@ SelectAll
Definition Shortcuts.hpp:31
@ DeleteSelected
Definition Shortcuts.hpp:33
@ CloneSelected
Definition Shortcuts.hpp:33
@ ToggleGcodeWindow
Definition Shortcuts.hpp:49
@ Cut
Definition Shortcuts.hpp:33
static wxString dots("...", wxConvUTF8)
@ FT_DRC
Definition GUI_App.hpp:139
void start_new_slicer(const wxString *path_to_open, bool single_instance)
Definition Process.cpp:140
@ ConfigMenuCnt
Definition GUI_App.hpp:158
wxMenuItem * append_menu_radio_item(wxMenu *menu, int id, const wxString &string, const wxString &description, std::function< void(wxCommandEvent &event)> cb, wxEvtHandler *event_handler)
Definition wxExtensions.cpp:165
wxMenuItem * append_menu_check_item(wxMenu *menu, int id, const wxString &string, const wxString &description, std::function< void(wxCommandEvent &event)> cb, wxEvtHandler *event_handler, std::function< bool()> const enable_condition, std::function< bool()> const check_condition, wxWindow *parent)
Definition wxExtensions.cpp:183
wxMenuItem * append_submenu(wxMenu *menu, wxMenu *sub_menu, int id, const wxString &string, const wxString &description, const std::string &icon, std::function< bool()> const cb_condition, wxWindow *parent, int insert_pos)
Definition wxExtensions.cpp:137