Author Topic: wxFlatNotebook update + Patch  (Read 21179 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: wxFlatNotebook update + Patch
« Reply #15 on: May 05, 2006, 06:22:10 pm »
As I expected, the patch doesn't work correctly. That's why I wanted to test it myself.
Steps to reproduce the bug:

1) Right-click on "Build messages".
2) Select "Show/hide->Build log".

The build log hides.

3) Right-click on "Build messages".
4) Select "Show/hide->Build log".

The build log shows again and, seemingly, gets the focus. But still the "Build messages" is displayed.

5) Left-click on "Build messages" and enjoy.
Be patient!
This bug will be fixed soon...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: wxFlatNotebook update + Patch
« Reply #16 on: May 05, 2006, 07:26:24 pm »
Also it's totaly legal to "delete" a null pointer. All the problems arise from the fact that including myself many forget to set the pointer to null after deletion.
Right. Actually everybody should use something like this all the time:
Code
template<typename T> void Delete(T *p) {delete p; p = 0;};

Hmm... I really wonder why nobody does that. Something must be fundamentally wrong with this, that would be just too simple...  :?:

One could use reference counted smart pointers to avoid above problem, too, of course.
If fact, I believe an object having a Destroy() function should necessarily be reference counted - if it only wraps around a plain normal delete, then it is actually not of much use to have such a function.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: wxFlatNotebook update + Patch
« Reply #17 on: May 05, 2006, 08:04:52 pm »
...Something must be fundamentally wrong with this, that would be just too simple...  :?:
Well there is http://public.research.att.com/~bs/bs_faq2.html#delete-zero but still deleting and setting to 0 should cover 99.99% of the cases.
Life would be so much easier if we could just look at the source code.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxFlatNotebook update + Patch
« Reply #18 on: May 06, 2006, 05:33:53 pm »
Steps to reproduce the bug:
...confirmed. But: How strange is that? I don't even understand what's happening (to be honest) - where is this space coming from suddenly? :shock:
Anyway: I expected that testing is required - that's why I did not file a patch to BerliOS in the first place. Forgive me, but for my "daily work" it really works properly. But I have to admit that the only thing I'm closing/opening are code files - the lower layout I keep as it is normally.
With regards, Morten.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxFlatNotebook update + Patch
« Reply #19 on: May 06, 2006, 11:19:04 pm »
...alright, I've tried to track down this issue nearly the whole day without success. In my humble opinion this is a very weird bug and from the changes done from 0.90 to 1.30 I really don't understand why and where this bug was introduced. Anyway, I'm not an expert in wxWidgets which makes things for me even worse. If anybody could at least give me a hint... that would be really helpful. I'm closing for today (tonight ;-)), maybe I seee more clear tomorrow... :|
With regards, Morten.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxFlatNotebook update + Patch
« Reply #20 on: May 07, 2006, 11:18:23 am »
As I expected, the patch doesn't work correctly. That's why I wanted to test it myself.
mandrav: Correct me, if I'm wrong, but could it be that this bug also appears in the nightlys? Starting from v0.90 (C::B pathhed as from SVN) I tried to apply the changes done up to revision 1.30 to see when the issue appears. But when I compiled C::B again using the SVN version the bug did already appear. I thought it might have been a missing deletion of any file, did a re-build... again. Then I downloaded the latest nightly available and renamed "my" C::B folder. But when I run the nightly and do the steps you described the same thing happens. Are you aware of that?
If so I got you wrong because I thought this issue was introduced somewhere in between v0.90 and v1.30...?!
With regards, Morten.
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

PChris

  • Guest
Re: wxFlatNotebook update + Patch
« Reply #21 on: May 07, 2006, 11:29:11 am »
As I expected, the patch doesn't work correctly. That's why I wanted to test it myself.
mandrav: Correct me, if I'm wrong, but could it be that this bug also appears in the nightlys? Starting from v0.90 (C::B pathhed as from SVN) I tried to apply the changes done up to revision 1.30 to see when the issue appears. But when I compiled C::B again using the SVN version the bug did already appear. I thought it might have been a missing deletion of any file, did a re-build... again. Then I downloaded the latest nightly available and renamed "my" C::B folder. But when I run the nightly and do the steps you described the same thing happens. Are you aware of that?
If so I got you wrong because I thought this issue was introduced somewhere in between v0.90 and v1.30...?!
With regards, Morten.
I can confirm this too...
This bug is also present on the old version.

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: wxFlatNotebook update + Patch
« Reply #22 on: May 07, 2006, 11:31:37 am »
Confirmed even on Linux. Revision 2417, compiled with gcc 3.4.5 and wxGTK 2.6.2 (unicode).
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 TheTuxKeeper

  • Regular
  • ***
  • Posts: 293
  • daniel2000
