Exemplo n.º 1
0
    def __init__(self,
                 master,
                 subFrame=None,
                 defSubFrame=None,
                 callFunc=None,
                 helpText=None,
                 helpURL=None,
                 **kargs):
        Tkinter.Frame.__init__(self, master, **kargs)
        RO.AddCallback.BaseMixin.__init__(self)
        RO.Wdg.CtxMenuMixin.__init__(
            self,
            helpURL=helpURL,
        )

        self.currRectCoords = []

        self.binFac = SubFrame.binFacAsArr(1)

        self.fullSize = None
        self.widthOverHeight = None
        self.redrawingRect = False

        self.subFrame = None
        self.defSubFrame = None

        self.subResRect = None  # None or an RO.Wdg.ResizableRect
        self.defRectID = None  # None or ID of a canvas rectangle

        cnvHeight = kargs.get("height", 100) - \
            2 * (self["borderwidth"] + self["highlightthickness"])

        self.cnv = Tkinter.Canvas(
            self,
            height=cnvHeight,
            width=1,  # start with this dimension and correct for image size
            selectborderwidth=0,
            highlightthickness=0,
            borderwidth=0,
        )
        self.cnv.pack(expand=True, fill="both")
        self.cnv.bind("<Configure>", self._setCnvSize)
        self.cnv.bind("<Map>", self._setCnvSize)
        if helpText:
            self.cnv.helpText = helpText

        if subFrame:
            self.setSubFrame(subFrame)

        if defSubFrame:
            self.setDefSubFrame(defSubFrame)

        if callFunc:
            self.addCallback(callFunc)
Exemplo n.º 2
0
    def __init__(self,
        master,
        subFrame = None,
        defSubFrame = None,
        callFunc = None,
        helpText = None,
        helpURL = None,
    **kargs):
        Tkinter.Frame.__init__(self, master, **kargs)
        RO.AddCallback.BaseMixin.__init__(self)
        RO.Wdg.CtxMenuMixin.__init__(self,
            helpURL = helpURL,
        )
        
        self.currRectCoords = []
        
        self.binFac = SubFrame.binFacAsArr(1)
    
        self.fullSize = None
        self.widthOverHeight = None
        self.redrawingRect = False
        
        self.subFrame = None
        self.defSubFrame = None

        self.subResRect = None # None or an RO.Wdg.ResizableRect
        self.defRectID = None # None or ID of a canvas rectangle
        
        cnvHeight = kargs.get("height", 100) - \
            2 * (self["borderwidth"] + self["highlightthickness"])
        
        self.cnv = Tkinter.Canvas(
            self,
            height = cnvHeight,
            width = 1, # start with this dimension and correct for image size
            selectborderwidth = 0,
            highlightthickness = 0,
            borderwidth = 0,
        )
        self.cnv.pack(expand = True, fill = "both") 
        self.cnv.bind("<Configure>", self._setCnvSize)
        self.cnv.bind("<Map>", self._setCnvSize)
        if helpText:
            self.cnv.helpText = helpText

        if subFrame:
            self.setSubFrame(subFrame)

        if defSubFrame:
            self.setDefSubFrame(defSubFrame)
        
        if callFunc:
            self.addCallback(callFunc)
Exemplo n.º 3
0
 def setBinFac(self, binFac):
     """Set bin factor.
     """
     self.binFac = SubFrame.binFacAsArr(binFac)
     self.update()
Exemplo n.º 4
0
 def setBinFac(self, binFac):
     """Set bin factor.
     """
     self.binFac = SubFrame.binFacAsArr(binFac)
     self.update()