Changeset 1888


Ignore:
Timestamp:
08/23/10 15:14:21 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (1801)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: A name of a button on toolbar changed to "notation"

Test Programs:

Put in Release Notes: No

Module(s): asap plotter

Description:

+ A name of a button on toolbar changed from "note" to "notation"
+ osx GUI handlings
+ workaround for old matplotlib


Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/casatoolbar.py

    r1885 r1888  
    200200                                   command=self.stat_cal)
    201201        self.bNote=self._NewButton(master=self,
    202                                    text=' note ',
     202                                   text='notation',
    203203                                   command=self.modify_note)
    204204        self.bQuit=self._NewButton(master=self,
  • trunk/python/notationwindow.py

    r1886 r1888  
    137137            #if axes.contains_point(pos): ### seems not working
    138138            #    return axes
    139             axbox = axes.get_position().get_points()
     139            try:
     140                axbox = axes.get_position().get_points()
     141            except AttributeError: ### WORKAROUND for old matplotlib
     142                axbox = self._oldpos2new(axes.get_position())
    140143            if (axbox[0][0] <= pos[0] <= axbox[1][0]) and \
    141144               (axbox[0][1] <= pos[1] <= axbox[1][1]):
    142145                return axes
    143146        return None
     147
     148    ### WORKAROUND for old matplotlib
     149    def _oldpos2new(self,oldpos=None):
     150        return [[oldpos[0],oldpos[1]],[oldpos[0]+oldpos[2],oldpos[1]+oldpos[3]]]
    144151       
    145152    def _convert_pix2dat(self,pos,axes):
     
    154161        # left-/bottom-pixel, and pixel width & height of the axes
    155162        bbox = axes.get_position()
    156         lbpos = bbox.get_points()[0]
    157         wax = bbox.width
    158         hax = bbox.height
     163        try:
     164            axpos = bbox.get_points()
     165        except AttributeError: ### WORKAROUND for old matplotlib
     166            axpos = self._oldpos2new(bbox)
    159167        # check pos value
    160         if (pos[0] < lbpos[0]) or (pos[1] < lbpos[1]) \
    161                or (pos[0] > (lbpos[0]+wax)) or (pos[1] > (lbpos[1]+hax)):
     168        if (pos[0] < axpos[0][0]) or (pos[1] < axpos[0][1]) \
     169               or (pos[0] > axpos[1][0]) or (pos[1] > axpos[1][1]):
    162170            raise ValueError, "The position is out of the axes"
    163171        xlims = axes.get_xlim()
     
    165173        wdat = xlims[1] - xlims[0]
    166174        hdat = ylims[1] - ylims[0]
    167         xdat = xlims[0] + wdat*(pos[0] - lbpos[0])/wax
    168         ydat = ylims[0] + hdat*(pos[1] - lbpos[1])/hax
     175        xdat = xlims[0] + wdat*(pos[0] - axpos[0][0])/(axpos[1][0] - axpos[0][0])
     176        ydat = ylims[0] + hdat*(pos[1] - axpos[0][1])/(axpos[1][1] - axpos[0][1])
    169177        return (xdat, ydat)
    170178
     
    298306        #twin.deiconify()
    299307        #twin.minsize(width=twin.winfo_width(),height=twin.winfo_height())
     308        twin.lift()
    300309        twin.withdraw()
    301310        return twin
     
    440449                                 height=self.textwin.winfo_height())
    441450            (w,h) = self.textwin.minsize()
     451        self.textwin.lift()
    442452        self.textwin.geometry("%sx%s+%s+%s"%(w,h,xpix,ypix))
    443453
Note: See TracChangeset for help on using the changeset viewer.