| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
BraceHighlightMixin --+
|
object --+ |
| |
StandardReturnMixin --+
|
object --+ |
| |
ReindentBase --+ |
| |
StandardReindentMixin --+
|
object --+ |
| |
StandardParagraphMixin --+
|
object --+ |
| |
GenericFoldHierarchyMixin --+
|
object --+ |
| |
lib.foldexplorer.FoldExplorerMixin --+
|
object --+ |
| |
editra.ed_style.StyleMgr --+ |
| |
object --+ | |
| | |
debug.debugmixin --+ |
| |
editra.stcmixin.EditraSTCMixin --+
|
object --+ |
| |
wx._core.Object --+ |
| |
wx._core.EvtHandler --+ |
| |
wx._core.Window --+ |
| |
wx._core.Control --+ |
| |
wx.stc.StyledTextCtrl --+ |
| |
object --+ | |
| | |
stcinterface.STCInterface --+ |
| |
object --+ | |
| | |
debug.debugmixin --+ |
| |
stcbase.PeppyBaseSTC --+ |
| |
stcbase.PeppySTC --+
|
object --+ |
| |
lib.userparams.ClassPrefs --+ |
| |
object --+ | |
| | |
debug.debugmixin --+ |
| |
major.MajorMode --+
|
FundamentalMode
Major mode for editing generic text files.
This is the most generic major mode used for editing text files. This uses a PeppySTC as the editing window, and is linked to a Buffer object that in turn is linked to the backend storage of a PeppyBaseSTC.
All major modes that are edit text using an STC should be subclasses of this mode. Major modes that provide editing windows that aren't an STC (like the HexEdit view or an image viewer) will not be subclasses of this mode; rather, they will be subclasses of MajorMode and will only use an STC as the backend storage within the Buffer attribute that is associated with every major mode.
The STC uses the Editra system for styling text and fonts; it is based on matching the filename or extension with values from its database. Documentation on the Editra interface is forthcoming.
FundamentalMode is a subclass of PeppySTC, so
all of the STC methods are availble here for user interfacing. In
addition, some mixins are used, like the BraceHighlightMixin to provide language customizable
brace highlighting, and the StandardParagraphMixin used to determine the start and
end of a paragraph based on the major mode.
Two mixins in particular will need attention when subclassing FundamentalMode for new types of text files: StandardReturnMixin and StandardReindentMixin. The StandardReturnMixin provides handling for the return key and indenting the following line to the correct tab stop. The StandardReindentMixin is used to indent a line to its proper column based on the language supported by the major mode. FundamentalMode subclasses should override both of these classes and provide them as mixins in order to customize the major mode.
Because the FundamentalMode serves as the base class for all text editing modes, there are many defaults specified in the default_classprefs class attribute. These defaults are based on the ClassPrefs metaclass that associates keywords with values and serializes them to the peppy configuration file. ClassPrefs are a transparent way to handle the application preferences, and you'll find them used all over peppy. But, as their name suggests, ClassPrefs belong to the class, not the instance, so this is not for instance variable storage. See the ClassPrefs documentation for more information.
| Nested Classes | |
|
Inherited from Inherited from |
| Instance Methods | |||
|
|||
| EvtHandler |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
| Class Methods | |||
|
|||
|
|||
|
Inherited from Inherited from |
|||
| Static Methods | |
|
Inherited from Inherited from |
| Class Variables | |
classprefs = <peppy.lib.userparams.PrefsProxy object at 0x59f2
|
|
default_classprefs = StrParam('editra_style_sheet', '', 'Mode Default class preferences that relate to all instances of this major mode |
|
editra_synonym = NoneIf the editra file_type (defined as the LANG_* keywords in the editra source file peppy/editra/synglob.py) doesn't match the class attribute 'keyword', specify the editra file type here. |
|
end_line_comment =
|
|
keyword = The single-word keyword representing this major mode |
|
start_line_comment = Default comment characters in case the Editra styling database doesn't have any information about the mode |
|
|
Inherited from Inherited from Inherited from Inherited from |
|
| Properties | |
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
| Method Details |
Specific OnUpdateUI callback for those modes that use an actual STC for their edit window. Adds things like fold level and style display.
|
Create the STC and apply styling settings. Everything that subclasses from FundamentalMode will use an STC instance for displaying the user interaction window.
|
Apply settings to the view This is the place where settings for the class show their effects. Calling this should update the view to reflect any changes in the settings.
|
Create any icons in the status bar. This is called after making the major mode the active mode in the frame. The status bar will be cleared to its initial empty state, so all this method has to do is add any icons that it needs.
|
Return the list of action classes to use as a context menu. If the subclass is capable of displaying a popup menu, it needs to return a list of action classes. The x, y pixel coordinates (relative to the origin of major mode window) are included in case the subclass can display different popup items depending on the position in the editing window.
|
Hook to scroll to a non-default initial position if desired.
|
Hook to verify the mode can handle the specified Editra type.
|
Verify that the mimetype is text/plain. The class attribute mimetype is not used so that subclasses that extend Fundamental but forget to declare a MIME type won't also get added to the list of modes that handle text/plain. This default implementation will call MajorMode.verifyMimetype if not overridden by the subclass.
|
| Class Variable Details |
classprefs
|
default_classprefsDefault class preferences that relate to all instances of this major mode
|
editra_synonymIf the editra file_type (defined as the LANG_* keywords in the editra source file peppy/editra/synglob.py) doesn't match the class attribute 'keyword', specify the editra file type here. In other words, None here means that the editra file_type *does* match the keyword
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Feb 21 14:51:16 2008 | http://epydoc.sourceforge.net |