예제 #1
0
    def ok(self, event=None):
        '''
        Overrides the DialogBox's ok method. It changes only in that
        it first verifies that at least one checkbox was checked.
        '''
        if not self._check_selected(self._result, tkinter.BooleanVar.get):
            return

        DialogBox.ok(self, event)
예제 #2
0
    def cancel(self, event=None):
        '''
        Overrides the DialogBox's cancel method. It changes only in
        that it first verifies that at least one checkbox was checked.
        '''
        aos = AstronomicalObject.common_astronomical_objects
        if not self._check_selected(aos, AstronomicalObject.is_selected):
            return

        DialogBox.cancel(self, event)
예제 #3
0
    def __init__(self, parent, title):
        '''
        Instantiates the dialog box.

        @precondition: none.

        @postcondition: the dialog box is initialized and ready to
        use.

        @param parent: The parent window for this dialog box.

        @param title: The title of the window.
        '''
        DialogBox.__init__(self, parent, DialogBox.OK, title)
예제 #4
0
    def __init__(self, parent, group, title=None):
        '''
        Instantiates the dialog box.

        @precondition: none.

        @postcondition: the dialog box is initialized and ready to
        use.

        @param parent: The parent window for this dialog box.

        @param title: The title for this dialog box. Optional.
        '''

        # We put these first because the __init__ below is going to
        # use them.
        self._result = []
        self._group = group
        self.distance = group.default_distance
        self._distance_var = None

        DialogBox.__init__(self, parent, DialogBox.OK_CANCEL, title)