Author Topic: BOUNTY: Notebook class with "close" button at the right  (Read 137073 times)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #90 on: January 04, 2006, 07:43:35 pm »
Well, I believe we can fix those small bugs. Nothing serious. These two days I worked with it, I 've learnt its code and can quickly find bugs in there (already found and fixed some).
Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #91 on: January 04, 2006, 07:48:29 pm »
Just remember to report all those bug fixes to eranif :)

I'll be waiting a while for you to commit it, really, I'll be patient :)

Oh, forgot to ask in the last post: will you change the Management and Messages tabs too? If the answer is NO, why not?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #92 on: January 04, 2006, 07:51:06 pm »
Just remember to report all those bug fixes to eranif :)

I'll be waiting a while for you to commit it, really, I'll be patient :)

Oh, forgot to ask in the last post: will you change the Management and Messages tabs too? If the answer is NO, why not?

And so : will be able to right click on it and say "clear" (leading to a clearing result)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #93 on: January 04, 2006, 07:58:20 pm »
Just remember to report all those bug fixes to eranif :)

I have given him a patch but he didn't apply it and now that I checked for a recent version I had to re-do all my updates and bug-fixes by hand...

Oh, forgot to ask in the last post: will you change the Management and Messages tabs too? If the answer is NO, why not?

I will do it afterwards. For now, only Editors use it.
Be patient!
This bug will be fixed soon...

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #94 on: January 04, 2006, 08:08:10 pm »
I will apply the patch you sent me ASAP...

I needed to merge the drag 'n' drop feature first + there is a bug that prevents the code from compiling under g++ 3.4.1 - didnt test newer versions - it is already fixed, once I will finish the merging of your changes I will upload the updated sources.

There are two know issues right now:
1. If there is only one tab visible scrolling does not work
2. There can be a case where no tab appears at all - this is a low importance bug, so I will probably will work on the first one first

Ceniza: Yes this is my IDE, I have some features that you might want to consider adding as well such as:

- Class wizards (dont know if you have one already or not)
- Find Symbol - locate a class / function / member in the entire workspace by right clicking on it and displying the result on the message tab as sheet - very usefull feature
- if caret line is at a #include line, pressing a short-key will jump to that header file

But i guess that there is another forums for this - So I will post it there

Eran

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #95 on: January 04, 2006, 08:22:01 pm »
Good news: the current version compiles under Linux (after the few minor fixes, namely an address operator missing and a case mismatch in a #include).

Bad news: adding a new page makes it crash (the crash point is a bit unclear, maybe a wxGTK problem).

The last point still in this library is wxFlatNotebook.cpp line 364:

Code
return m_pages->GetClientSize();

eranif: about the second issue: the main problem is not that it isn't drawing at least a truncated tab, the problem is it's crashing if you try to scroll :)

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #96 on: January 04, 2006, 08:34:06 pm »
I will apply the patch you sent me ASAP...

No need anymore. It's old (from last night :)).
Be patient!
This bug will be fixed soon...

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #97 on: January 04, 2006, 08:35:17 pm »
Quote
Good news: the current version compiles under Linux (after the few minor fixes, namely an address operator missing
Already fixed: an '&' was missing before the address of the callback function in the drag'n'drop constructor and will be published on the next  release

mandrav:

From the diff i mainly see that you added an overloading function with notify flag set to true  for DeletePage(page, notify), and RemovePage(), however, this is not needed anymore since I already fixed the code couple a days ago that when closing a page, and event will be sent AND will be handled properly (including veto by the event handler).

You also added an event firing when pressing on mouse middle click - also not needed, since the DeletePage() function is always sending an event

Correct me if I am wrong here.

Eran

Offline eranif

  • Regular
  • ***
  • Posts: 256
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #98 on: January 04, 2006, 08:45:35 pm »
Sorry for posting again - but I am on the roll here!

Ceniza:
Quote
Bad news: adding a new page makes it crash (the crash point is a bit unclear, maybe a wxGTK problem).

Try in Frame.cpp, in OnAddPage() to change this line:
Code
wxTextCtrl *text = new wxTextCtrl(book, wxID_ANY, caption, wxDefaultPosition, book->GetPageBestSize(), 
wxTE_MULTILINE);

to
Code
wxTextCtrl *text = new wxTextCtrl(book, wxID_ANY, caption, wxDefaultPosition, wxDefaultSize, 
wxTE_MULTILINE);

I dont have Linux box yet ( will have one tomorrow though :) )

Let me know if it helped,
Eran

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #99 on: January 04, 2006, 08:49:31 pm »
From the diff i mainly see that you added an overloading function with notify flag set to true  for DeletePage(page, notify), and RemovePage(), however, this is not needed anymore since I already fixed the code couple a days ago that when closing a page, and event will be sent AND will be handled properly (including veto by the event handler).

You also added an event firing when pressing on mouse middle click - also not needed, since the DeletePage() function is always sending an event

Correct me if I am wrong here.

Sure :)

You 're testing the notebook with your sample app and that's fine. I 'm testing it in a real-world app, C::B itself which is quite a beast.
So you 're wondering why I need these bool notify=true arguments in DeletePage() and RemovePage(), as well as a couple of extra notifications?

  • C::B handles itself the lifetime of its editors. We don't want the notebook destroying the object without C::B knowing. That's why I added the notification in OnMiddleClick().
  • If I don't add the bool notify=true arguments in DeletePage() and RemovePage(), C::B either crashes with a stack overflow or deletes two pages instead of one (depending where the CLOSING notification came from). C::B communicates with wxFlatNotebook using its messages and so the messaging system needs to be well-defined.
  • Finally, I 've added a new message wxEVT_COMMAND_FLATNOTEBOOK_CONTEXT_MENU, instead of using SetRightClickMenu(). The popup menu C::B displays when right-clicking on a tab is dynamic, i.e. it changes based on the current file's state. So we need the notebook to notify C::B when a context menu needs to be displayed and then we let C::B do its magic.

I 'm not criticizing you, I just patched the source as needed to make it co-operate nicely with C::B :)
Ultimately, it's up to you to decide what goes in your main distribution package and what stays out ;)
Be patient!
This bug will be fixed soon...

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #100 on: January 04, 2006, 09:01:17 pm »
I have two words for you: revision 1654 ;)
I 'm now rebooting to linux to add this in the build system :)
Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #101 on: January 04, 2006, 09:13:28 pm »
Just the two words I wanted to read :)

eranif: I just tried that (before reading the post :P) and guess what?! It isn't crashing! But guess what too?! It isn't showing anything!

Now I wonder what's worse: crashing or apparently not working?

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #102 on: January 04, 2006, 09:22:57 pm »
revision 1654 : does not build :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #103 on: January 04, 2006, 09:25:57 pm »
Add to the Resource compiler includes the path to your MinGW's include (this one can go in the global compiler settings).

For me it's: C:\MinGW\include

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: BOUNTY: Notebook class with "close" button at the right
« Reply #104 on: January 04, 2006, 09:28:55 pm »
I have that : C\program files\codeblocks\include

but is not finding one of wx, and the files does exist !!
Seems like the resource compiler does not follow the include from the global vars (global var wx)