Author Topic: infopane.cpp doesn't build with wx26  (Read 7404 times)

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 134
infopane.cpp doesn't build with wx26
« on: August 17, 2007, 12:32:12 pm »
Hello,

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

Code
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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: infopane.cpp doesn't build with wx26
« Reply #1 on: August 17, 2007, 01:39:51 pm »
maybe we should use in all cases wxFlatNotebook ??

What do you think Thomas ??

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: infopane.cpp doesn't build with wx26
« Reply #2 on: August 17, 2007, 02:16:06 pm »
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."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5529
Re: infopane.cpp doesn't build with wx26
« Reply #3 on: August 17, 2007, 02:30:03 pm »
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 ;-)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: infopane.cpp doesn't build with wx26
« Reply #4 on: August 17, 2007, 03:12:02 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 134
Re: infopane.cpp doesn't build with wx26
« Reply #5 on: August 17, 2007, 03:24:13 pm »
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

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 134
Re: infopane.cpp doesn't build with wx26
« Reply #6 on: August 17, 2007, 03:51:54 pm »
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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: infopane.cpp doesn't build with wx26
« Reply #7 on: August 17, 2007, 03:56:57 pm »
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).
Huh, funny...? Does wxFlatNotebook require you to call an intialisation function before you can use it, or something?

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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: infopane.cpp doesn't build with wx26
« Reply #8 on: August 17, 2007, 04:04:10 pm »
Is 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."

Offline SharkCZ

  • Almost regular
  • **
  • Posts: 134
Re: infopane.cpp doesn't build with wx26
« Reply #9 on: August 17, 2007, 04:56:46 pm »
Thank for your explanation, Thomas.
Code::Blocks package maintainer for Fedora and EPEL