Пример #1
0
    def openEditor(self, event=None, fullscreen=False):
        """Opens a PassageFrame to edit this passage."""
        image = self.passage.isImage()

        if not hasattr(self, 'passageFrame'):
            if image:
                self.passageFrame = ImageFrame(None, self, self.app)
            elif self.passage.title == "StorySettings":
                self.passageFrame = StorySettingsFrame(None, self, self.app)
            else:
                self.passageFrame = PassageFrame(None, self, self.app)
                if fullscreen: self.passageFrame.openFullscreen()
            self.passageFrame.Bind(wx.EVT_WINDOW_DESTROY,
                                   lambda e: delattr(self, 'passageFrame'))
        else:
            self.passageFrame.Iconize(False)
            self.passageFrame.Raise()
            if fullscreen and not image: self.passageFrame.openFullscreen()
Пример #2
0
    def openEditor(self, event=None, fullscreen=False):
        """Opens a PassageFrame to edit this passage."""
        image = self.passage.isImage()

        if (not hasattr(self, 'passageFrame')):
            if image:
                self.passageFrame = ImageFrame(None, self, self.app)
            else:
                self.passageFrame = PassageFrame(None, self, self.app)
                if fullscreen: self.passageFrame.openFullscreen()
        else:
            try:
                self.passageFrame.Iconize(False)
                self.passageFrame.Raise()
                if fullscreen and not image: self.passageFrame.openFullscreen()
            except wx._core.PyDeadObjectError:
                # user closed the frame, so we need to recreate it
                delattr(self, 'passageFrame')
                self.openEditor(event, fullscreen)
Пример #3
0
    def openEditor(self, event=None, fullscreen=False):
        """Opens a PassageFrame to edit this passage."""
        image = self.passage.isImage()

        if not hasattr(self, 'passageFrame'):
            if image:
                self.passageFrame = ImageFrame(None, self, self.app)
            elif self.passage.title == "StorySettings":
                self.passageFrame = StorySettingsFrame(None, self, self.app)
            else:
                self.passageFrame = PassageFrame(None, self, self.app)
                if fullscreen: self.passageFrame.openFullscreen()
        else:
            try:
                self.passageFrame.Iconize(False)
                self.passageFrame.Raise()
                if fullscreen and not image: self.passageFrame.openFullscreen()
            except RuntimeError:
                # user closed the frame, so we need to recreate it
                delattr(self, 'passageFrame')
                self.openEditor(event, fullscreen)