Re: wxFlatNotebook update + Patch
« Reply #23 on: May 07, 2006, 12:12:56 pm »
Same with rev2411 on Fedora (wxGTK 2.6.2 unicode + gcc 4.02). If you repeat these steps more than once the space is getting few pixels larger with each repetition of these steps until only few pixels of the headline are visible. Even the vertical scrollbar is gone  :shock:

I forgot to save the last screenshot, but this one is only few times before the space isn't getting bigger anymore.
Nightly builds for openSUSE

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: wxFlatNotebook update + Patch
« Reply #24 on: May 07, 2006, 12:36:21 pm »
I'm not quite sure what behaviour is intended. But this problem can be fixed with this little patch:
Code
Index: src/sdk/messagemanager.cpp
===================================================================
--- src/sdk/messagemanager.cpp  (revision 2417)
+++ src/sdk/messagemanager.cpp  (working copy)
@@ -332,7 +332,7 @@
     if (show && !ls->visible)
     {
         // show
-        m_pNotebook->InsertPage(id, log, ls->title, false);
+        m_pNotebook->InsertPage(id, log, ls->title, true);
 
         SetLogImage(id, ls->bitmap);
         ls->visible = true;
This way the tab that will be shown again gets selected. I think this is not the originally intended behaviour but it at least works without the problem described here.
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 thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: wxFlatNotebook update + Patch
« Reply #25 on: May 07, 2006, 02:54:29 pm »
Is "selected" synonymous to "given focus"?

I guess if "selected" only means "becomes topmost tab" then it is quite harmless (and even intuitive).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: wxFlatNotebook update + Patch
« Reply #26 on: May 07, 2006, 04:33:07 pm »
Yes, it has the focus, it is displayed and is the topmost tab. Whether this is intuitive or not is another question. I would even prefer that the tab that was selected before stays selected and the "new one" is only placed between the other inactive tabs. I guess that was the originally intended behaviour.
But with a quick look at the roadmap I would say we should apply this little patch (even if the behaviour is not as intuitive than before - that is my opionion, maybe the others think different) as a workaround for this problem rather than spending hours or even days on searching and fixing the real problem.
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: wxFlatNotebook update + Patch
« Reply #27 on: May 08, 2006, 10:36:21 pm »
HEAD updated to wxFNB 1.30.
Be patient!
This bug will be fixed soon...

sethjackson

  • Guest
Re: wxFlatNotebook update + Patch
« Reply #28 on: May 08, 2006, 10:40:44 pm »
HEAD updated to wxFNB 1.30.

Yay!  8)

Aww bugs.... :P

Do this.

1. Right click on a messages tab.
2. Show/Hide a visible tab.
3. Show/Hide the same tab (making it visible).
4. Not good. :P

Fix.

Code: diff
Index: src/sdk/messagemanager.cpp
===================================================================
--- src/sdk/messagemanager.cpp (revision 2421)
+++ src/sdk/messagemanager.cpp (working copy)
@@ -337,8 +337,6 @@
         SetLogImage(id, ls->bitmap);
         ls->visible = true;
 
-        log->Show(false);
-
         if (id == m_DebugLog)
             cfg->Write(_T("/has_debug_log"), (bool)true);
     }
@@ -350,8 +348,6 @@
             m_pNotebook->RemovePage(id);
         ls->visible = false;
 
-        log->Show(false);
-
         if (id == m_DebugLog)
             cfg->Write(_T("/has_debug_log"), (bool)false);
     }


Posted to the tracker.

https://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=1038&group_id=5358
« Last Edit: May 08, 2006, 10:57:20 pm by sethjackson »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9702
Re: wxFlatNotebook update + Patch
« Reply #29 on: May 09, 2006, 11:20:27 am »
Well... there is something wrong with how this is applied in SVN. Currently the cb_wxfn.patch holds the patch how to update the C::B sources to wxFlatNotebook 1.30-patched. My intention was to provide the patch how to change the original wxFNB sources (v1.30) to the way they are used in SVN.
I've attached a patch to this post (to be applied to the SVN sources) that will:
1.) Update the cb_wxfn.patch file to really have the changes applied within C::B in comparision to wxFNB v1.30
2.) Update the readme file
3.) Apply one minor change to wxFlatNotebook I've missed
With regards, Morten.
Edit: Removed patch to save forum space. It has been applied already.
« Last Edit: May 10, 2006, 11:03:32 am by MortenMacFly »
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