News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

infopane.cpp doesn't build with wx26

Started by SharkCZ, August 17, 2007, 12:32:12 PM

Previous topic - Next topic

SharkCZ

Hello,

infopane.cpp doesn't build with wx26 due the non-existency of wxAui there. Fix is included ;-)


Index: src/src/infopane.h
===================================================================
--- src/src/infopane.h  (revision 4400)
+++ src/src/infopane.h  (working copy)
@@ -4,12 +4,14 @@

#include <logmanager.h>

+#if wxCHECK_VERSION(2, 8, 0)
#include <wx/aui/auibook.h>
typedef wxAuiNotebook InfoPaneNotebook;   // or wxFlatNotebook, or whatever...
+#else
+#include <wx/wxFlatNotebook/wxFlatNotebook.h>
+typedef wxFlatNotebook InfoPaneNotebook;
+#endif

-//#include <wx/wxFlatNotebook/wxFlatNotebook.h>
-//typedef wxFlatNotebook InfoPaneNotebook;
-
class wxWindow;
class wxCommandEvent;
class wxMouseEvent;
Code::Blocks package maintainer for Fedora and EPEL

killerbot

maybe we should use in all cases wxFlatNotebook ??

What do you think Thomas ??

thomas

You should only need to change one typedef and one #include to use wxFlatNotebook, Lieven. Actually, just uncomment two lines, and comment the other two... I've never tried it, but it should work. Why not, actually :)

In my understanding (from reading the docs), both notebooks should work just the same, and the API exposed should be 100% identical apart from icon handling (wxFlatNotebook uses a bitmap list and wxAuiNotebook uses individual bitmaps). I just picked wxAuiNotebook out of curiosity, because I had never used it before.
So... feel free to change the typedef and try it out :)

As for the patch, thank you for your work, SharkCZ, but I am not willing to add workarounds for some old versions of wxWidgets on a piece of code that is work in progress and not not even used by the application. That doesn't make sense to me.
If it causes a compilation problem, one should just remove the file from the project until it's at least finished. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

killerbot

wxFlatNotebook works still for wx26. Although people should start forgetting about wx26 [I also still have 1 system on wx26 ;-)], will change it to wxFlatNotebook this weekend then. WE can always change it back if needed and then we all wave bye bye to wx26 ;-)

MortenMacFly

Quote from: thomas on August 17, 2007, 02:16:06 PM
So... feel free to change the typedef and try it out :)
Tried that with a project of mine -> doesn't work. With wxNotebook all is fine, with wxFlatNotebook it crashes and (in addition) removes parts not being removed by wxNotebook (which is also the reason for the crash btw).
This doesn't mean wxFlatNotebook isn't great... it is! ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

SharkCZ

Fedora Core 6 is supported until the end of 2007 and there will be no update to wx28. So I need wx26 support for this time to be able to build new nighties for FC6. In this case I would prefer to use only wxFlatNotebook in infopane.cpp as they are functionally identical (or not?). When you decide that it is not possible or meaningful for official C::B, I can always patch the Fedora version as this is really trivial change.
Code::Blocks package maintainer for Fedora and EPEL

SharkCZ

Is the code really used? I see that it is enclosed with #if 0/#endif in SetupGUILogging() in main.cpp
Code::Blocks package maintainer for Fedora and EPEL

thomas

Quote from: MortenMacFly on August 17, 2007, 03:12:02 PMTried that with a project of mine -> doesn't work. With wxNotebook all is fine, with wxFlatNotebook it crashes and (in addition) removes parts not being removed by wxNotebook (which is also the reason for the crash btw).
Huh, funny...? Does wxFlatNotebook require you to call an intialisation function before you can use it, or something?

Quote from: SharkCZ on August 17, 2007, 03:24:13 PMFedora Core 6 is supported until the end of 2007 and there will be no update to wx28. So I need wx26 support for this time to be able to build new nighties for FC6.
No worries, just do as you like, or like I said... simply remove the file from the build. The application does not use it, it's still work in progress.
When the application will use it, we'll certainly make sure it works with wx26, just now seems like the wrong time to think about a fix, as we haven't even decided what notebook we want to use :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

thomas

Quote from: SharkCZ on August 17, 2007, 03:51:54 PMIs the code really used? I see that it is enclosed with #if 0/#endif in SetupGUILogging() in main.cpp
No, it is not.

The logging system is used and is working, but the InfoPane is only used if you remove the #if 0.

To elaborate, the logging system works in presence and in absence of GUI. Log data can be discarded, written to a file, shown on stdout, or whatever. This is not defined by the system itself, but by the individual loggers that are plugged in.

By default, all loggers are NullLoggers. At application startup, those are replaced with more sophisticated ones (can optionally be controlled via commandline options too).
One such logger flavour is one that works as NullLogger until it is asked to provide a control, at which time it starts logging to a wxTextCtrl.

Now, the code inside the #if 0 creates a notebook control, and asks all existing loggers for their respective controls, which it then adds to the notebook. InfoPane is a plain normal notebook, with the one addition that it shows a popup menu to show/hide tabs. It can be any notebook class, and it doesn't need to be a notebook at all.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

SharkCZ

Code::Blocks package maintainer for Fedora and EPEL