コード例 #1
0
ファイル: backend_tkagg.py プロジェクト: Root-shady/opencv
 def __init__(self, toolmanager, window):
     ToolContainerBase.__init__(self, toolmanager)
     xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
     height, width = 50, xmax - xmin
     Tk.Frame.__init__(self, master=window, width=int(width), height=int(height), borderwidth=2)
     self._toolitems = {}
     self.pack(side=Tk.TOP, fill=Tk.X)
     self._groups = {}
コード例 #2
0
ファイル: backend_gtk3.py プロジェクト: jklymak/matplotlib
    def __init__(self, toolmanager):
        ToolContainerBase.__init__(self, toolmanager)
        Gtk.Box.__init__(self)
        self.set_property("orientation", Gtk.Orientation.VERTICAL)

        self._toolarea = Gtk.Box()
        self._toolarea.set_property('orientation', Gtk.Orientation.HORIZONTAL)
        self.pack_start(self._toolarea, False, False, 0)
        self._toolarea.show_all()
        self._groups = {}
        self._toolitems = {}
コード例 #3
0
ファイル: backend_gtk3.py プロジェクト: wuhaochen/matplotlib
    def __init__(self, toolmanager):
        ToolContainerBase.__init__(self, toolmanager)
        Gtk.Box.__init__(self)
        self.set_property("orientation", Gtk.Orientation.VERTICAL)

        self._toolarea = Gtk.Box()
        self._toolarea.set_property('orientation', Gtk.Orientation.HORIZONTAL)
        self.pack_start(self._toolarea, False, False, 0)
        self._toolarea.show_all()
        self._groups = {}
        self._toolitems = {}
コード例 #4
0
 def __init__(self, toolmanager, window):
     ToolContainerBase.__init__(self, toolmanager)
     xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
     height, width = 50, xmax - xmin
     Tk.Frame.__init__(self,
                       master=window,
                       width=int(width),
                       height=int(height),
                       borderwidth=2)
     self._toolitems = {}
     self.pack(side=Tk.TOP, fill=Tk.X)
     self._groups = {}
コード例 #5
0
 def __init__(self, toolmanager, window):
     ToolContainerBase.__init__(self, toolmanager)
     xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
     height, width = 50, xmax - xmin
     tk.Frame.__init__(self, master=window,
                       width=int(width), height=int(height),
                       borderwidth=2)
     self._message = tk.StringVar(master=self)
     self._message_label = tk.Label(master=self, textvariable=self._message)
     self._message_label.pack(side=tk.RIGHT)
     self._toolitems = {}
     self.pack(side=tk.TOP, fill=tk.X)
     self._groups = {}
コード例 #6
0
 def __init__(self, toolmanager, parent):
     ToolContainerBase.__init__(self, toolmanager)
     QtWidgets.QToolBar.__init__(self, parent)
     self.setAllowedAreas(
         QtCore.Qt.TopToolBarArea | QtCore.Qt.BottomToolBarArea)
     message_label = QtWidgets.QLabel("")
     message_label.setAlignment(
         QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
     message_label.setSizePolicy(
         QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                               QtWidgets.QSizePolicy.Ignored))
     self._message_action = self.addWidget(message_label)
     self._toolitems = {}
     self._groups = {}
コード例 #7
0
 def __init__(self, toolmanager, parent):
     ToolContainerBase.__init__(self, toolmanager)
     QtWidgets.QToolBar.__init__(self, parent)
     self.setAllowedAreas(QtCore.Qt.ToolBarArea(
         _to_int(_enum("QtCore.Qt.ToolBarArea").TopToolBarArea) |
         _to_int(_enum("QtCore.Qt.ToolBarArea").BottomToolBarArea)))
     message_label = QtWidgets.QLabel("")
     message_label.setAlignment(QtCore.Qt.AlignmentFlag(
         _to_int(_enum("QtCore.Qt.AlignmentFlag").AlignRight) |
         _to_int(_enum("QtCore.Qt.AlignmentFlag").AlignVCenter)))
     message_label.setSizePolicy(QtWidgets.QSizePolicy(
         _enum("QtWidgets.QSizePolicy.Policy").Expanding,
         _enum("QtWidgets.QSizePolicy.Policy").Ignored,
     ))
     self._message_action = self.addWidget(message_label)
     self._toolitems = {}
     self._groups = {}
コード例 #8
0
 def __init__(self, toolmanager, window=None):
     ToolContainerBase.__init__(self, toolmanager)
     if window is None:
         window = self.toolmanager.canvas.get_tk_widget().master
     xmin, xmax = self.toolmanager.canvas.figure.bbox.intervalx
     height, width = 50, xmax - xmin
     tk.Frame.__init__(self, master=window,
                       width=int(width), height=int(height),
                       borderwidth=2)
     self._label_font = tkinter.font.Font(size=10)
     self._message = tk.StringVar(master=self)
     self._message_label = tk.Label(master=self, font=self._label_font,
                                    textvariable=self._message)
     self._message_label.pack(side=tk.RIGHT)
     self._toolitems = {}
     self.pack(side=tk.TOP, fill=tk.X)
     self._groups = {}
コード例 #9
0
    def __init__(self, toolmanager):
        ToolContainerBase.__init__(self, toolmanager)
        Gtk.Box.__init__(self)
        self.set_property('orientation', Gtk.Orientation.HORIZONTAL)

        # Tool items are created later, but must appear before the message.
        self._tool_box = Gtk.Box()
        self.append(self._tool_box)
        self._groups = {}
        self._toolitems = {}

        # This filler item ensures the toolbar is always at least two text
        # lines high. Otherwise the canvas gets redrawn as the mouse hovers
        # over images because those use two-line messages which resize the
        # toolbar.
        label = Gtk.Label()
        label.set_markup(
            '<small>\N{NO-BREAK SPACE}\n\N{NO-BREAK SPACE}</small>')
        label.set_hexpand(True)  # Push real message to the right.
        self.append(label)

        self._message = Gtk.Label()
        self.append(self._message)
コード例 #10
0
ファイル: backend_qt5.py プロジェクト: endolith/matplotlib
 def __init__(self, toolmanager, parent):
     ToolContainerBase.__init__(self, toolmanager)
     QtWidgets.QToolBar.__init__(self, parent)
     self._toolitems = {}
     self._groups = {}
コード例 #11
0
ファイル: backend_qt5.py プロジェクト: stonebig/matplotlib
 def __init__(self, toolmanager, parent):
     ToolContainerBase.__init__(self, toolmanager)
     QtWidgets.QToolBar.__init__(self, parent)
     self._toolitems = {}
     self._groups = {}
     self._last = None