Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Multi File editing
Alexis:
... that it is an important feature C::B is lacking.
Visual Studio and Eclipse have it.
And I know C::B developpers are aware of it ; but it seems quite complicated to implement.
Anyway, thanks a lot to devs for their great work !
Der Meister:
--- Quote from: MortenMacFly on June 13, 2008, 05:04:48 pm ---I am not sure if probably wxAuiNotebook can do this... there was a patch IIRC somewhere in the patch tracker that tried to achieve this behaviour.
--- End quote ---
wxAuiNotebook can do this. However, I couldn't find the patch you were talking about. Therefore I wrote my one patch:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2495&group_id=5358
This patch replaces the wxFlatNotebook containing the open editors by wxAuiNotebook. This allows detaching the editor and dragging it at another position. That way it is possible to edit two different files at one.
This patch also removes the old editor splitting mechanism as it is no more required.
Small drawback: The style of the tabs looks different than the style of wxFlatNotebook and cannot be changed from the application (yet). I see two possible solutions here: Either change replace all occurences of wxFlatNotebook by wxAuiNotebook or provide a custon wxAuiTabArt that implements the necessary styles.
Edit:
One thing I forgot about: Some contrib plugins need changes when the patch mentioned above is applied. I don't want to file an extra ticket on berlios for this therefore I'm just posting the necessary changes here:
--- Code: ---Index: src/plugins/contrib/ThreadSearch/ThreadSearchThread.cpp
===================================================================
--- src/plugins/contrib/ThreadSearch/ThreadSearchThread.cpp (revision 5095)
+++ src/plugins/contrib/ThreadSearch/ThreadSearchThread.cpp (working copy)
@@ -20,7 +20,7 @@
#include "configmanager.h"
#endif
-#include <wx/wxFlatNotebook/wxFlatNotebook.h>
+#include <wx/aui/auibook.h>
#include "ThreadSearchThread.h"
#include "ThreadSearchEvent.h"
Index: src/plugins/contrib/wxSmith/wxsresource.cpp
===================================================================
--- src/plugins/contrib/wxSmith/wxsresource.cpp (revision 5095)
+++ src/plugins/contrib/wxSmith/wxsresource.cpp (working copy)
@@ -24,7 +24,7 @@
#include "wxsextresmanager.h"
#include "wxsresourcetreeitemdata.h"
-#include <wx/wxFlatNotebook/wxFlatNotebook.h>
+#include <wx/aui/auibook.h>
#include <editormanager.h>
namespace
Index: src/plugins/contrib/keybinder/cbkeybinder.cpp
===================================================================
--- src/plugins/contrib/keybinder/cbkeybinder.cpp (revision 5095)
+++ src/plugins/contrib/keybinder/cbkeybinder.cpp (working copy)
@@ -1002,25 +1002,14 @@
{
wxWindow* pWindow = (wxWindow*)(event.GetEventObject());
cbEditor* ed = 0;
- cbStyledTextCtrl* p_cbStyledTextCtrl = 0;
- cbStyledTextCtrl* pLeftSplitWin = 0;
- cbStyledTextCtrl* pRightSplitWin = 0;
ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (ed)
- { p_cbStyledTextCtrl = ed->GetControl();
- pLeftSplitWin = ed->GetLeftSplitViewControl();
- pRightSplitWin = ed->GetRightSplitViewControl();
- //Has this window been split?
+ {
//**This is a temporary hack until some cbEvents are defined**
- if ( pWindow && (pRightSplitWin == 0) )
- {
- //-if (pRightSplitWin eq pWindow)
- //-{ Attach(pRightSplitWin);
- if (pWindow->GetParent() == ed)
- { LOGIT( _T("OnWindowCreateEvent Attaching:%p"), pWindow );
- AttachEditor(pWindow);
- }
- }
+ if ( pWindow && pWindow->GetParent() == ed)
+ { LOGIT( _T("OnWindowCreateEvent Attaching:%p"), pWindow );
+ AttachEditor(pWindow);
+ }
}
}//if m_bBound...
--- End code ---
MortenMacFly:
--- Quote from: Der Meister on June 15, 2008, 03:18:32 pm ---
--- Quote from: MortenMacFly on June 13, 2008, 05:04:48 pm ---I am not sure if probably wxAuiNotebook can do this... there was a patch IIRC somewhere in the patch tracker that tried to achieve this behaviour.
--- End quote ---
wxAuiNotebook can do this. However, I couldn't find the patch you were talking about. Therefore I wrote my one patch:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2495&group_id=5358
--- End quote ---
Wow... To be honest: I am speechless. I applied the patch and it just works. Very no... VERY nice work this is! Pretty cool!
MortenMacFly:
--- Quote from: MortenMacFly on June 16, 2008, 10:00:29 am ---
--- Quote from: Der Meister on June 15, 2008, 03:18:32 pm ---
--- Quote from: MortenMacFly on June 13, 2008, 05:04:48 pm ---I am not sure if probably wxAuiNotebook can do this... there was a patch IIRC somewhere in the patch tracker that tried to achieve this behaviour.
--- End quote ---
wxAuiNotebook can do this. However, I couldn't find the patch you were talking about. Therefore I wrote my one patch:
https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2495&group_id=5358
--- End quote ---
Wow... To be honest: I am speechless. I applied the patch and it just works. Very no... VERY nice work this is! Pretty cool!
--- End quote ---
Ok: here are some testing results:
- Opening files works (it opens them as another tab in the current active view)
- Searching / activating (in) files from a list works
- Different styles work (C++/XML for example)
- Undocking/Re-attaching works
- (Re-)Ordering tabs works
- Debugging across multiple files in different views / tabs work (cool!)
- Opening an already open file works (activates the right view/tab)
- Replacing in multiple file works (all files get "dirty")
- Saving all modified files works.
- (...continuing...)
Who is willing to test this under Linux?
Alexis:
Congratulations, guys, for this nice achievement.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version