Adds widgets to the aui manager and controls the layout

def _do_layout(self):
        """Adds widgets to the aui manager and controls the layout"""

        # Set background color for the toolbar via the manager
        ap = self._mgr.GetArtProvider()
        ap.SetColour(aui.AUI_DOCKART_BACKGROUND_GRADIENT_COLOUR,
                     get_color(config["background_color"]))

        # Add the toolbars to the manager

        self._mgr.AddPane(self.main_toolbar, aui.AuiPaneInfo().
                          Name("main_window_toolbar").
                          Caption(_("Main toolbar")).
                          ToolbarPane().Top().Row(0))

        self._mgr.AddPane(self.find_toolbar, aui.AuiPaneInfo().
                          Name("find_toolbar").Caption(_("Find toolbar")).
                          ToolbarPane().Top().Row(0))

        self._mgr.AddPane(self.attributes_toolbar, aui.AuiPaneInfo().
                          Name("attributes_toolbar").
                          Caption(_("Format toolbar")).
                          ToolbarPane().Top().Row(1))

        self._mgr.AddPane(self.macro_toolbar, aui.AuiPaneInfo().
                          Name("macro_toolbar").Caption(_("Macro toolbar")).
                          Gripper(True).ToolbarPane().Top().Row(1))

        self._mgr.AddPane(self.widget_toolbar, aui.AuiPaneInfo().
                          Name("widget_toolbar").Caption(_("Widget toolbar")).
                          Gripper(True).ToolbarPane().Top().Row(1))

        self._mgr.AddPane(self.entry_line_panel, aui.AuiPaneInfo().
                          Name("entry_line_panel").Caption(_("Entry line")).
                          Gripper(False).CenterPane().Top().Row(2).
                          BestSize(400, 30).PaneBorder(False))

        self._mgr.AddPane(self.table_list_panel, aui.AuiPaneInfo().
                          Name("table_list_panel").Caption(_("Table")).
                          CenterPane().Left().BestSize(50, 300))

        self._mgr.AddPane(self.macro_panel, aui.AuiPaneInfo().
                          Name("macro_panel").Caption(_("Macro panel")).
                          Gripper(False).CenterPane().Right().
                          BestSize(200, 200))

        # Load perspective from config
        window_layout = config["window_layout"]

        if window_layout:
            self._mgr.LoadPerspective(window_layout)

        # Add the main grid
        self._mgr.AddPane(self.grid, aui.AuiPaneInfo().
                          Name("grid").Caption(_("Main grid")).CentrePane())

        # Tell the manager to 'commit' all the changes just made
        self._mgr.Update()
        self._mgr.GetPane("attributes_toolbar")
        self._mgr.Update()

        self._set_menu_toggles()

        # Set initial size to config value
        self.SetInitialSize(config["window_size"])
        self.SetMinSize((10, 10))

        # TODO: Set window position fix --> different positions for
        # different window managers prevent this

        self.SetPosition(config["window_position"])