After the proof of concept test, here is a wrapper for the CodeMirror javascript libarary which runs quite happily in a Webview.
Current functionality:
In addition, the CodeEditor (also a b4xlib) is an example implementation. The only thing not implemented is file loading and saving as the would really depend on the structure of your project.
Dependencies:
CodeMirrorWrapper:
CodeEditor
CMMinimal Implementaion - Project
Downloads: (Dropbox)
Both the CodeMirror b4xlib and the CodeMirror project are too large to attach to the forum as they contain the CodeMirror javascript library.
You can download them from my dropbox here:
Version 1.5
Update 1.51
Update 1.52
The CodeEditor.b4xlib and Project and documentation XML files for both libraries are attached.
I hope you find them useful. Let me know how you get on with them.
Current functionality:
- Highlighting Mode for B4x (and 100+ other languages)
- Minimal wrapper implementation in library, see the attached CodeEditor for an example of a fuller implementation
- implemented the available visual themes
In addition, the CodeEditor (also a b4xlib) is an example implementation. The only thing not implemented is file loading and saving as the would really depend on the structure of your project.
Dependencies:
CodeMirrorWrapper:
CodeEditor
- CodeMirrorWrapper
CMMinimal Implementaion - Project
- CodeMirrorWrapper
Downloads: (Dropbox)
Both the CodeMirror b4xlib and the CodeMirror project are too large to attach to the forum as they contain the CodeMirror javascript library.
You can download them from my dropbox here:
Version 1.5
- Separated from the CodeEditor module for easier minimal implementation.
- Added ReadOnly option
- Added Themes
- Requires an allowedthemes List to be passed so they can be validataed against the defined themes.
- You can pass a subset of the defined themes so only your preferred themes are available.
Update 1.51
- Small process changes to enable minimal implementation
- Please download library / Project from the dropbox link
- added minimal implementation example.
Update 1.52
- Fixed readOnly bug
- Added LineWrapping
- Added Autofocus
- Removed dependency on JScriptEngine
- Added highlighting for jBasicScript (as B4s)
The CodeEditor.b4xlib and Project and documentation XML files for both libraries are attached.
I hope you find them useful. Let me know how you get on with them.
Attachments
Last edited: