Author Topic: Multi File editing  (Read 90230 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Multi File editing
« Reply #45 on: July 29, 2008, 05:07:02 pm »
I copied .../cbbeta/trunk to .../cbalpha/trunk (svn 5170) and applied the Der Meister 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:

Edit: adding "Der Meister" for clarity
Code
-------------- 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
 

« Last Edit: July 29, 2008, 07:06:04 pm by Pecan »

Offline lexis

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Multi File editing
« Reply #46 on: July 29, 2008, 05:16:30 pm »

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 ...

You need to apply Der Meister's patch first! It fixes CB and core CB plugins. Sorry for incomplete instructions

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Multi File editing
« Reply #47 on: July 29, 2008, 05:19:51 pm »
I have indeed appied the Der Meister patch. And verified that it took.

However, I now see that there is no patch to codeblocks.cbp.
What is necessary to make that work?


Edit: adding "Der Meister" for clarity
« Last Edit: July 29, 2008, 07:03:57 pm by Pecan »

Offline lexis

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Multi File editing
« Reply #48 on: July 29, 2008, 05:23:27 pm »
(got lots of compaints about mismatched lines).

See the last post at page 3 of this topic! If yopu see inside of patch You'll see that it is needed to apply it to different point in source tree. The patch is very small so it possible to see

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Multi File editing
« Reply #49 on: July 29, 2008, 05:37:58 pm »
TortoiseSVN is refusing to apply the Der Meister patch to "mismatched lines".

So, I think I'll just wait until there's a repository with the patch in it.

Edit: adding "Der Meister" for clarity
« Last Edit: July 29, 2008, 07:03:12 pm by Pecan »

Offline lexis

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Multi File editing
« Reply #50 on: July 29, 2008, 06:08:02 pm »
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.

Please, try to apply it to trunk/src/plugins/contrib dir.
The patch had created with TortoiseSVN at my WinXP so it should work!

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #51 on: July 29, 2008, 06:22:31 pm »
However, I now see that there is no patch to codeblocks.cbp.
What is necessary to make that work?
I've never built Code::Blocks using the project file, therefore I didn't patch it. However, I think the only changes should be:
  • Remove all files and compiler/linker options related to wxFlatNotebook
  • Add the two new files (notebookstyles.cpp and notebookstyles.h) to the project
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Multi File editing
« Reply #52 on: August 17, 2008, 12:14:04 pm »
I 've finally found the time to try this patch on Windows. Mostly a nice job Der Meister :).
I only have two little gripes:

  • wxAuiNotebook (on windows at least) has this "sunken" (as opposed to "flat") border which is ugly - can we do anything about it?
  • (Shift-)Ctrl-Tab is no longer working - can only switch between tabs by using the mouse: not good

Be patient!
This bug will be fixed soon...

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #53 on: August 18, 2008, 10:50:47 am »
  • wxAuiNotebook (on windows at least) has this "sunken" (as opposed to "flat") border which is ugly - can we do anything about it?
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.

  • (Shift-)Ctrl-Tab is no longer working - can only switch between tabs by using the mouse: not good
That seems to be a missing feature in wxAui/wxAuiNotebook. However, I found a forum post which looks quite promising:
http://www.kirix.com/forums/viewtopic.php?f=16&t=528
I'll try to add this and I hope I find enough time to update the patch before the end of this week.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Multi File editing
« Reply #54 on: August 18, 2008, 11:48:02 pm »
FWIW, I tried the patch on my work Solaris machine.

  • wxSmith did not build, as it was expecting wxFlatnotebook.
  • lib_finder did not build, as it was expecting wxFlatnotebook.
  • ThreadSearch did build after fixing one include in ThreadSearchThread.cpp
    //#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++.
  • All other code, plugins, and contrib plugins built without complaint.


Code::Blocks-wxAUI seems to run fine on Solaris, and I really like that tabs can be drag-sorted, even in the "Logs & Others" pane.

I am excited by this development that Der Meister has kicked off!

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: Multi File editing
« Reply #55 on: August 19, 2008, 02:00:29 am »
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.
« Last Edit: August 19, 2008, 02:23:27 am by Pecan »

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Multi File editing
« Reply #56 on: August 19, 2008, 06:06:24 pm »
What part of CodeSnippets is nonstandard C++ ?

Maybe we can fix that if we knew what you mean.

 :lol:  I guess i was being a bit coy with that.  I just didn't want to threadjack this already-awesome thread.

The forum gods can bump this to its own topic if they so decide.

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.

You can see string functions being used early in that file.  It's probably a safe guess that Windows and popular Linux build environments are including that indirectly, so that omission hasn't been noticed.

I'll be back here in a bit after I have time to reproduce the CodeSnippits issues.





Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Multi File editing
« Reply #57 on: August 19, 2008, 06:32:56 pm »
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?
Anyway, including <string.h> in a C++ source file is always an error. Either include <string> which is the header file containing std::string or include <cstring> which is the correct file if the C-header file <string.h> is needed.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Multi File editing
« Reply #58 on: August 19, 2008, 07:01:30 pm »
What part of CodeSnippets is nonstandard C++ ?

Maybe we can fix that if we knew what you mean.

In memorymappedfile.cpp, you'll see that every function has separate Windows code and Linux code.  It follows this pattern:

Code
#ifdef __WXMSW__
  // (Code intended to build in Windows)
#else
  // (Code intended to build in Linux)
#endif


Since __WXMSW__ is not defined, my build blows up trying to build Linux-specific code.

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

Thought #1:  Does wxWindows include a file operation API so we can outright eliminate this fragile code?

Thought #2:  I've read that MAP_FILE is legacy and is #defined as 0.  Can someone verify this? 

I don't know what this would break on other platforms, but I'm adding this code to the file and am trying a build now....

Code
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef MAP_FILE
     #define MAP_FILE 0
#endif

Offline DrewBoo

  • Multiple posting newcomer
  • *
  • Posts: 110
Re: Multi File editing
« Reply #59 on: August 19, 2008, 07:05:10 pm »
I don't see any functions in this file which require this header file. Could you please specify the line you are talking about?

Can do.  Here's the build output from what's in the svn trunk.

Code
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