Example #1
0
    def __init__(self, canvas, frame, name=None):
        """ Create a new toolbar object

        Parameters
        ----------
        data_collection : DataCollection instance
         The data collection that this toolbar is meant to edit.
         The toolbar looks to this collection for the available subsets
         to manipulate.
        canvas : Maptloblib canvas instance
         The drawing canvas to interact with
        frame : QWidget
         The QT frame that the canvas is embedded within.
        """
        self.buttons = {}
        self.__active = None
        self.basedir = None
        NavigationToolbar2QT.__init__(self, canvas, frame)
        if name is not None:
            self.setWindowTitle(name)
        self.setIconSize(QtCore.QSize(25, 25))
        self.layout().setSpacing(1)
        self.setFocusPolicy(Qt.StrongFocus)
        self._idKey = None

        # pyside is prone to segfaults if slots hold the only
        # reference to a signal, so we hold an extra reference
        # see https://bugreports.qt-project.org/browse/PYSIDE-88
        self.__signals = []
Example #2
0
    def __init__(self, canvas, frame, name=None):
        """ Create a new toolbar object

        Parameters
        ----------
        data_collection : DataCollection instance
         The data collection that this toolbar is meant to edit.
         The toolbar looks to this collection for the available subsets
         to manipulate.
        canvas : Maptloblib canvas instance
         The drawing canvas to interact with
        frame : QWidget
         The QT frame that the canvas is embedded within.
        """
        self.buttons = {}
        self.__active = None
        self.basedir = None
        NavigationToolbar2QT.__init__(self, canvas, frame)
        if name is not None:
            self.setWindowTitle(name)
        self.setIconSize(QtCore.QSize(25, 25))
        self.layout().setSpacing(1)
        self.setFocusPolicy(Qt.StrongFocus)
        self._idKey = None

        # pyside is prone to segfaults if slots hold the only
        # reference to a signal, so we hold an extra reference
        # see https://bugreports.qt-project.org/browse/PYSIDE-88
        self.__signals = []
Example #3
0
    def __init__(self , canvas , parent , direction = 'h' ) :
        #NavigationToolbar.__init__(self,parent,canvas)
        #self.layout = QVBoxLayout( self )
        self.canvas = canvas
        QtGui.QWidget.__init__( self, parent )

        if direction=='h' :    self.layout = QtGui.QHBoxLayout( self )
        else : self.layout = QtGui.QVBoxLayout( self )
        self.layout.setMargin( 2 )
        self.layout.setSpacing( 0 )
        NavigationToolbar.__init__( self, canvas, parent ) 
Example #4
0
    def __init__(self, canvas, parent, coordinates=True):
        """
        Constructor of NavToolBar

        :param canvas: the matplotlib canvas
        :type canvas: matplotlib.backends.backend_qt4agg.FigureCanvasQTAgg
        :param parent: the parent QWidget
        :type parent: PyQt4.QtGui.QWidget
        :param coordinates: boolean coordinates
        :type coordinates: bool
        """
        NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
        self.setIconSize(QSize(16, 16))
Example #5
0
    def __init__(self, parent, canvas, direction = 'h') :

        self.canvas = canvas
        QtGui.QWidget.__init__(self, parent)

        if direction=='h' :
            self.layout = QtGui.QHBoxLayout(self)
        else:
            self.layout = QtGui.QVBoxLayout(self)

        self.layout.setMargin(2)
        self.layout.setSpacing(0)

        NavigationToolbar.__init__(self, parent, canvas)
Example #6
0
    def __init__(self, figure_canvas, 
                 axes_canvas, parent=None):
        
        self.toolitems = (
            ('Home', 'Reset', 'home', 'home'),
            ('Pan', 'Pan', 'move', 'pan'),
            ('Zoom', 'Zoom', 'zoom_to_rect', 'zoom'),
            (None, None, None, None),
            ('Transect', 'make a transect', os.path.join(root_path,'icons','transect'),'transect_tool'),
            ('View', 'Switch view', os.path.join(root_path,'icons','switch'), 'switch_view'),
            ('Selector', 'Select node', os.path.join(root_path,'icons','select'), 'select_tool'),
            (None, None, None, None),
            ('Save', 'Save', 'filesave', 'save_figure')
            )

        #('Subplots', 'putamus parum claram', 'subplots', 'configure_subplots'),
        self.figure_canvas = figure_canvas
        self.axes_canvas = axes_canvas
    
        NavigationToolbar.__init__(self, figure_canvas, parent=parent)
Example #7
0
    def __init__(self, canvas, frame, name=None):
        """ Create a new toolbar object

        Parameters
        ----------
        data_collection : DataCollection instance
         The data collection that this toolbar is meant to edit.
         The toolbar looks to this collection for the available subsets
         to manipulate.
        canvas : Maptloblib canvas instance
         The drawing canvas to interact with
        frame : QWidget
         The QT frame that the canvas is embedded within.
        """
        self.buttons = {}
        self.basedir = None
        NavigationToolbar2QT.__init__(self, canvas, frame)
        if name is not None:
            self.setWindowTitle(name)
        self.setIconSize(QtCore.QSize(25, 25))
        self.layout().setSpacing(1)
        self.setFocusPolicy(Qt.StrongFocus)
Example #8
0
    def __init__(self, canvas, frame, name=None):
        """ Create a new toolbar object

        Parameters
        ----------
        data_collection : DataCollection instance
         The data collection that this toolbar is meant to edit.
         The toolbar looks to this collection for the available subsets
         to manipulate.
        canvas : Maptloblib canvas instance
         The drawing canvas to interact with
        frame : QWidget
         The QT frame that the canvas is embedded within.
        """
        self.buttons = {}
        self.basedir = None
        NavigationToolbar2QT.__init__(self, canvas, frame)
        if name is not None:
            self.setWindowTitle(name)
        self.setIconSize(QtCore.QSize(25, 25))
        self.layout().setSpacing(1)
        self.setFocusPolicy(Qt.StrongFocus)
        self._idKey = None
Example #9
0
 def __init__(self, canvas, parent, coordinates=False):
     NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
     self.setIconSize(QtCore.QSize(20, 20))
Example #10
0
 def __init__(self, canvas, parent, coordinates=False):
     NavigationToolbar2QT.__init__(self, canvas, parent, coordinates)
     self.setIconSize(QtCore.QSize(20, 20)) # to change size of icons in toolbar