Changeset 1886


Ignore:
Timestamp:
08/21/10 22:05:59 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-1801)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: help FUNCNAME

Put in Release Notes: No

Module(s):

Description: added help documents of the class methods.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/notationwindow.py

    r1885 r1886  
    2828    def print_text(self):
    2929        """
     30        Print a note on a canvas specified with the Notation window.
     31        Called when 'print' button selected on the window.
    3032        """
    3133        anchor = self.anchors[self._get_anchval()]
     
    246248        """
    247249        Cancel deleting the selected note.
    248         Fired when 'Cancel' button selected on confirmation dialog
     250        Called when 'cancel' button selected on confirmation dialog.
    249251        """
    250252        asaplog.push( "Cancel deleting: '"+self.seltext['textobj'].get_text()+"'" )
     
    262264class NotationWindowTkAgg(NotationWindowCommon):
    263265    """
    264     Backend based
     266    Backend based class to create widgets to add, modify, or delete
     267    note on the plot.
     268
     269    Note:
     270    Press LEFT-mouse button on the plot to ADD a note on the canvas.
     271    A notation window will be loaded for specifying note string and
     272    anchor. The note will be anchored on a position in whether figure-
     273    (0-1 relative in a figure), panel- (0-1 relative in a plot axes),
     274    or data-coordinate (data value in a plot axes).
     275    Press RIGHT-mouse button on a note to MODIFY/DELETE it. A cascade
     276    menu will be displayed and you can select an operation.
    265277    """
    266278    def __init__(self,master=None):
     
    273285    ### Notation window widget
    274286    def _create_textwindow(self,master=None):
     287        """Create notation window widget and iconfy it"""
    275288        twin = Tk.Toplevel(padx=3,pady=3)
    276         twin.title("Annotation")
     289        twin.title("Notation")
    277290        twin.resizable(width=True,height=True)
    278291        self.textbox = self._NotationBox(parent=twin)
     
    318331
    319332    def _enable_radio(self):
     333        """Enable 'panel' and 'data' radio button"""
    320334        self.rAxis.config(state=Tk.NORMAL)
    321335        self.rData.config(state=Tk.NORMAL)
     
    324338
    325339    def _reset_radio(self):
     340        """Disable 'panel' and 'data' radio button"""
    326341        self.rAxis.config(state=Tk.DISABLED)
    327342        self.rData.config(state=Tk.DISABLED)
     
    330345
    331346    def _select_radio(self,selection):
     347        """Select a specified radio button"""
    332348        if not selection in self.anchors:
    333349            return
     
    340356
    341357    def _get_anchval(self):
     358        """Returns a integer of a selected radio button"""
    342359        return self.anchval.get()
    343360
    344361    def _get_note(self):
     362        """Returns a note string specified in the text box"""
    345363        return self.textbox.get("1.0",Tk.END)
    346364
    347365    def _clear_textbox(self):
     366        """Clear the text box"""
    348367        self.textbox.delete("1.0",Tk.END)
    349368
    350369    def _set_note(self,note=None):
     370        """Set a note string to the text box"""
    351371        self._clear_textbox()
    352372        if len(note) >0:
     
    368388
    369389    def _cancel_text(self):
     390        """
     391        Cancel adding/modifying a note and close notaion window.
     392        called when 'cancel' is selected.
     393        """
    370394        self.close_textwindow()
    371395
    372396    def _print_text(self):
     397        """
     398        Add/Modify a note. Called when 'print' is selected on the
     399        notation window.
     400        """
    373401        self.print_text()
    374402        self.close_textwindow()
     
    424452    ### Modify/Delete menu widget
    425453    def _create_modmenu(self,master=None):
     454        """Create modify/delete menu widget"""
    426455        if master:
    427456            self.parent = master
     
    482511    ### dialog to confirm deleting note
    483512    def _delnote_dialog(self):
     513        """Load dialog to confirm deletion of the text"""
    484514        remind = "Delete text?\n '"+self.seltext['textobj'].get_text()+"'"
    485515        answer = tkMessageBox.askokcancel(parent=self.parent,title="Delete?",
     
    493523    ### helper functions
    494524    def _disppix2screen(self,xpixd,ypixd):
    495         # calculate a pixel position form Upper-left of the SCREEN
    496         # from a pixel from Lower-left of the CANVAS (e.g., event.x/y)
     525        """
     526        helper function to calculate a pixel position form Upper-left
     527        corner of the SCREEN from a pixel position (xpixd, ypixd)
     528        from Lower-left of the CANVAS (which, e.g., event.x/y returns)
     529
     530        Returns:
     531            (x, y):  pixel position from Upper-left corner of the SCREEN.
     532        """
    497533        xpixs = self.parent.winfo_rootx() + xpixd
    498534        ypixs = self.parent.winfo_rooty() + self.parent.winfo_height() \
Note: See TracChangeset for help on using the changeset viewer.