1
#-----------------------------------------------------------------------------
5
# Author: Riaan Booysen
8
# RCS-ID: $Id: HTMLSupport.py,v 1.8 2005/05/18 12:05:11 riaan Exp $
9
# Copyright: (c) 2002 - 2005
11
#-----------------------------------------------------------------------------
12
print 'importing Models.HTMLSupport'
16
import Preferences, Utils, Plugins
19
EditorHelper.imgHTMLFileModel = EditorHelper.imgIdxRange()
21
from Models.EditorModels import PersistentModel
23
class HTMLFileModel(PersistentModel):
24
modelIdentifier = 'HTML'
26
bitmap = 'WebDocHTML.png'
27
imgIdx = EditorHelper.imgHTMLFileModel
31
from Views.StyledTextCtrls import LanguageSTCMix, stcConfigPath
32
class BaseHTMLStyledTextCtrlMix(LanguageSTCMix):
33
def __init__(self, wId):
34
LanguageSTCMix.__init__(self, wId,
35
(0, Preferences.STCLineNumMarginWidth), 'html', stcConfigPath)
38
class HTMLStyledTextCtrlMix(BaseHTMLStyledTextCtrlMix):
39
def __init__(self, wId):
40
BaseHTMLStyledTextCtrlMix.__init__(self, wId)
44
wxID_HTMLSOURCEVIEW = wx.NewId()
45
from Views.SourceViews import EditorStyledTextCtrl
46
class HTMLSourceView(EditorStyledTextCtrl, HTMLStyledTextCtrlMix):
48
def __init__(self, parent, model):
49
EditorStyledTextCtrl.__init__(self, parent, wxID_HTMLSOURCEVIEW,
51
HTMLStyledTextCtrlMix.__init__(self, wxID_HTMLSOURCEVIEW)
56
from Views.EditorViews import HTMLFileView
57
class HTMLFileController(Controllers.PersistentController):
59
DefaultViews = [HTMLSourceView]
60
AdditionalViews = [HTMLFileView]
62
#-------------------------------------------------------------------------------
64
Plugins.registerFileType(HTMLFileController, aliasExts=('.htm',))
65
Plugins.registerLanguageSTCStyle('HTML', 'html', BaseHTMLStyledTextCtrlMix, 'stc-styles.rc.cfg')
1
#-----------------------------------------------------------------------------
5
# Author: Riaan Booysen
8
# RCS-ID: $Id: HTMLSupport.py,v 1.11 2007/07/02 15:01:12 riaan Exp $
9
# Copyright: (c) 2002 - 2007
11
#-----------------------------------------------------------------------------
12
print 'importing Models.HTMLSupport'
16
import Preferences, Utils, Plugins
20
EditorHelper.imgHTMLFileModel = EditorHelper.imgIdxRange()
22
from Models.EditorModels import PersistentModel
24
class HTMLFileModel(PersistentModel):
25
modelIdentifier = 'HTML'
27
bitmap = 'WebDocHTML.png'
28
imgIdx = EditorHelper.imgHTMLFileModel
32
from Views.StyledTextCtrls import LanguageSTCMix, stcConfigPath
33
class BaseHTMLStyledTextCtrlMix(LanguageSTCMix):
34
def __init__(self, wId):
35
LanguageSTCMix.__init__(self, wId,
36
(0, Preferences.STCLineNumMarginWidth), 'html', stcConfigPath)
39
class HTMLStyledTextCtrlMix(BaseHTMLStyledTextCtrlMix):
40
def __init__(self, wId):
41
BaseHTMLStyledTextCtrlMix.__init__(self, wId)
45
wxID_HTMLSOURCEVIEW = wx.NewId()
46
from Views.SourceViews import EditorStyledTextCtrl
47
class HTMLSourceView(EditorStyledTextCtrl, HTMLStyledTextCtrlMix):
51
def __init__(self, parent, model):
52
EditorStyledTextCtrl.__init__(self, parent, wxID_HTMLSOURCEVIEW,
54
HTMLStyledTextCtrlMix.__init__(self, wxID_HTMLSOURCEVIEW)
59
from Views.EditorViews import HTMLFileView
60
class HTMLFileController(Controllers.PersistentController):
62
DefaultViews = [HTMLSourceView]
63
AdditionalViews = [HTMLFileView]
65
#-------------------------------------------------------------------------------
67
Plugins.registerFileType(HTMLFileController, aliasExts=('.htm',))
68
Plugins.registerLanguageSTCStyle('HTML', 'html', BaseHTMLStyledTextCtrlMix, 'stc-styles.rc.cfg')