Author Topic: Does Code::Blocks support multiple monitor editing?  (Read 908 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5736
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Does Code::Blocks support multiple monitor editing?
« on: October 06, 2022, 12:17:39 pm »
I see some old thread here: multi-monitor editing

But is it possible currently.

Maybe, we can drag the wxAuiNotebook to another monitor?
Or a floating editor window in another monitor?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1254
Re: Does Code::Blocks support multiple monitor editing?
« Reply #1 on: October 06, 2022, 12:41:45 pm »
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.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5736
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Does Code::Blocks support multiple monitor editing?
« Reply #2 on: October 06, 2022, 12:58:55 pm »
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:

Code
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();
}
« Last Edit: October 06, 2022, 03:15:54 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5736
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Does Code::Blocks support multiple monitor editing?
« Reply #3 on: October 06, 2022, 03:01:32 pm »
In the function: void MainFrame::CreateIDE()

There are some code snippets like:

Code
    // 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:

Code
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);
« Last Edit: October 06, 2022, 03:07:39 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.