Esempio n. 1
0
    def AddToolbar(self, name):
        """Add defined toolbar to the window

        Currently known toolbars are:
         - 'swipeMain'         - swipe functionality
         - 'swipeMap'          - basic map toolbar
         - 'swipeMisc'         - misc (settings, help)
        """

        if name == "swipeMain":
            if "swipeMain" not in self.toolbars:
                self.toolbars["swipeMain"] = SwipeMainToolbar(self)

            self._mgr.AddPane(
                self.toolbars["swipeMain"],
                wx.aui.AuiPaneInfo().Name("swipeMain").Caption(
                    _("Main Toolbar")).ToolbarPane().Top().LeftDockable(False).
                RightDockable(False).BottomDockable(False).TopDockable(True).
                CloseButton(False).Layer(2).Row(1).Position(0).BestSize(
                    (self.toolbars["swipeMain"].GetBestSize())),
            )

        if name == "swipeMap":
            if "swipeMap" not in self.toolbars:
                self.toolbars["swipeMap"] = SwipeMapToolbar(
                    self, self._toolSwitcher)

            self._mgr.AddPane(
                self.toolbars["swipeMap"],
                wx.aui.AuiPaneInfo().Name("swipeMap").Caption(
                    _("Map Toolbar")).ToolbarPane().Top().LeftDockable(False).
                RightDockable(False).BottomDockable(False).TopDockable(True).
                CloseButton(False).Layer(2).Row(1).Position(1).BestSize(
                    (self.toolbars["swipeMap"].GetBestSize())),
            )

        if name == "swipeMisc":
            if "swipeMisc" not in self.toolbars:
                self.toolbars["swipeMisc"] = SwipeMiscToolbar(self)

            self._mgr.AddPane(
                self.toolbars["swipeMisc"],
                wx.aui.AuiPaneInfo().Name("swipeMisc").Caption(
                    _("Misc Toolbar")).ToolbarPane().Top().LeftDockable(False).
                RightDockable(False).BottomDockable(False).TopDockable(True).
                CloseButton(False).Layer(2).Row(1).Position(2).BestSize(
                    (self.toolbars["swipeMisc"].GetBestSize())),
            )
Esempio n. 2
0
    def AddToolbar(self, name):
        """Add defined toolbar to the window

        Currently known toolbars are:
         - 'swipeMap'          - basic map toolbar
         - 'swipeMain'         - swipe functionality
        """
        if name == "swipeMap":
            self.toolbars[name] = SwipeMapToolbar(self, self._toolSwitcher)
            self._mgr.AddPane(self.toolbars[name],
                              wx.aui.AuiPaneInfo().
                              Name(name).Caption(_("Map Toolbar")).
                              ToolbarPane().Top().
                              LeftDockable(False).RightDockable(False).
                              BottomDockable(False).TopDockable(True).
                              CloseButton(False).Layer(2).Row(1).
                              BestSize((self.toolbars[name].GetBestSize())))

        if name == "swipeMain":
            self.toolbars[name] = SwipeMainToolbar(self)

            self._mgr.AddPane(self.toolbars[name],
                              wx.aui.AuiPaneInfo().
                              Name(name).Caption(_("Main Toolbar")).
                              ToolbarPane().Top().
                              LeftDockable(False).RightDockable(False).
                              BottomDockable(False).TopDockable(True).
                              CloseButton(False).Layer(2).Row(1).
                              BestSize((self.toolbars[name].GetBestSize())))

        if name == "swipeMisc":
            self.toolbars[name] = SwipeMiscToolbar(self)

            self._mgr.AddPane(self.toolbars[name],
                              wx.aui.AuiPaneInfo().
                              Name(name).Caption(_("Misc Toolbar")).
                              ToolbarPane().Top().
                              LeftDockable(False).RightDockable(False).
                              BottomDockable(False).TopDockable(True).
                              CloseButton(False).Layer(2).Row(1).
                              BestSize((self.toolbars[name].GetBestSize())))