Ejemplo n.º 1
0
def ZShowErrorMessage(parent, message, details):
    parent = getRootWindowOrDialog(parent)
    dlg = ZErrorDialog(parent, message, details)
    dlg.CentreOnScreen()
    dlg.ShowModal()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
Ejemplo n.º 2
0
def ZShowWarnMessage(parent, message, title):
    parent = getRootWindowOrDialog(parent)
    dlg = ZStandardDialog(parent, title, message, ZBaseDialog.OK_BUTTON, u"warning")  # $NON-NLS-1$
    dlg.CentreOnParent()
    dlg.ShowModal()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
Ejemplo n.º 3
0
def ZShowPersistentYesNoMessage(parent, question, title, prefsId, canRememberNoOption=False):
    parent = getRootWindowOrDialog(parent)
    dlg = ZPersistentYesNoDialog(parent, title, question, prefsId, canRememberNoOption)  # $NON-NLS-1$
    dlg.CenterOnParent()
    result = dlg.ShowModal() == wx.ID_YES
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
    return result
Ejemplo n.º 4
0
def ZShowExceptionMessage(parent, zexception):
    parent = getRootWindowOrDialog(parent)
    if not isinstance(zexception, ZException):
        zexception = ZException(rootCause=zexception)
    dlg = ZExceptionDialog(parent, zexception)
    dlg.CentreOnScreen()
    dlg.ShowModal()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
Ejemplo n.º 5
0
    def _bindWidgetEvents(self):
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_UPDATE_UI, self.onUpdateUI, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_SELECTION_CHANGE, self.onSelectionChange, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CONTEXT_MENU, self.onContextMenu, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CLICK, self.onClick, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_DBL_CLICK, self.onDoubleClick, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CONTENT_MODIFIED, self.onContentModified, self._getMshtmlControl())
        #self.Bind(IZMshtmlEvents.ZEVT_MSHTML_KEYPRESS, self.onKeyPress, self._getMshtmlControl())

        rootWindow = getRootWindowOrDialog(self)
        self.Bind(wx.EVT_ACTIVATE, self.onActivate, rootWindow)
Ejemplo n.º 6
0
def ZShowYesNoCancelMessage(parent, question, title):
    parent = getRootWindowOrDialog(parent)
    dlg = ZStandardDialog(
        parent, title, question, ZBaseDialog.YES_BUTTON | ZBaseDialog.NO_BUTTON | ZBaseDialog.CANCEL_BUTTON, u"question"
    )  # $NON-NLS-1$
    dlg.CentreOnParent()
    result = dlg.ShowModal()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
    return result
Ejemplo n.º 7
0
def ZShowConfirmDeletePostFromMultipleBlogsDialog(parent, document, blog, blogs):
    u"""Convenience function for opening the 'confirm delete post
    from multiple blogs dialog.  Returns a tuple:
    0 : wx.ID_*
    1 : alsoDeleteLocalCopy
    2 : list of blogs to delete from""" #$NON-NLS-1$

    parent = getRootWindowOrDialog(parent)
    dlg = ZConfirmDeletePostFromMultipleBlogsDialog(parent, document, blog, blogs)
    dlg.CenterOnParent()

    result = dlg.showDialog()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
    return result
Ejemplo n.º 8
0
    def _bindWidgetEvents(self):
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_UPDATE_UI, self.onUpdateUI,
                  self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_SELECTION_CHANGE,
                  self.onSelectionChange, self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CONTEXT_MENU, self.onContextMenu,
                  self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CLICK, self.onClick,
                  self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_DBL_CLICK, self.onDoubleClick,
                  self._getMshtmlControl())
        self.Bind(IZMshtmlEvents.ZEVT_MSHTML_CONTENT_MODIFIED,
                  self.onContentModified, self._getMshtmlControl())
        #self.Bind(IZMshtmlEvents.ZEVT_MSHTML_KEYPRESS, self.onKeyPress, self._getMshtmlControl())

        rootWindow = getRootWindowOrDialog(self)
        self.Bind(wx.EVT_ACTIVATE, self.onActivate, rootWindow)
Ejemplo n.º 9
0
def ZShowConfirmDeletePostFromMultipleBlogsDialog(parent, document, blog,
                                                  blogs):
    u"""Convenience function for opening the 'confirm delete post
    from multiple blogs dialog.  Returns a tuple:
    0 : wx.ID_*
    1 : alsoDeleteLocalCopy
    2 : list of blogs to delete from""" #$NON-NLS-1$

    parent = getRootWindowOrDialog(parent)
    dlg = ZConfirmDeletePostFromMultipleBlogsDialog(parent, document, blog,
                                                    blogs)
    dlg.CenterOnParent()

    result = dlg.showDialog()
    dlg.Destroy()
    if parent is not None:
        parent.RemoveChild(dlg)
    return result
Ejemplo n.º 10
0
    def DragEnter(self, dataObject, keyState, point, effect):
        # On drag enter, raise the window to the top
        rootWindow = getRootWindowOrDialog(self.mshtml)
        rootWindow.Raise()
        self.mshtml.SetFocus()
        self.mshtml.selectNone()

        self.handlers = None
        self.handled = False
        self.internalDataObject = None
        self.dndSource = self._createDnDSource(dataObject)

        # Now that we have the DnD source, check if it is supported.
        # Note: Always let mshtml handle HTML sources
        reffect = None
        if self.htmlHandler.canHandle(self.dndSource):
            reffect = self._DoOldDragEnter(dataObject, keyState, point, effect)
        elif self._isDnDSourceSupported(self.dndSource):
            self.handled = True
            reffect = DROPEFFECT_COPY
        else:
            reffect = self._DoOldDragEnter(dataObject, keyState, point, effect)

        return reffect
Ejemplo n.º 11
0
 def onActivateStageTwo(self):
     rootWindow = getRootWindowOrDialog(self)
     focusWindow = rootWindow.FindFocus()
     if focusWindow == self.mshtmlCtrl.getIHTMLDocument():
         self.mshtmlCtrl.SetFocus()
Ejemplo n.º 12
0
 def onActivateStageTwo(self):
     rootWindow = getRootWindowOrDialog(self)
     focusWindow = rootWindow.FindFocus()
     if focusWindow == self.mshtmlCtrl.getIHTMLDocument():
         self.mshtmlCtrl.SetFocus()