I have a question about the proper way to obtain a ptr to the cbStyledTextCtrl window.
In HEAD, when a plugin gets an EVT_EDITOR_CLOSE event, it cannot use GetBuiltinActiveEditor()
because the active editor is NOT the one being closed. Attempting to do so will crash C::B.
How should one get a ptr to SCIwindow from event.GetEditor() ??
class EditorBase has no GetControl() function.
RC2 had a event.GetEditor()->GetControl() call.
In the following hack, ...FindWindowByName("SCIwindow", event.GetEditor()) works, but is it
proper to do so??
// ----------------------------------------------------------------------------
void cbDragScroll::OnEditorClose(CodeBlocksEvent& event)
// ----------------------------------------------------------------------------
{
if (m_IsAttached)
{
// Get rid of our event handler
//v1.RC2 wxFrame* thisEditor = (wxFrame*)event.GetEditor()->GetControl();
wxWindow* thisWindow = event.GetEditor();
//v1.RC3 alpha
// Cannot use GetBuiltinActiveEditor() because the active Editor is NOT the
// one being closed!!
// wxWindow* thisEditor
// = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetControl();
//find the cbStyledTextCtrl wxScintilla window
wxWindow*
thisEditor = thisWindow->FindWindowByName("SCIwindow", thisWindow);
if ( (thisEditor) && (m_EditorPtrs.Index(thisEditor) != wxNOT_FOUND))
thanks
Pecan