The main editor window seems to be anchored, but other windows (Management, Open Files List, Watches or Logs & others) can be moved to other monitor. I have not tried to save their positions, though.
Yes, the editor window(I guess it is wxAuiNotebook) is docked, and can't be floated. But even it can be floated, can we make two floated? We have add a new floating wxAuiNotebook window?
I'm going to check whether wx samples.
EDIT
I just checked the wxAui sample project.
In its menu: View->Notebook, a new floating notebook is created, I can maximize the new notebook in the second monitor, and I can drag the editor(panel) between the old and new wxNotebook.
EDIT2
I added the wxAui sample application screen shot.
The code in aui sample looks like simple:
void MyFrame::OnCreateNotebook(wxCommandEvent& WXUNUSED(event))
{
m_mgr.AddPane(CreateNotebook(), wxAuiPaneInfo().
Caption("Notebook").
Float().FloatingPosition(GetStartPosition()).
//FloatingSize(FromDIP(wxSize(300,200))).
CloseButton(true).MaximizeButton(true));
m_mgr.Update();
}
In the function: void MainFrame::CreateIDE()
There are some code snippets like:
// editor manager
m_LayoutManager.AddPane(m_pEdMan->GetNotebook(), wxAuiPaneInfo().Name("MainPane").
CentrePane());
So, this is the CentrePane, I think we can't make it float.
Edit:
It is a bit complex to construct the cbAuiNotebook, see the code below:
EditorManager::EditorManager()
: m_pNotebook(nullptr),
m_pNotebookStackHead(new cbNotebookStack),
m_pNotebookStackTail(m_pNotebookStackHead),
m_nNotebookStackSize(0),
m_isCheckingForExternallyModifiedFiles(false)
{
m_pData = new EditorManagerInternalData(this);
m_pNotebook = new cbAuiNotebook(Manager::Get()->GetAppWindow(), ID_NBEditorManager, wxDefaultPosition, wxDefaultSize,
wxAUI_NB_DEFAULT_STYLE | wxAUI_NB_WINDOWLIST_BUTTON | wxNO_FULL_REPAINT_ON_RESIZE | wxCLIP_CHILDREN);
This is the v3 patch.
It can load a project and close a project without crash, and I can drag the source file from one notebook to another.
Our "Start here" page is a very special editor we must handle it carefully. I try to fix some crashed here and there.
The remaining issue is that some plugins such as the CodeCompletion's toolbar does not work well(disabled) when I drag a file from the first notebook to the second notebook.
Another issue is that I can't drag a file to an empty notebook, see my bug report here: I can not drag a panel to an empty wxAuiNotebook from another wxAuiNotebook (https://github.com/wxWidgets/wxWidgets/issues/24111)
EDIT
EditorBase* EditorManager::GetActiveEditor()
{
// find which is the active cbAuiNotebook
cbAuiNotebook* activeNotebook = m_pNotebook;
// if (m_pNotebook2->IsActive())
// {
// activeNotebook = m_pNotebook2;
// }
// else
// {
// activeNotebook = m_pNotebook;
// }
// @fixme how can we determine which notebook is active?
if (activeNotebook->GetPageCount() > 0)
{
return InternalGetEditorBase(activeNotebook, activeNotebook->GetSelection());
}
return nullptr;
}
The issue is that I don't know which is the "active" notebook. Any idea on how to solve this issue?