Ejemplo n.º 1
0
    def _create_justification_button(self):
        """Creates horizontal justification button"""

        iconnames = ["JustifyLeft", "JustifyCenter", "JustifyRight"]
        bmplist = [icons[iconname] for iconname in iconnames]
        self.justify_tb = _widgets.BitmapToggleButton(self, bmplist)
        self.justify_tb.SetToolTipString(_(u"Justification"))
        self.Bind(wx.EVT_BUTTON, self.OnJustification, self.justify_tb)
        self.AddControl(self.justify_tb)
Ejemplo n.º 2
0
    def _create_alignment_button(self):
        """Creates vertical alignment button"""

        iconnames = ["AlignTop", "AlignCenter", "AlignBottom"]
        bmplist = [icons[iconname] for iconname in iconnames]

        self.alignment_tb = _widgets.BitmapToggleButton(self, bmplist)
        self.alignment_tb.SetToolTipString(_(u"Alignment"))
        self.Bind(wx.EVT_BUTTON, self.OnAlignment, self.alignment_tb)
        self.AddControl(self.alignment_tb)
Ejemplo n.º 3
0
    def _create_textrotation_button(self):
        """Create text rotation toggle button"""

        iconnames = ["TextRotate270", "TextRotate0", "TextRotate90",
                     "TextRotate180"]
        bmplist = [icons[iconname] for iconname in iconnames]

        self.rotation_tb = _widgets.BitmapToggleButton(self, bmplist)
        self.rotation_tb.SetToolTipString(_(u"Cell text rotation"))
        self.Bind(wx.EVT_BUTTON, self.OnRotate, self.rotation_tb)
        self.AddControl(self.rotation_tb)
Ejemplo n.º 4
0
    def __init__(self, parent, *args, **kwargs):

        ToolbarBase.__init__(self, parent, *args, **kwargs)

        self.search_history = []
        self.search_options = ["DOWN"]
        self.search_options_buttons = ["MATCH_CASE", "REG_EXP", "WHOLE_WORD"]

        # Controls
        # --------

        # Search entry control
        search_tooltip = _("Find in code and results")
        self.search = wx.SearchCtrl(self,
                                    size=(140, -1),
                                    style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
        self.search.SetToolTip(wx.ToolTip(search_tooltip))
        self.menu = self.make_menu()
        self.search.SetMenu(self.menu)

        # Search direction togglebutton
        direction_tooltip = _("Search direction")
        iconnames = ["GoDown", "GoUp"]
        bmplist = [icons[iconname] for iconname in iconnames]
        self.search_direction_tb = _widgets.BitmapToggleButton(self, bmplist)
        self.search_direction_tb.SetToolTip(wx.ToolTip(direction_tooltip))

        # Toolbar data
        # ------------

        self.toolbardata = [
            ["C", self.search, search_tooltip],
            ["C", self.search_direction_tb, direction_tooltip],
            ["O", "MATCH_CASE", _("Case sensitive")],
            ["O", "REG_EXP", _("Regular expression")],
            ["O", "WHOLE_WORD",
             _("Surrounded by whitespace")],
        ]

        self.add_tools()

        # Bindings and polish
        # -------------------

        self._bindings()