Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
External use of cbEditor
dje:
Hi !!
I am working on a plug-in and I would like to use the cbEditor class outside the wxFlatNotebook using the EditorManager.
This plug-in adds a Find occrences of: contextual menu item just below Find declaration of: and Find implementation of:
items.
Look at the attachment for a better global understanding.
The search looks like a Search in files with options on the panel but has the advantage is of using its own thread not to block the IDE when searching.
Results are redirected in a Search results log and propose a preview window.
I felt that need when diving into very large projects and beeing forced to switch from current editor and to change caret in current one when searching for items.
For now, I use the cbStyledTextCtrl with EditorColourSet to colorise but I would like to use cbEditor to manage all other user options and not reinvent the wheel.
Is it possible to change the API, changing from private to public some method mike SetEditorStyleBeforeFileOpen ??
By the way, are you interested in such a plug-in ?
Thanks
Dje
[attachment deleted by admin]
mandrav:
--- Quote ---For now, I use the cbStyledTextCtrl with EditorColourSet to colorise but I would like to use cbEditor to manage all other user options and not reinvent the wheel.
Is it possible to change the API, changing from private to public some method mike SetEditorStyleBeforeFileOpen ??
--- End quote ---
cbEditor is tightly coupled because it has to be (for various reasons). What is it exactly that you would do with cbEditor that you can't do with cbStyledTextCtrl? I 'd be happy to help you and even provide API access to any internals you would like, but not without a good reason too. So please explain a bit more.
dje:
I'd like to use the same configuration for my preview window as for the editor.
I am interested in all "already implemented" services concerning control management :
* colours
* folding
* indentation
* font
* bookmark
* contextual menu
* keyboard shortcuts (Ctrl+C)
For colours, I use :
--- Code: ---EditorColourSet EdColSet;
EdColSet.Apply(EdColSet.GetLanguageForFilename(m_sPreviewFilePath), m_pSearchPreview);
--- End code ---
But that's too limited.
Basically, for now, I need API to:
* create my control on my panel
* styling methods (SetEditorStyle()),
The idea is to provide a read only cbEditor to the user to be able to browse code without losing his "main" editor/position.
Thanks,
Dje
mandrav:
So you just want SetEditorStyleBeforeFileOpen() and SetEditorStyleAfterFileOpen() made public?
If that is so, then it is doable. Just say the word ;).
For more, don't even bother to ask. Not now that we 're heading into the API freeze.
dje:
Yes, please :wink:
I think it is sufficient.
What about the constructor ??
In header, there is
Note: you should not create a cbEditor object directly. Instead use EditorManager's methods to do it...
For sure I won't use EditorManager for creation as I want to be independant from the wxFlatNotebook...
Anything particular to know about construction requirements ??
Thanks,
Dje
Navigation
[0] Message Index
[#] Next page
Go to full version