Beispiel #1
0
    def __init__(self, parent):
        ZBaseXHTMLEditControl.__init__(self, parent)

        self.stcCtrl = StyledTextCtrl(self,
                                      wx.NewId(),
                                      style=wx.NO_BORDER
                                      | wx.NO_FULL_REPAINT_ON_RESIZE)
        self.stcCtrl.CmdKeyAssign(ord(u'+'), STC_SCMOD_CTRL,
                                  STC_CMD_ZOOMIN)  #$NON-NLS-1$
        self.stcCtrl.CmdKeyAssign(ord(u'-'), STC_SCMOD_CTRL,
                                  STC_CMD_ZOOMOUT)  #$NON-NLS-1$

        self.autocompleteLocator = ZStcLocator(self.stcCtrl)
        self.autocompleteHandler = ZStcAutoCompleteHandler()
        self.autocompleteLocatorInfo = None

        self.validationReportProvider = ZXhtmlValidationReportListViewContentProvider(
        )
        self.validationView = ZXhtmlValidationReportView(
            self, self.validationReportProvider)

        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(self.stcCtrl, 3, wx.EXPAND)
        box.Add(self.validationView, 2, wx.EXPAND | wx.ALL, 4)
        self.SetAutoLayout(True)
        self.SetSizer(box)
        self.Layout()

        self.contentLoaded = False
        self._setLexer()
        self._setMargins()
        self._setMarkers()
        self._setStyles()
        self._bindStcEvents()
        self._bindWidgetEvents()
Beispiel #2
0
    def __init__(self, parent):
        ZBaseXHTMLEditControl.__init__(self, parent)

        self.stcCtrl = StyledTextCtrl(self, wx.NewId(), style = wx.NO_BORDER | wx.NO_FULL_REPAINT_ON_RESIZE)
        self.stcCtrl.CmdKeyAssign(ord(u'+'), STC_SCMOD_CTRL, STC_CMD_ZOOMIN) #$NON-NLS-1$
        self.stcCtrl.CmdKeyAssign(ord(u'-'), STC_SCMOD_CTRL, STC_CMD_ZOOMOUT) #$NON-NLS-1$

        self.autocompleteLocator = ZStcLocator(self.stcCtrl)
        self.autocompleteHandler = ZStcAutoCompleteHandler()
        self.autocompleteLocatorInfo = None

        self.validationReportProvider = ZXhtmlValidationReportListViewContentProvider()
        self.validationView = ZXhtmlValidationReportView(self, self.validationReportProvider)

        box = wx.BoxSizer(wx.VERTICAL)
        box.Add(self.stcCtrl, 3, wx.EXPAND)
        box.Add(self.validationView, 2, wx.EXPAND | wx.ALL, 4)
        self.SetAutoLayout(True)
        self.SetSizer(box)
        self.Layout()

        self.contentLoaded = False
        self._setLexer()
        self._setMargins()
        self._setMarkers()
        self._setStyles()
        self._bindStcEvents()
        self._bindWidgetEvents()
Beispiel #3
0
 def __init__(self, parent):
     ZBaseXHTMLEditControl.__init__(self, parent)
     self.mshtmlCtrl = None
     self.linkContext = None
     self.imageContext = None
     self.tableContext = None
     self._createWidgets()
     self._layoutWidgets()
     self._bindWidgetEvents()
Beispiel #4
0
 def __init__(self, parent):
     ZBaseXHTMLEditControl.__init__(self, parent)
     self.mshtmlCtrl = None
     self.linkContext = None
     self.imageContext = None
     self.tableContext = None
     self._createWidgets()
     self._layoutWidgets()
     self._bindWidgetEvents()
Beispiel #5
0
    def _getCapabilityIdList(self):
        rval = ZBaseXHTMLEditControl._getCapabilityIdList(self)
        rval.append(IZEditControl.ZCAPABILITY_CUT)
        rval.append(IZEditControl.ZCAPABILITY_COPY)
        rval.append(IZEditControl.ZCAPABILITY_PASTE)
        rval.append(IZEditControl.ZCAPABILITY_UNDO)
        rval.append(IZEditControl.ZCAPABILITY_REDO)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_ALL)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_NONE)
        # text editor capabilities
        rval.append(IZTextEditControl.ZCAPABILITY_FIND_TEXT)
        rval.append(IZTextEditControl.ZCAPABILITY_FINDREPLACE)

        # rich text editor capabilities
        rval.append(IZRichTextEditControl.ZCAPABILITY_BOLD)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ITALIC)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNDERLINE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_STRIKETHRU)

        # html domain capabilities
        rval.append(IZXHTMLEditControl.ZCAPABILITY_SCHEMA_AWARE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_VALIDATE_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_TIDY_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_PASTE_HTML)
#        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_IMAGE)
#        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_LINK)
        return rval
Beispiel #6
0
    def _getCapabilityIdList(self):
        rval = ZBaseXHTMLEditControl._getCapabilityIdList(self)
        rval.append(IZEditControl.ZCAPABILITY_CUT)
        rval.append(IZEditControl.ZCAPABILITY_COPY)
        rval.append(IZEditControl.ZCAPABILITY_PASTE)
        rval.append(IZEditControl.ZCAPABILITY_UNDO)
        rval.append(IZEditControl.ZCAPABILITY_REDO)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_ALL)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_NONE)
        # text editor capabilities
        rval.append(IZTextEditControl.ZCAPABILITY_FIND_TEXT)
        rval.append(IZTextEditControl.ZCAPABILITY_FINDREPLACE)

        # rich text editor capabilities
        rval.append(IZRichTextEditControl.ZCAPABILITY_BOLD)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ITALIC)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNDERLINE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_STRIKETHRU)

        # html domain capabilities
        rval.append(IZXHTMLEditControl.ZCAPABILITY_SCHEMA_AWARE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_VALIDATE_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_TIDY_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_PASTE_HTML)
        #        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_IMAGE)
        #        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_LINK)
        return rval
Beispiel #7
0
    def _getCapabilityIdList(self):
        u"""_getCapabilityIdList() -> list
        Returns list of supported capabilites.""" #$NON-NLS-1$
        rval = ZBaseXHTMLEditControl._getCapabilityIdList(self)

        # editor capabilities
        rval.append(IZEditControl.ZCAPABILITY_CUT)
        rval.append(IZEditControl.ZCAPABILITY_COPY)
        rval.append(IZEditControl.ZCAPABILITY_PASTE)
        rval.append(IZEditControl.ZCAPABILITY_UNDO)
        rval.append(IZEditControl.ZCAPABILITY_REDO)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_ALL)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_NONE)
        # text editor capabilities
        rval.append(IZTextEditControl.ZCAPABILITY_FIND_TEXT)
        rval.append(IZTextEditControl.ZCAPABILITY_FINDREPLACE)
        rval.append(IZTextEditControl.ZCAPABILITY_SPELLCHECK)
        # rich text editor capabilities
        rval.append(IZRichTextEditControl.ZCAPABILITY_FONT_NAME)
        rval.append(IZRichTextEditControl.ZCAPABILITY_FONT_SIZE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_COLOR)
        rval.append(IZRichTextEditControl.ZCAPABILITY_BACKGROUND)

        rval.append(IZRichTextEditControl.ZCAPABILITY_BOLD)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ITALIC)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNDERLINE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_STRIKETHRU)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_LEFT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_RIGHT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_CENTER)
        rval.append(IZRichTextEditControl.ZCAPABILITY_JUSTIFY)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ORDERED_LIST)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNORDERED_LIST)
        rval.append(IZRichTextEditControl.ZCAPABILITY_INDENT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_OUTDENT)
        # html domain capabilities
        rval.append(IZXHTMLEditControl.ZCAPABILITY_PASTE_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_IMAGE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_IMAGE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_LINK)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_LINK)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_TABLE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_TABLE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_FORMAT_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_SCHEMA_AWARE)

        return rval
Beispiel #8
0
    def _getCapabilityIdList(self):
        u"""_getCapabilityIdList() -> list
        Returns list of supported capabilites.""" #$NON-NLS-1$
        rval = ZBaseXHTMLEditControl._getCapabilityIdList(self)

        # editor capabilities
        rval.append(IZEditControl.ZCAPABILITY_CUT)
        rval.append(IZEditControl.ZCAPABILITY_COPY)
        rval.append(IZEditControl.ZCAPABILITY_PASTE)
        rval.append(IZEditControl.ZCAPABILITY_UNDO)
        rval.append(IZEditControl.ZCAPABILITY_REDO)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_ALL)
        rval.append(IZEditControl.ZCAPABILITY_SELECT_NONE)
        # text editor capabilities
        rval.append(IZTextEditControl.ZCAPABILITY_FIND_TEXT)
        rval.append(IZTextEditControl.ZCAPABILITY_FINDREPLACE)
        rval.append(IZTextEditControl.ZCAPABILITY_SPELLCHECK)
        # rich text editor capabilities
        rval.append(IZRichTextEditControl.ZCAPABILITY_FONT_NAME)
        rval.append(IZRichTextEditControl.ZCAPABILITY_FONT_SIZE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_COLOR)
        rval.append(IZRichTextEditControl.ZCAPABILITY_BACKGROUND)

        rval.append(IZRichTextEditControl.ZCAPABILITY_BOLD)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ITALIC)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNDERLINE)
        rval.append(IZRichTextEditControl.ZCAPABILITY_STRIKETHRU)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_LEFT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_RIGHT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ALIGN_CENTER)
        rval.append(IZRichTextEditControl.ZCAPABILITY_JUSTIFY)
        rval.append(IZRichTextEditControl.ZCAPABILITY_ORDERED_LIST)
        rval.append(IZRichTextEditControl.ZCAPABILITY_UNORDERED_LIST)
        rval.append(IZRichTextEditControl.ZCAPABILITY_INDENT)
        rval.append(IZRichTextEditControl.ZCAPABILITY_OUTDENT)
        # html domain capabilities
        rval.append(IZXHTMLEditControl.ZCAPABILITY_PASTE_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_IMAGE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_IMAGE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_LINK)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_LINK)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_TABLE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_EDIT_TABLE)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_INSERT_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_FORMAT_HTML)
        rval.append(IZXHTMLEditControl.ZCAPABILITY_SCHEMA_AWARE)

        return rval