'Create main menu'

def create_menu(self):

    self.menustrip = wx.MenuBar()
    m = wx.Menu()
    self.Bind(wx.EVT_MENU, self.loadfile, m.Append((-1), _('&Open...'), _('    Open    file')))
    self.savebtn = m.Append((-1), _('&Save...'), _('    Save    file'))
    self.savebtn.Enable(False)
    self.Bind(wx.EVT_MENU, self.savefile, self.savebtn)
    self.filehistory = wx.FileHistory(maxFiles=8, idBase=wx.ID_FILE1)
    recent = wx.Menu()
    self.filehistory.UseMenu(recent)
    self.Bind(wx.EVT_MENU_RANGE, self.load_recent_file, id=wx.ID_FILE1, id2=wx.ID_FILE9)
    m.AppendMenu(wx.ID_ANY, _('&Recent    Files'), recent)
    self.Bind(wx.EVT_MENU, self.clear_log, m.Append((-1), _('Clear    console'), _('    Clear    output    console')))
    self.Bind(wx.EVT_MENU, self.on_exit, m.Append(wx.ID_EXIT, _('E&xit'), _('    Closes    the    Window')))
    self.menustrip.Append(m, _('&File'))
    m = wx.Menu()
    self.Bind(wx.EVT_MENU, self.do_editgcode, m.Append((-1), _('&Edit...'), _('    Edit    open    file')))
    self.Bind(wx.EVT_MENU, self.plate, m.Append((-1), _('Plater'), _('    Compose    3D    models    into    a    single    plate')))
    self.Bind(wx.EVT_MENU, self.plate_gcode, m.Append((-1), _('G-Code    Plater'), _('    Compose    G-Codes    into    a    single    plate')))
    self.Bind(wx.EVT_MENU, self.exclude, m.Append((-1), _('Excluder'), _('    Exclude    parts    of    the    bed    from    being    printed')))
    self.Bind(wx.EVT_MENU, self.project, m.Append((-1), _('Projector'), _('    Project    slices')))
    self.Bind(wx.EVT_MENU, self.show_spool_manager, m.Append((-1), _('Spool    Manager'), _('    Manage    different    spools    of    filament')))
    self.menustrip.Append(m, _('&Tools'))
    m = wx.Menu()
    self.recoverbtn = m.Append((-1), _('Recover'), _('    Recover    previous    print    after    a    disconnect    (homes    X,    Y,    restores    Z    and    E    status)'))
    self.recoverbtn.Disable = (lambda *a: self.recoverbtn.Enable(False))
    self.Bind(wx.EVT_MENU, self.recover, self.recoverbtn)
    self.menustrip.Append(m, _('&Advanced'))
    if self.settings.slic3rintegration:
        m = wx.Menu()
        print_menu = wx.Menu()
        filament_menu = wx.Menu()
        printer_menu = wx.Menu()
        m.AppendSubMenu(print_menu, _('Print    &settings'))
        m.AppendSubMenu(filament_menu, _('&Filament'))
        m.AppendSubMenu(printer_menu, _('&Printer'))
        menus = {'print': print_menu, 'filament': filament_menu, 'printer': printer_menu}
        try:
            self.load_slic3r_configs(menus)
            self.menustrip.Append(m, _('&Slic3r'))
        except IOError:
            self.logError(((_('Failed    to    load    Slic3r    configuration:') + '\n') + traceback.format_exc()))
    m = wx.Menu()
    self.macros_menu = wx.Menu()
    m.AppendSubMenu(self.macros_menu, _('&Macros'))
    self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append((-1), _('<&New...>')))
    self.Bind(wx.EVT_MENU, (lambda *e: PronterOptions(self)), m.Append((-1), _('&Options'), _('    Options    dialog')))
    self.Bind(wx.EVT_MENU, (lambda x: threading.Thread(target=(lambda : self.do_slice('set'))).start()), m.Append((-1), _('Slicing    settings'), _('    Adjust    slicing    settings')))
    mItem = m.AppendCheckItem((-1), _('Debug    communications'), _('Print    all    G-code    sent    to    and    received    from    the    printer.'))
    m.Check(mItem.GetId(), self.p.loud)
    self.Bind(wx.EVT_MENU, self.set_verbose_communications, mItem)
    self.menustrip.Append(m, _('&Settings'))
    self.update_macros_menu()
    self.SetMenuBar(self.menustrip)
    m = wx.Menu()
    self.Bind(wx.EVT_MENU, self.about, m.Append((-1), _('&About    Printrun'), _('Show    about    dialog')))
    self.menustrip.Append(m, _('&Help'))
