Is it possible to edit two files simultaneously ... basically place them next to each other. In other word split the view .. but with two different files?A search in the forums would have revealed the answer, too... Hence I am giving it another time: No.
Do you know if it is planned to incorporate this feature in the IDE?I believe the only good way to do it is through a(ny kind of) layout manager. Thus if wxFlatNotebook would allow to detach tabs we are "done". 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.
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.wxAuiNotebook can do this. However, I couldn't find the patch you were talking about. Therefore I wrote my one patch:
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...
Wow... To be honest: I am speechless. I applied the patch and it just works. Very no... VERY nice work this is! Pretty cool!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.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
Ok: here are some testing results:Wow... To be honest: I am speechless. I applied the patch and it just works. Very no... VERY nice work this is! Pretty cool!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.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
I tested the patch yesterday under windows and had the following problem working with BrowseTracker.I don't use this plugin but I compiled/installed it now.
- Opening files works (it opens them as another tab in the current active view)Just tested on Linux and all tests passed without problems.
- 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?
I tested the patch yesterday under windows and had the following problem working with BrowseTracker.I don't use this plugin but I compiled/installed it now.
It seems the "right" tab get's quickly activated but then the current active one is re-activated. However, for the first choice it works. Seems like a bug in BrowseTracker to me... I don't know this plugin... probably Pecan can have a look into?!
really cool! no more third party components :)
... This patch also removes the old editor splitting mechanism as it is no more required.At times, it is very handy to have split views of the same file.
No, you are not missing anything.Der Meister ++ :)
I know that it is not possible to have two views of the same file with this patch any more. However, as far as I know this feature wasn't used very often. wxAuiNotebook has some splitting mechanism, therefore this feature could probably be kept even with this patch. But I don't think this is worth the effort and splitting editors in an already splitted notebook might even be somewhat confusing. I would like to hear more opinions on that issue.
But I don't think this is worth the effort and splitting editors in an already splitted notebook might even be somewhat confusing. I would like to hear more opinions on that issue.OK! If it is either/or, I would definitely prefer having the multiple file editing capability.
wxScintilla, TinyXml 8)
if (ed->IsBuiltinEditor())
static_cast<cbEditor*>(ed)->GetControl()->SetFocus();
This seems in fact to work... but different now. I realised the following:Codeif (ed->IsBuiltinEditor())
static_cast<cbEditor*>(ed)->GetControl()->SetFocus();
my local working copy already has a lot more modifications (no more wxFlatNotebook for example).Oh dear... that *really* sounds great... Time to open a SVN branch then... ;-)
Very, very strange...OK - I found a way to "reproduce" (it's very simple):
Before I put more effort into this I would like to ask the devs a question: Is this patch desired and will it be applied somewhere in the future? I know it won't be applied immediately because this patch implies big changes (MortenMacFly already named the issues) but I don't want to sacrifice a lot of work for it if no one is willing to apply it to the main codeline.
What doesn't work yet/needs to be done:
- Project files update
- Saving the layout of the editors
- Styling of the notebooks. Currently 'Settings->Environment->Notebook appearance' has just no effect.
1.) The patch does not work under Windows (it stops while trying to remove AUTHORS from wxFlatNotebook)Well, the patch just removes these files therefore this shouldn't be a big problem.
2.) wxContribItems is broken heavily afterwards because this relies on the wxFlatNotebook libraryYes, wxSmith might need its own copy of wxFlatNotebook to work with this patch.
Saving layout and the styling of notebooks remains (IMHO styling we could just remove).I wouldn't remove the sytling. I think most of it can be implemented as wxAuiNotebook gives you almost complete control over drawing the tabs. The styles used with wxFlatNotebooks should be possible to implement (possibly with borrowing some code from wxFlatNotebook ;) ). Maybe the gradient colors should be removed as wxAuiNotebook automatically grabs the wxAUI colors. The smart-tab option is also useless and I already removed it from my working copy. The option regarding the list or scroll buttons works in my working copy, too.
After a long period of silence I updated the patch again....nice! :-) Just compiling...
I do test it in everyday use on Windows XP and Vista. If I don't report any issues - all is fine (for me)... so at least 4 eyes see more than 2.
- Testing, especially on Windows (patch was developed on Linux)
Don't worry about this - I have done it in my local copy already. In addition some (newer) plugins required modification, too, which I did (e.g. code snippets).
- Project files update
Index: BrowseTracker/BrowseSelector.h
===================================================================
--- BrowseTracker/BrowseSelector.h (revision 5170)
+++ BrowseTracker/BrowseSelector.h (working copy)
@@ -26,7 +26,7 @@
#include <wx/bitmap.h>
class wxListBox;
-class wxFlatNotebook;
+class wxAuiNotebook;
class wxPanel;
// ----------------------------------------------------------------------------
Index: BrowseTracker/BrowseTracker.h
===================================================================
--- BrowseTracker/BrowseTracker.h (revision 5170)
+++ BrowseTracker/BrowseTracker.h (working copy)
@@ -33,7 +33,7 @@
class ProjectData;
class BrowseMarks;
class cbStyledTextCtrl;
-class wxFlatNotebookEvent;
+class wxAuiNotebookEvent;
// ----------------------------------------------------------------------------
// The following have been moved to BrowseTrackerDefs.h
@@ -215,7 +215,7 @@
void OnProjectLoadingHook(cbProject* project, TiXmlElement* elem, bool loading);
void OnStartShutdown(CodeBlocksEvent& event);
- void OnPageChanged(wxFlatNotebookEvent& event);
+ void OnPageChanged(wxAuiNotebookEvent& event);
void OnMenuBrowseMarkPrevious(wxCommandEvent& event);
void OnMenuBrowseMarkNext(wxCommandEvent& event);
Index: headerfixup/defaults.cpp
===================================================================
--- headerfixup/defaults.cpp (revision 5170)
+++ headerfixup/defaults.cpp (working copy)
@@ -153,7 +153,7 @@
AddBinding(_T("CodeBlocks"),_T("GetLogManager"), _T("logmanager.h"));
AddBinding(_T("CodeBlocks"),_T("GetMacrosManager"), _T("macrosmanager.h"));
AddBinding(_T("CodeBlocks"),_T("GetMessageManager"), _T("messagemanager.h"));
- AddBinding(_T("CodeBlocks"),_T("GetNotebook"), _T("wx/wxFlatNotebook/wxFlatNotebook.h"));
+ AddBinding(_T("CodeBlocks"),_T("GetNotebook"), _T("wx/aui/auibook.h"));
AddBinding(_T("CodeBlocks"),_T("GetParentProject"), _T("cbproject.h"));
AddBinding(_T("CodeBlocks"),_T("GetPersonalityManager"), _T("personalitymanager.h"));
AddBinding(_T("CodeBlocks"),_T("GetPlatformsFromString"), _T("globals.h"));
Index: ThreadSearch/ThreadSearchThread.cpp
===================================================================
--- ThreadSearch/ThreadSearchThread.cpp (revision 5170)
+++ ThreadSearch/ThreadSearchThread.cpp (working copy)
@@ -21,7 +21,7 @@
#include "projectbuildtarget.h"
#endif
-#include <wx/wxFlatNotebook/wxFlatNotebook.h>
+#include <wx/aui/auibook.h>
#include "ThreadSearchThread.h"
#include "ThreadSearchEvent.h"
02:11:32: BrowseTracker Plugin Logging Started[1.2.74 2008/03/15]Please note: I've replaced real system messages descriptions with dots since it was in Russian at my system...
02:11:32: Argv[0][C:\proj\CB\work\src\output\codeblocks.exe] Cwd[C:\proj\CB\work\src\output]
02:11:32: FindAppPath: AbsolutePath[C:\proj\CB\work\src\output]
02:11:32: CfgFolder[C:\Documents and Settings\lexis\Application Data\codeblocks]
02:11:32: ExecFolder[C:\proj\CB\work\src\output]
02:11:32: TrackerCfgFullPath[C:\Documents and Settings\lexis\Application Data\codeblocks\BrowseTracker.ini]
02:11:32: Menubar[0153F008]idMenuViewTracker[953]
02:11:35: Error: Execution of command 'pkg-config --version' failed (error 2: .... .)
02:11:35: Error: Can not enumerate files in directory 'C:\proj\CB\work\src\output/share/codeblocks\lib_finder/predefined' (error 3: .... .)
02:11:35: Error: Can not enumerate files in directory 'C:\Documents and Settings\lexis\Application Data\codeblocks/share/codeblocks\lib_finder/predefined' (error 3: .... .)
-------------- Build: wxFlatNotebook in Code::Blocks ---------------
WARNING: Can't read file's timestamp: C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_resources.cpp
WARNING: Can't read file's timestamp: C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\popup_dlg.cpp
WARNING: Can't read file's timestamp: C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\renderer.cpp
WARNING: Can't read file's timestamp: C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\wxFlatNotebook.cpp
WARNING: Can't read file's timestamp: C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\xh_fnb.cpp
mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -IC:\Usr\Proj\wxWidgets287\include -IC:\Usr\Proj\wxWidgets287\lib\gcc_dll\mswu -Iinclude\wxscintilla\include -Iinclude\tinyxml -Iinclude\wxFlatNotebook\include -IC:\MinGW345\include -c C:\Usr\Proj\cbAlpha\trunk\src\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_customize_dlg.cpp -o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_customize_dlg.o
ar.exe -r -s sdk\wxFlatNotebook\libwxflatnotebook.a .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_resources.o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\popup_dlg.o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\renderer.o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\wxFlatNotebook.o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\xh_fnb.o .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_customize_dlg.o
ar.exe: creating sdk\wxFlatNotebook\libwxflatnotebook.a
ar.exe: .objs\sdk\wxFlatNotebook\src\wxFlatNotebook\fnb_resources.o: No such file or directory
Process terminated with status 1 (0 minutes, 41 seconds)
0 errors, 11 warnings
I copied .../cbbeta/trunk to .../cbalpha/trunk (svn 5170) and applied the patch via TortoiseSvn (got lots of compaints about mismatched lines).
I then tried to compile it with .../cbalpha/trunk/src/codeblocks.cbp.
I got the following compile error ...
(got lots of compaints about mismatched lines).
TortoiseSVN is refusing to apply the patch to "mismatched lines".
So, I think I'll just wait until there's a repository with the patch in it.
However, I now see that there is no patch to codeblocks.cbp.I've never built Code::Blocks using the project file, therefore I didn't patch it. However, I think the only changes should be:
What is necessary to make that work?
I just compared Code::Blocks with wxAuiNotebook on Linux with Code::Blocks with wxFlatNotebook on Windows. I didn't see much difference and unfortunately I don't have the possibility to build Code::Blocks on Windows at the moment. However, I'll try some different window style flags and see what changes.
- wxAuiNotebook (on windows at least) has this "sunken" (as opposed to "flat") border which is ugly - can we do anything about it?
That seems to be a missing feature in wxAui/wxAuiNotebook. However, I found a forum post which looks quite promising:
- (Shift-)Ctrl-Tab is no longer working - can only switch between tabs by using the mouse: not good
//#include <wx/wxFlatNotebook/wxFlatNotebook.h>
#include <wx/aui/auibook.h>
CodeSnippets did not build, however it never has been buildable, as it uses nonstandard C++.
What part of CodeSnippets is nonstandard C++ ?
Maybe we can fix that if we knew what you mean.
Let me get something easy out of the way first. src/sdk/scripting/sqplus/SquirrelVM.cpp needs to include <string.h>. Just throw it at the top and all is fine.I don't see any functions in this file which require this header file. Could you please specify the line you are talking about?
What part of CodeSnippets is nonstandard C++ ?
Maybe we can fix that if we knew what you mean.
#ifdef __WXMSW__
// (Code intended to build in Windows)
#else
// (Code intended to build in Linux)
#endif
../memorymappedfile.cpp: In member function 'long int wxMemoryMappedFile::MapFile(const wxString&, bool)':
../memorymappedfile.cpp:107: error: 'open' was not declared in this scope
../memorymappedfile.cpp:124: error: 'MAP_FILE' was not declared in this scope
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef MAP_FILE
#define MAP_FILE 0
#endif
I don't see any functions in this file which require this header file. Could you please specify the line you are talking about?
SquirrelVM.cpp: In static member function 'static SquirrelObject SquirrelVM::CompileBuffer(const SQChar*, const SQChar*)':
SquirrelVM.cpp:109: error: 'strlen' was not declared in this scope
Actually it uses STRLEN which seems to be a preprocessor macro defined by squirrel which evaluates to strlen on your system.
However, on wxGTK and wxMAC other key combinations need to be used as Ctrl+Tab does not work on these systems. I guess it get's eaten by GTK (although it actuall allows navigation throw the tabs, at least on wxGTK).
I updated the patch (https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=2495&group_id=5358) again.Confirmed, applied and testing... Looks good so far. The only thing missing is an update of the project file(s) as the files switcherdlg.{cpp/h} have been added.
The only thing missing is an update of the project file(s) as the files switcherdlg.{cpp/h} have been added.Besides this: The switch algorithm is not very intuitive. If I initiate "CTRL+TAB" the tab that is currently active is selected. Usually the next tab or (even better) the previous active one would be selected. Other wise the first "CTRL+TAB" has no function.
Ok, I 'm confused now because wxFNB works with (shift-)ctrl-tab just fine?!?Pressing Ctrl+Tab indeed switches the tabs - but it does not work as accelerator to open the dialog. It just switches to the next tab.
And every other app on linux uses ctrl-tab for tabs navigation so I don't really get what you mean by "get's eaten by GTK"...
Besides this: The switch algorithm is not very intuitive. If I initiate "CTRL+TAB" the tab that is currently active is selected. Usually the next tab or (even better) the previous active one would be selected. Other wise the first "CTRL+TAB" has no function.I didn't notice that, but I guess you're right. I think fixing this shouldn't be too difficult, at least selecting the next tab. Selecting the last active one could be more difficult and is actually already handled by the BrowseTracker-plugin. I don't think this needs to be duplicated.
The only thing missing is an update of the project file(s) as the files switcherdlg.{cpp/h} have been added.Yes, I know. But I still don't use the project-file to build Code::Blocks therefore I didn't update it. But I updated the autotools-files ;)
Ctrl+ is normally used to increase the fontThe key combination is Ctrl+, and not Ctrl++ ;)
Hi plee3,
you have to click with the left mouse button on a editor tab, then hold the mouse and move the editor window to a place. When the docking gets active you will see some kind of "preview". If you want to undock the windows you can drag the tab of one view to the tab list of a different view.
Bye,
Mario
Any idea of when this patch may get folded into the main development trunk so everyone can get this feature?We currently work on another branch which will be submitted before. But straight after that this patch most likely will be the next major change. A branch does already exist on SVN... I just need to fill it... this will take some more time as I am very busy atm.
Bump...
I *love* this IDE (it almost works flawlessly as a portable app, letting me fiddle around with my code in multiple places), but one pane of text is KILLING me.
Does the November 26th build have this feature yet? I'm not quite brave enough to try rebuilding the IDE.
Sorry to be a nag. Just wondering if this is something we'll ever see, ...
Sorry to be a nag. Just wondering if this is something we'll ever see, or should I stop holding my breath?
Sorry to be a nag. Just wondering if this is something we'll ever see, or should I stop holding my breath?
just suck it up, get the source, apply the patch and run the gcc screen saver.
you can then help out by reporting issues.
svn co svn://svn.berlios.de/codeblocks/branches/wxfnb_to_wxaui .
I'm not quite brave enough to try rebuilding the IDE.
But he most likely does not want to do that:I'm not quite brave enough to try rebuilding the IDE.
And i get 0xC0000005 (Access violation) error when attempting to start CB :-(Do not install the wxaui branch above an (old) version of C::B (i.e. really remove the old C::B binaries completely).
p.s. sorry if this is a know issue, I've not read the whole threadIt is a known issue but not reported in this thread. ;-)
p.s. sorry if this is a know issue, I've not read the whole threadIt is a known issue but not reported in this thread. ;-)