Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: rickg22 on August 02, 2005, 04:09:03 am

Title: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 02, 2005, 04:09:03 am
OK Guys. I think the solution's much easier than I thought. Still, it's going to be a hard work implementing it, and I need your help.


There *IS* a wxTabCtrl. What we need to do is replicate (and possibly EXTEND like with tab context menus) the exact functionality of a wxNotebook by having the following structure:

<wxPanel>
  <wxBoxSizer with vertical orientation>
    <sizeritem: wxPanel>
    <wxBoxSizer with horizontal orientation>
      <sizeritem: wxTabCtrl />
      <sizeritem: wxBitmapButton />
    </wxBoxSizer>
    </sizeritem: wxPanel>
    <sizeritem: wxPanel>   
     <wxBoxSizer>
     <content goes here>
     </wxBoxSizer>
    </sizeritem:wxPanel>
  </wxBoxSizer>
</wxPanel>

If ANYONE can provide us with such a class, we'd be REALLY grateful.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on August 02, 2005, 08:29:49 am
Quote from: wxWidgets' wiki
wxTabCtrl is only supported under Win32, MacOS and OS/2.

And in fact, tabctrl.h hasn't include when using __WXGTK__:

Code
#if defined(__WXMSW__)
#include "wx/msw/tabctrl.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/tabctrl.h"
#elif defined(__WXGTK__)
#elif defined(__WXMAC__)
#include "wx/mac/tabctrl.h"
#elif defined(__WXPM__)
#include "wx/os2/tabctrl.h"
#endif

It seems like it won't help either.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 02, 2005, 09:45:39 am
Bummer. :( It was doing so well...

HMMMMMMMMMM wait a minute....

:D I know! We'll implement the modified notebook if we're on windows, and the standard notebook if we're on Linux! Well, that solves half of the problem at least... :roll:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on August 08, 2005, 01:29:46 am
Damn GTK and her native tab widgets :P
Well, from now C::B will use motif in linux :D (joke)

But seriously talking, I think that I saw some discussion about this in the wx mailing list, or it was a wx bounty (don't remember well)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: AkiraDev on August 08, 2005, 02:17:55 am
How about having the main frame count the amount of open files, and if there is at least one, a small close button is drawn on top of the menu bar, to the right (emulating "classic" MDI) ?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 08, 2005, 06:55:26 am
On top of the menubar... hmmmm not bad.
Unfortunately my wxWidgets expertise isn't as broad as to try to implement that. Implementations welcome.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on August 10, 2005, 05:23:14 am
On Wed, 3 Oct 2001 18:13:13 -0700 David Cuny <dcuny@xxxxxxxxxx> wrote:

DC> Has the wxTabCtrl deprecated for wxNotebook?

Yes, it is/was - and since a long time as well. Please don't use it in the
new code, it's old and unmaintained and has no advantages (but plenty of
problems) compared to wxNotebook.

It should still be in the source tree but it's not built into the library
by default.

Regards,
VZ
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: DreadNot on August 10, 2005, 06:50:04 pm
Copy of post from http://forums.codeblocks.org/index.php/topic,633.msg4646.html#msg4646:

As far as the toolbar is concerned, add the following buttons after Save:
1] Save All
2] Close (current tab/file)
3] Close All

Did anyone notice that Mozilla also has a "New Tab" button on the left side as well as a "Close Tab" on the right.

The notebook code calls "wx/generic/tabg.h", so what I believe needs to be changed is "tabg.h" and "tabg.cpp" in wx to have a controlled left and right margin something like it has for the top margin.  I think these files are generic to all wx versions.  The left/right margin should act something like (and in addition to) the m_tabHorizontalOffset value.  These margins would allow the addition of the button(s) to the left and right sides of the notebook in the tabs area.

In addition, the left/right margin values should default to the current values (which I beleive are hardcoded to 4 in /msw/).  The values should be setable in wxNotebook [void SetMargins(const int &left, const int &right)], passed to the wxTabView via wxNotebookTabView in src/(whatever)/notebook.cpp, and used in wxTabView::LayoutTabs().
Adding the buttons in the margin could be done separately (via Yannis solution) or in a derived wxNotebook class as suggested.

Also, should we consider moving tabs (drag-n-drop) in the wxNotebook class?  Maybe add a bool m_bMovablePages.  If true, tabs in the tablist can be rearranged via mouse using RemovePage()/InsertPage().

UPDATE: Sorry, most of this is only good for MOTIF.  Windows would have to somehow resize the tab area width to be less than the page width.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 11, 2005, 12:09:37 am
I have an idea that might work:

Make a subclass of wxControl that has some sort of wxSizer or something just to keep the different widgets on top of each other. Then put a wxNotebook with all the wxPanels blank/empty inside the control (this way, we avoid using wxTabCtrl and its bugs/non-portability). Make sure all the wxPanels have a height of 0. Somehow, you'd have to make wxNotebook only as high as the tabs. Then, below, you'd put whatever wxPanel you want shown. You could add whatever buttons you want on the left and right of the wxNotebook (with a sizer). Then, to switch pages, you just use wxNotebook's EVT_NOTEBOOK_PAGE_CHANGED/EVT_NOTEBOOK_PAGE_CHANGING to detect when to change the panel that is shown (and then create new events for your new control which mirror those events). You could also combine this with the middle-click-close etc. ideas.

aMule (http://www.amule.org/) also has a different way to make closable notebook pages, although you can't have any images in the tabs if you use their way. Their method is having a close button as the image for each tab, and when the image is clicked, that tab is closed. It also has a right-click menu on the tabs that allow you to close that tab, close all tabs, or close all except that tab.

BTW, I'm not a developer for Code::Blocks, and I probably will never touch the code, it's just I want this control just as much as you do. I'll give you the code I come up with, if I come up with a result first.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 11, 2005, 02:31:43 am
I have an idea that might work:

...Somehow, you'd have to make wxNotebook only as high as the tabs.

Brilliant! That would be the perfect replacement! Will you do it please? :D (we're too busy fixing bugs, youknow)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 11, 2005, 04:12:40 am
Yeah, I've already started. My goal is to make it look almost exactly like Firefox's tabs (although that might be impossible) and behave just like a wxNotebook.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on August 11, 2005, 06:08:38 am
Yeah! I vote for exactly Firefox tabs!  :D
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 12, 2005, 02:07:20 am
So...

I've got one. It doesn't have middle-click-close or right-click menus yet, but it does switch pages and close them with the button. The code might not be totally readable... but it should work.

The code is attached.

If anybody knows how to make it behave more like a real wxControl (currently it's just a wxPanel), I'd appreciate it if they'd tell me... or do it for me (for example, styles?).

Also, it looks a bit.... not right. I tried overloading wxWindow's Layout() to move the sizer which contains the displayed panel up 2 pixels, to remove that little bit of space between the wxNotebook and the panels, but that just ends up with the screen flashing a bunch, even if I do use Freeze/Thaw.

The syntax is pretty obvious; just like any other wxWindow, except, after the id, there's an argument of the bitmap for the close button. Currently, the close button doesn't have any borders, so it really doesn't look like a button at all (you can add in some code to change the image when it's clicked, if you want). You could add borders, too, by removing the wxNO_BORDERS for the wxBitmapButton.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 12, 2005, 09:04:37 am
Mind attaching some screenshots, so we can see how it looks?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 12, 2005, 09:47:31 pm
Yeah... I developed it on Windows, and I found a big, huge bug on wxGTK (which might occur on other systems, too).

It is a wxGTK bug, actually: when the wxNotebook isn't shown yet, and you change tabs (through SetSelection) it doesn't call the event handler, so I changed the SetSelection function. I've attached the new version.

A screenshot on wxGTK is attached. I'll add a Windows screenshot later.

The little black dot in the upper-left corner is the close button. I just used a random bitmap I had on my machine for it. On wxGTK, though, the button, even without borders, pops up when you select it, so it ends up only showing a little bit of the picture.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 12, 2005, 10:12:51 pm
wow, looks really neat! :D

Anyway, something in mind: the close button should trigger an event, but it should _NOT_ automatically close the tab, because, we want to handle that event.

Regarding the border: Are you sure it can't be changed with the style flags when creating the notebook object? Anyway, I can't wait to see the windows screenshot! You rock!  8)


Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 17, 2005, 06:41:24 am
Okay, I've got a mostly final version.

wxWidgets doesn't seem to want to let me connect a wxEVT_RIGHT_DOWN event to the notebook. Take a look at my code, line 92, in closenb.cpp.

Also, I haven't tested the events generated by my class. You will have to test and modify as needed yourselves.

The code isn't very well commented... but it's generally the same as wxNotebook.

If you want to add a button to the right of the tabs, or anywhere else, just add it before or after the wxNotebook in the sizer containing the wxNotebook and the wxButton.

I have Windows screenshots, too.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on August 17, 2005, 07:03:26 am
So far so good. It's a really evil hack, but looks nice :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 17, 2005, 08:39:46 pm
Could somebody try incorperating it into Code::Blocks and telling me what it's like, what problems you have, etc.?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 17, 2005, 09:06:42 pm
kimastergeorge: I haven't tried it yet, however i see some things:

1) There's a hittest function, i don't know if wx242 supports it.
2) There are lot of wxMessageBoxes in there!

Otherwise, it *seems* it's pretty usable, it replicates most if not all the functionality of notebooks (We use RemovePage() in codeblocks, and it's in your class! :)

I have some obvservations, tho.

Quote
* Much thanks to the aMule project for the GPL code
 * for their CLOSABLENB, which is used here for
 * the code for the popups, and the events are based on
 * them.

Could it be possible for you to define what part exactly of the aMule project's code you're using? Is it nothing but the popups? I'd rather like to see a closablenb not GPL licensed (but wxWidgets licensed) so more people could use it without having to fear legal implications yadda yadda.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 17, 2005, 10:42:06 pm
The wxMessageBoxes were for debugging, and I forgot to take them out.

Yes, HitTest() is available. I didn't know it was available for platforms besides Windows, but apparently it is, so I'll rewrite the code to use that.

I've marked the originally GPL code (roughly) in the code, and removed the wxMessageBoxes.

I'll contact the aMule people and ask them if I could use this code under the wxWidget license.

EDIT: Changed the new version of changenb.cpp to have both HitTest for new versions of wxWidgets and no HitTest for old versions.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on August 17, 2005, 11:25:35 pm
Em are you sure it's a good idea to use hittest? I remember the hittest to be requested only recently in the wxwidgets project.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kimastergeorge on August 18, 2005, 12:41:23 am
I think it's alright. I keep the old version in there, for wxWidgets 2.5.1 and earlier. If the precompile logic I use doesn't satisfy you, you can always remove the HitTest() code and just use the other one.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on August 21, 2005, 02:50:57 pm
Hi!

Maybe wyoEditor can help regarding this.

He already haves a patch for wx:

[ 748469 ] wxNotebook::HitTest for wxMSW and wxUniv
Right clicking on a notebook tab brings up a context menu when this patch is
applied, otherwise nothing happens. If this patch is applied to make it
usable the define NOTEBOOK_HITTEST in setup.h has to be set to 1 (Only usable
on wxMSW and wxUniv).

Another patch, but little off-topic:
[ 865500 ] wxNotebook: No correct current page after DeletePage
On wxGTK after deleting a page which is before the current page always the
wrong current page is returned (only wxGTK)

Maybe the patches got included in the wx2.6 version, dunno.

See wyoEditor at http://wyoguide.sourceforge.net/
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tuft on September 11, 2005, 12:20:53 pm
wxNotebook uses wxTabView to render tabs, what about using that instead of whole wxNotebook?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: phlox81 on December 30, 2005, 04:56:10 pm
Hm, might wanna look at http://wxforum.shadonet.com/viewtopic.php?t=5761
Could be a solution, so far untested, but imho good looking...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on December 30, 2005, 10:45:57 pm
After a few minor changes I got it to compile under Windows and works fine, then I tried to compile it under Linux and the only problems left were just the Unicode ones, and after fixing them... it works!

Now, the questions:

Will it be accepted and added to Code::Blocks?
Will the author mind if we take the code and use it at our will?
Is the current implementation enough or will it need more things to be implemented?

I think the first two are the most important ones. The way it looks must be taken into account too.

So... answers?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: phlox81 on December 31, 2005, 12:49:39 am
After a few minor changes I got it to compile under Windows and works fine, then I tried to compile it under Linux and the only problems left were just the Unicode ones, and after fixing them... it works!

Now, the questions:

Will it be accepted and added to Code::Blocks?
Will the author mind if we take the code and use it at our will?
Is the current implementation enough or will it need more things to be implemented?

I think the first two are the most important ones. The way it looks must be taken into account too.

So... answers?

its not my work, so, you should aks at the wxforum probably.
And I don't know if you need to modify it, by the means
a bigger Application like C::B has. But it looks like a good start.
I just thought, thats what C::B was looking for...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on December 31, 2005, 06:19:40 am
Yes :) But we need to check out the licensing stuff.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on December 31, 2005, 06:44:33 am
I really like the way these tabs look (The statistics tab is active.)

http://azureus.sourceforge.net/img/sc/2.3.0.6/statistics_-_activity.png

Maybe I'll develop an all-new GPL notebook class based on one of these.

I also like these tabs:


[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on December 31, 2005, 07:01:31 am
Just a thought, we can merge that with the new wxAUI. That would be amazing! :D
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on December 31, 2005, 08:05:14 am
Ok, I got the first screenshot of how could it look applied. It was made by playing with MS Paint :)

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on December 31, 2005, 06:28:38 pm
Ok, I just asked the author if we could take his code and use it four our purposes and he accepted. The code is under the wxWidgets license BTW.

So, any objections or suggestions or acceptance?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Game_Ender on December 31, 2005, 10:29:42 pm
I certainly like, the current tab system could use this update.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: thomas on December 31, 2005, 11:20:28 pm
We would have to tweak the tab drawing a bit, it seems to draw tabs too small... but except for that it looks ok.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 01, 2006, 06:42:53 am
Draw tabs bigger... no problem with that.

I've considered to implement tab dragging and maybe scroll tabs with the mouse wheel, but first, it must be as far as possible a straight replacement for the current wxNotebook as used by Code::Blocks, after that all the new toys can come in.

I'll start working on it next week (so far I've only made a few minor fixes here and there) when I get back home.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 02, 2006, 06:00:56 am
Well, it seems people just keeps working on it. It's the way the Test program looks right now using the VC71 Style.

Now I really want it to be added to Code::Blocks :)

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on January 02, 2006, 06:09:48 am
I like it, but at the same time I have the "ughh it's Visual Studio 2003" feeling :lol:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 02, 2006, 09:54:08 am
Hi,

I am the author of the wxFlatNotebook class - If you want some differnt style - just let me know.

If you dont like the VC71 style - you can use the standard style, or wait until I will finish the gradient colored tabs (wont take long now)

Anyway, if you find a bug, just let me know (I did fix the borders when no images are assigned to a tab :))

My target is that this control to be mature and bug free

Regards,
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 02, 2006, 09:58:45 am
@Ceniza: can you post your test project so I can take a look at it?

@eranif: seems you 've done a good job there (judging from screenshots only) :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on January 02, 2006, 10:13:48 am
If you dont like the VC71 style - you can use the standard style, or wait until I will finish the gradient colored tabs (wont take long now)

Great! I for sure always preffer native over non-native, that's what I like about wxWidgets :)
Keep the good job! I hope it will be used in C::B soon :D
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 02, 2006, 10:22:48 am
Hi eranif, and welcome to this forums :)

It's pretty interesting to see how quickly it's being developed. Just a few days and it has almost everything needed by Code::Blocks.

I saw you just added RemovePage and OnMouseLeave.

An easy one to add, also used by Code::Blocks, is GetPageText (it's in wxPageContainer but not in wxFlatNotebook).

About the style, I like the VC71 one :)

Just like suggested in wxforum, adding a "close with double/middle click" would be nice too.

I tried to integrate it with Code::Blocks already but I got a really weird error that GDB isn't even catching.

Another set of functions used by Code::Blocks are the ImageList ones, but you said you had problems with the alpha channel doing it that way so you disabled them.

Oh, one last thing, being able to disable the X button would be handy too (for Code::Blocks, Messages and Management shouldn't allow the user to close a tab).

Sorry for the mess :P

mandrav: the test program is already included with wxFlatNotebook, but I'll attach his current version with Code::Blocks project files. Haven't tested with UNICODE build yet.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 02, 2006, 10:41:51 am
mandrav: the test program is already included with wxFlatNotebook, but I'll attach his current version with Code::Blocks project files. Haven't tested with UNICODE build yet.

Thanks :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 02, 2006, 01:33:39 pm
Hi,

I just wanted to let you know that added the GetPageText() API + Middle mouse button for closing tabs, and in addition I also added new
style for tabbing - so you might want to consider it if you dont like the current ones

So currently there are 3 style to choose from:

Fancy style:
(http://www.eistware.com/wx/shaped_tabs_fancy_style.png)

VC71 style:
(http://www.eistware.com/wx/shaped_tabs_vc71_style.png)

And the default style:
(http://www.eistware.com/wx/shaped_tabs_standard_style.png)

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 02, 2006, 01:49:15 pm
Can you make middle mouse = close a runtime option? I hate that "feature." I know other people like it so it's great that you have implemented it. :)

Can you also make an option to have a close button on each tab, with the option to have it either on the right or on the left? :)

I'd like to incorporate your work with a new branch of wxAUI. It has *huge* potential as the tab layout for stacked dockable panes. Are you up for this? I'm going to set up a public Subversion repository for my working copy of wxAUI today.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: David Perfors on January 02, 2006, 05:04:11 pm
good job, and yes, please implement it :lol:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 02, 2006, 09:40:06 pm
Well, I found the time to take a look and it looks good. Good job eranif :)

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 02, 2006, 09:45:11 pm
Wow, mandrav, that's beautiful :)

Would you mind to share your new toy with us? :P

BTW, a new version is on the way with a few more thingies.

I really wanna try that baby with VC71 style :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 02, 2006, 09:46:45 pm
Well, the version you sent me and I tested, has some obvious bugs, lol :)
eranif, are you around?

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 02, 2006, 09:53:46 pm
Evil bug :shock:

BTW, did you try with the latest version? http://www.eistware.com/wx/wxFlatNotebook.zip (http://www.eistware.com/wx/wxFlatNotebook.zip)

Every new version goes to the same link. There's one around supporting tab dragging too.

Middle click to close was already added.

Would be good if the close behaviour could be disabled so it could be used for Messages and Management too.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 02, 2006, 09:55:53 pm
No, I only tried and used the version you sent me.
That's why I need eranif around. To discuss our "roadmap", sort of...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 02, 2006, 10:28:37 pm
Hi,

What happen if you change the size of the application? (resizing it - does it help?)

Try to add this to the main frame:
SendSizeEvent();

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 03, 2006, 02:12:17 am
mandrav: could you update to the latest version and try again? The project files I provided work for that one too.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 12:19:21 pm
What happen if you change the size of the application? (resizing it - does it help?)

No...

mandrav: could you update to the latest version and try again? The project files I provided work for that one too.

I have updated last night (after your previous post). The only thing that (I noticed) changed was middle-click closing.
There's no version info however. Eran, you should maintain a version number for it...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 12:37:40 pm
OK, fixed this :)
It was not a wxFlatNotebook bug, but an implementation one (caused by me).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 03, 2006, 12:57:18 pm
erinif, would you like like to use my Subversion server to keep track of your updates? If you incorporate this into wxAUI so it can be used both in the wxAUI panes and as standalone calls, I already have a Trac wiki/bugtrack system/Subversion server set up for it here:

http://djss.dynalias.net/trac/wxAUI
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 01:16:23 pm
I agree, from the next version I will place in the header file the version number.

Happy to hear that it was your bug  :wink:

I am currently of working on the some annoying bug with the middle button close - it selects the file, and then closes it.
After it I will start working on wxFNB_BOTTOM style - place the tabs on the bottom part of the book.

I already added an options to remove the 'x', '<>' buttons - so you can now use the control for the other windows as well
and not only as the main editor container for scintilla editors (you are using scintilla, right?)

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 03, 2006, 01:22:15 pm
You don't need to do that if you use Subversion to keep track of revisions anyway. Just put $Id$ in the header.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 01:45:16 pm
I agree, from the next version I will place in the header file the version number.

Happy to hear that it was your bug  :wink:

I am currently of working on the some annoying bug with the middle button close - it selects the file, and then closes it.
After it I will start working on wxFNB_BOTTOM style - place the tabs on the bottom part of the book.

I already added an options to remove the 'x', '<>' buttons - so you can now use the control for the other windows as well
and not only as the main editor container for scintilla editors (you are using scintilla, right?)

Eran


Nice to hear you 're working on it. Where do you put the updates? It's the same download link always?
If you need repository access, you could use ours. I will put it on SVN anyway so if you don't have another repository, you 're welcome to work here.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 02:39:12 pm
Hi,

I have at home 3 computers, 1 is for CVS + other servers and bug tracker, So i will add the sources to there ( this way I will have version control for the sources + I will be able to track the bugs)

Thanks for the offer,

Eran


Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 02:41:22 pm
I forgot the answer your question: Yes, the link always contains the latest souces + sample

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 03, 2006, 05:12:35 pm
eranif: You might considering posting your project officially at berlios (for SVN access) or sourceforge (for CVS access).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 07:46:40 pm
@Eran: please allow the event handler to cancel an operation.

What I mean is, you send events before page changes, after it changes and before it closes. But right now, they 're just informational events, i.e. just letting us know what is going to happen.
But we should be able to say to wxFlatNotebook: "hey, do not close this page, it's not saved yet" :)

Fortunately, this is easy. Just add the following couple of lines after posting the message:
Code
    // the event handler allows it?
    if (!event.IsAllowed())
        return;

I have already added it in my copy but it will be a pain to merge these after every update...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 09:02:29 pm
Ok, Will do

I am also attaching a snipt of the bottom style that I am currently working on (i created the style for 2 of the 3 styles):

(http://www.eistware.com/wx/fancy_bottom.png)
(http://www.eistware.com/wx/vc71_bottom_style.png)

I also removed the X<> buttons and configured them as styles as you guys requested

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 03, 2006, 09:04:34 pm
Eran,

Thanks, you are doing a wonderfull job !!!!!!!!

Cheers,
Lieven
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 09:15:10 pm
Thanks Eran :)

I 'm almost done integrating it. I only have a problem with middle-click closing. Did you update the zip file by any chance?  :lol:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 03, 2006, 09:25:22 pm
Pretty nice job. Really.

mandrav: After wxFNB_BOTTOM and your request be implemented would it be ready for the transition? (I know, I'll be patient.) :)

There's only one minor thing left: when using the style wxFNB_NO_X_BUTTON, could the space saved by not drawing the X be used? I mean, if there won't be X button but navigation arrows, those could be moved to the right, giving at the same time a few extra pixels for the tabs.

mandrav: the middle-click problem is the selected tab changes BTW?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 03, 2006, 09:30:05 pm
I have wxAUI and wxFlatNotebook working together nicely:

svn://djss.dynalias.net/wxAUI/trunk
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 03, 2006, 09:31:59 pm
@Eran: you have a bug in RemovePage().
In the event you 're posting you have:
event.SetSelection(m_pages->m_iActivePage);

when it should be:
event.SetSelection(page);

Because of this, I was deleting the wrong page. No wonder why it went crazy on me ;)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 09:35:26 pm
OK,

I am done with the bottom style here is the last piece missing (the default style, ironcially the hardest one to move to bottom ...)

Here is how it looks:
(http://www.eistware.com/wx/standard_bottom.png)

For the middle button: Is is the same problem reported earlier by Ceniza (the selection is changed before closing the tab)?

If it is the same problem - I will have a look at it

Eran


Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 03, 2006, 10:35:24 pm
Eran: A couple of questions from a non-(yet)-user:

Is the option for < and > (but not X ) implemented? Just curious.
Finally, under what license are you releasing your code? Using the wxWindows license would be good, that way we could incorporate your class on private (non-opensourced) projects.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 10:44:43 pm
Hi,

The options for the 'x' '<' '>' are implemented (the sources are updated at the usuall place and the demo is updated as well)
The licnese is wxWidgets (you can use it for any purpose you like, as long as you follow the wxWidgets license)

The full sources + demo can be downloaded from:
http://www.eistware.com/wx/wxFlatNotebook.zip (http://www.eistware.com/wx/wxFlatNotebook.zip)

Regards,
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 03, 2006, 10:56:42 pm
Cool, thanks! :)

BTW, have you considered submitting your code to wxWidgets so it'll become an official widget?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 03, 2006, 11:34:58 pm
Julian already put a link to my work at the wxWidgets site (check the contributions part -> classes )

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 03, 2006, 11:52:47 pm
when i shrink the demo horizontally so that only one tab is visible, the advance selection arrows aren't working

(http://img308.imageshack.us/img308/9823/wxflatnotebookonetabonly9ec.png)

[edit]
another issue, if the horizontal size is very small, no tab is shown  :shock:
i would expect some kind of truncated tab instead of none.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 12:39:54 am
@Eran:
I finished converting C::B to use wxFlatNotebook for the editors.
Here's the patch with the absolutely needed changes. Review it and use it :)

Also, as a sidenote, you might want to make at least the public wxFlatNotebook functions virtual. One might want to override some of its behaviour...

(darn, all the trouble was coming from the opened files tree...)

EDIT: forgot the attachment, lol.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 04, 2006, 01:04:44 am

mandrav: Can you please send me the source files? instead of what you sent? (i guess it is an output of the SVN you are using, I am not familiar with it).

I am using araxis to merge the files - so just send out your files, and i will do the rest.

tiwag : I will look at the bugs you reported - tomorrow (I did noticed the first one when only one tab is visible there is no way to scroll right)

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: thomas on January 04, 2006, 01:22:09 am
Eran, you really want to learn to use svn. Seriously, you do yourself a favour, greater than you can possibly imagine.
I have been programming without revision control for many years, and sure enough, you can do that. Occasionally you will spend an afternoon trying to undo the changes of yesterday because they don't work, and occasionally you will be searching for your backup disks in cold sweat, and sometimes you will be asking yourself when you changed a particular file, and why. But yes, it mostly works.

A revision control system such as svn makes your life a lot happier and easier by taking all these problems out of your hands (it also makes merging easier). As an allegory, think of crossing the Atlantic Ocean. You can do that in a canoo, or you can fly in a jet. Both methods work, most of the time :)

If you use TortoiseSVN (tortoisesvn.tigris.org) then doing revision control is as easy as a right-click on a folder.

A good introduction about revision control (in particular svn) works can be found here: http://svnbook.red-bean.com/en/1.1/svn-book.html
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 01:25:46 am

mandrav: Can you please send me the source files? instead of what you sent? (i guess it is an output of the SVN you are using, I am not familiar with it).

I am using araxis to merge the files - so just send out your files, and i will do the rest.

Sure, here are the files.
But the file I posted before is a unified diff. I 'm sure araxis merge can "apply" it to your sources.

[attachment deleted by admin]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 04, 2006, 01:28:23 am
Just in case: You can analyse the patch "by eye" and do the changes manually.

Example:
Code
+++ wxFlatNotebook\include\wx\wxFlatNotebook\wxFlatNotebook.h	Tue Jan 03 23:45:17 2006
@@ -104,7 +104,7 @@
  /**
  \param page - index of page to be deleted
  */
- void DeletePage(size_t page);
+ void DeletePage(size_t page, bool notify = true);
 
  /// Deletes all notebook pages and destroys all windows associated with pages
  bool DeleteAllPages();

Thie line "+++ wxFlatNotebook...etc" says which file is to be modified.
The lines before the - and + are the context - they tell you (or the patcher) where the modification is to be found. So if you search for "param page - index of page to be deleted", you'll find the lines.

The "-   void DeletePage(size_t page);" means this line is to be replaced. The "+   void DeletePage(size_t page, bool notify = true);" is the replacement.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 04, 2006, 07:43:59 am
I am familiar with soruce controls, In fact, I am running 2 CVS servers at home ... (I have other projects as well).
And I am using TortoiseCVS as my client.

I also submitted a request to soruceforge to host my sources, in case it will accept, I will get CVS access and storage for the sources so other developers will have access instead of sending me files to do the merge.

Eran

Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: takeshimiya on January 04, 2006, 08:21:58 am
I am familiar with soruce controls, In fact, I am running 2 CVS servers at home ... (I have other projects as well).
And I am using TortoiseCVS as my client.

I also submitted a request to soruceforge to host my sources, in case it will accept, I will get CVS access and storage for the sources so other developers will have access instead of sending me files to do the merge.

Eran



Why don't you ask for wxCode (wxcode.sourceforge.net) hosting?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: thomas on January 04, 2006, 09:30:02 am
I am familiar with soruce controls, In fact, I am running 2 CVS servers at home ... (I have other projects as well).
And I am using TortoiseCVS as my client.
Ah sorry :)
You might still risk a look at Subversion though, it is a no-timer to learn if you know CVS, and it is way better. :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 04, 2006, 05:35:52 pm
darn too late :P He already requested at SF. But we can hope that SF implements SVN access soon :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 04, 2006, 06:38:40 pm
Just a quick question:

Which of the three styles that I provided are you going to choose for C::B?
Or is it going to be configurable?

Btw, I also wrote an IDE (I stopped developing it however) - I will be happy to share some of my features with you guys.
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on January 04, 2006, 06:39:53 pm
Just a quick question:

Which of the three styles that I provided are you going to choose for C::B?
Or is it going to be configurable?

Btw, I also wrote an IDE (I stopped developing it however) - I will be happy to share some of my features with you guys.
Eran


I think it should be user-configureable...... I don't know that it will be..........
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 06:51:24 pm
I want VC71 (did I say that already? :P) but if the widget allows customization then Code::Blocks should allow the user to pick his/her favourite flavor :)

Quote from: eranif
Btw, I also wrote an IDE (I stopped developing it however) - I will be happy to share some of my features with you guys.

Yeah, why not? This one, right? (http://eistware.com/)

I just checked the list and Code::Blocks shares most of those. "Type Info" is a nice one Code::Blocks misses, or am I the one who missed something?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 06:52:24 pm
Which of the three styles that I provided are you going to choose for C::B?
Or is it going to be configurable?

It already is configurable ;)
(I will commit in a while)

Btw, I also wrote an IDE (I stopped developing it however) - I will be happy to share some of my features with you guys.

Sharing is always good :lol:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on January 04, 2006, 06:54:14 pm
It already is configurable ;)
(I will commit in a while)

Nice.  8)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 07:07:02 pm
Quote from: mandrav
Sharing is always good :lol:

I bet that one isn't yours :P

Anyway, good to know you're going to commit it :)

BTW, did you try the latest version that has a first implementation of drag and drop? It seems to be working, even though you cannot drop it to a non-visible place (or I just couldn't find how).

Unfortunately some bugs still remain: if only one tab is visible, the right arrow won't work. If no tab is visible, trying to scroll will make it crash.

Oh, and don't forget it must be tested under Linux. I did already, but only the first version :P
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav 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).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza 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?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot 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)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav 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.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif 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
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza 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 :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav 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 :)).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif 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
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif 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
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav 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?


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 ;)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav 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 :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza 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?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot 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
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza 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
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot 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)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 04, 2006, 09:33:18 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

i've just built without problems

(http://img404.imageshack.us/img404/2237/cbwxaui3fa.png)

small bug - the open files window is now named "disassembly" - however , tab drag'n drop is a nice feature !
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 04, 2006, 09:37:47 pm
the error message is like this :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory
gcc: Files\CodeBlocks\include: No such file or directory

hmm, notice how Program from files seems to be missing in the error message.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 09:40:01 pm
Add double quotes to that path.

[edit]
tiwag: I was just going to ask you if you also got Disassembly as the title for the Opened files list, but I already see it in your screenshot :P
[/edit]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 09:47:47 pm
There's something evil with the behaviour when you open a file when there's one opened already: the new tab will be added last but showed first, hiding all others.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 04, 2006, 09:50:01 pm
Add double quotes to that path.

[edit]
tiwag: I was just going to ask you if you also got Disassembly as the title for the Opened files list, but I already see it in your screenshot :P
[/edit]

yeah - didn't notice it at the first glance , it took a while - just when i saw my posting already in the browser  :)

but it's really nice ,  isn't it ?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 04, 2006, 09:50:26 pm
I alreay got a report for this bug    :twisted:

Will try to fix it asap ...
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 04, 2006, 10:07:06 pm
double quotes did not help
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 10:10:11 pm
MS-DOS path?

C:\PROGRA~1\CODEBL~1\INCLUDE

Awful, untested, but could work.

[edit]
If in doubt use dir /X to check the right name.
[/edit]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 10:17:11 pm
tiwag: I was just going to ask you if you also got Disassembly as the title for the Opened files list, but I already see it in your screenshot :P

This has to do with the layout having been saved with a previous version which didn't have the "open files list" as a docking window.
Just use the new "View->Layouts->Delete current" ;) (which I forgot to mention in the log message).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 04, 2006, 10:33:11 pm
Ok, I got it to show correctly, but now my old Layout isn't deleted (if I restart Code::Blocks it's there again).
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 04, 2006, 10:37:16 pm
forget about dos path, installed MingW manually in c:\MingW ;-)

BUT still problem :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

 :( :( :( :( :( :( :(

and look at this, build does not even stop !!
Quote
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory
Compiling: src\startherepage.cpp
Linking executable: devel\codeblocks.exe

Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 10:45:31 pm
Ok, I got it to show correctly, but now my old Layout isn't deleted (if I restart Code::Blocks it's there again).

Create a new one, switch to it, delete the default and rename the new one as "Code::Blocks default".
Sorry but the default layout isn't easy to change because it's kept in memory...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 04, 2006, 10:46:57 pm
BUT still problem :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

Try adding $(#WX.INCLUDE) in src target resource dirs.

and look at this, build does not even stop !!

If windres.exe returns 0 as exit code, of course it won't stop...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 04, 2006, 10:49:00 pm
it seems you can no longer drag and drop on the level of the editor tabs
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 04, 2006, 10:53:28 pm
BUT still problem :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

Try adding $(#WX.INCLUDE) in src target resource dirs.

I saw this is already specified on the global level of the cbp file, nevertheless trying it out

[EDIT] : no luck  :( :(
Why why why ??  Heeeeeeeeeeeeeeeeeeelp

this was on my laptop, on my pc it builds (so a nightly build will come up)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: grv575 on January 05, 2006, 12:58:45 am
BUT still problem :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

Try adding $(#WX.INCLUDE) in src target resource dirs.

I saw this is already specified on the global level of the cbp file, nevertheless trying it out

[EDIT] : no luck  :( :(
Why why why ??  Heeeeeeeeeeeeeeeeeeelp

this was on my laptop, on my pc it builds (so a nightly build will come up)

This ansi or unicode?  Should be mswu for unicode...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: AkiraDev on January 05, 2006, 01:47:32 am
BUT still problem :
Compiling: src\resources\resources.rc
src\resources\resources.rc:9:24: wx/msw/wx.rc: No such file or directory

Try adding $(#WX.INCLUDE) in src target resource dirs.

I saw this is already specified on the global level of the cbp file, nevertheless trying it out

[EDIT] : no luck  :( :(
Why why why ??  Heeeeeeeeeeeeeeeeeeelp

this was on my laptop, on my pc it builds (so a nightly build will come up)

This ansi or unicode?  Should be mswu for unicode...

Hi!

If nothing else helps, I'm afraid the only solution will be wiping out wxWidgets from your hard drive and recompiling... It was the only way I could build the latest SVN in my laptop last time.

EDIT: Found it!
Pardon my sillyness, there's just one thing missing from the CodeBlocks-NewBuild project, you only need to manually add "resources" to the resources directory in the directories tab under build options. Then it should compile.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 05, 2006, 07:24:59 am
Quote
This ansi or unicode?  Should be mswu for unicode...
not for the resource, it's to be seen as a regular source file
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 05, 2006, 07:42:09 am
tiwag: I was just going to ask you if you also got Disassembly as the title for the Opened files list, but I already see it in your screenshot :P

This has to do with the layout having been saved with a previous version which didn't have the "open files list" as a docking window.
Just use the new "View->Layouts->Delete current" ;) (which I forgot to mention in the log message).

there is a problem if you have saved the Code::Blocks default layout already in the past - then you can't get rid of this by reverting to this standard Layout - better to have this Code::Blocks default layout really hard-coded which always matches to the actual version.

another problem : when i wanted to correct this in my default.conf file i was astonished  :shock: :shock: :shock:
there are no more line-endings and tabs - please insert these as it was in the past - impossible to edit by hand otherwise.
[edit] solved: had to use a xml file editor [/edit]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 05, 2006, 07:50:58 am
I can confirm that. default.conf is a one line mess now.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 05, 2006, 08:09:01 am
I can confirm that. default.conf is a one line mess now.
anyhow - it's more save to use a xml editor.

the actual *.conf file structure seems to be xml conformant
- at least XML-Notepad accepted the file for opening and editing
( i didn't try others, which always complained in the past about nonconformant xml file format and therefore rejected editing )
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: killerbot on January 05, 2006, 09:09:35 am
would be nice if this becomes back multilined, text editors are nice also (if want to copy stuff from it)  ;-)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: tiwag on January 05, 2006, 09:22:05 am
would be nice if this becomes back multilined, text editors are nice also (if want to copy stuff from it)  ;-)

workaround:

open *.conf with XML-Notepad
http://www.snapfiles.com/get/xmlnotepad.html

save as ..


Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: kkez on January 05, 2006, 03:39:06 pm
There's something evil with the behaviour when you open a file when there's one opened already: the new tab will be added last but showed first, hiding all others.

*  :(
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 08:54:31 pm
Hi,

I fixed the following bugs:

- No scroll was possible if only one tab was drawn
- A crash when no tabs can be drawn (but the book contains pages)
- Adding new page would hide the other tabs (the evil bug)

All the sources are now updated at sourceforge, so you can download them from CVS directly.
The zip file (in the download page) does not contain these fixes - so you should use the CVS files

For anonymous login to the CVS run the following command:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wxflatnotebook login

 - When a request for the password appears, simply hit 'Return'

And then checkout the module by running the following command:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/wxflatnotebook co -P contrib

the project at sourceforge can be found at:
http://sourceforge.net/projects/wxflatnotebook (http://sourceforge.net/projects/wxflatnotebook)

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 05, 2006, 08:57:19 pm
cool! :D I'm glad you got it on Sourceforge! :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 05, 2006, 09:25:50 pm
CVS and bugfixes... nice :)

Did you apply mandrav's patches too?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 10:00:00 pm
CVS and bugfixes... nice :)

Did you apply mandrav's patches too?

No he hasn't.
No problem though, as long as it is kept under source control (which it is now). I have now added in SVN the patch file to bring wxFlatNotebook CVS (current) to C::B's copy.
Haven't committed yet though (converting MessageManager).

@eran:
When I commit the changes, you can take a look at the patch. I believe three fixes there will interest you ;)
One fix is, when setting selection, not to display the selected tab as first one.
The second is to call Reparent() in AddPage(). If you don't do it, you don't acquire ownership of the added page and this leads to many bad things...
Finally, I have added a int GetPageIndex(Window* page) to acquire the page index for a page. Now that you have implemented dragging tabs around, there is no other way to know the index of a page ;)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 05, 2006, 10:08:19 pm
Quote from: mandrav's post
« Reply #132 on: Today at 04:00:00 PM »

Quote from: mandrav
... converting MessageManager ...

Only the Management ones left, right?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 10:23:16 pm
Only the Management ones left, right?

Right.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:28:40 pm
Thanks, I will.

- However, I already fixed the SetSelection() function, unless you find some other new bug in it.
 

Quote
When I commit the changes, you can take a look at the patch. I believe three fixes there will interest you

I dont have access to your SVN, so how will I be able to see the changes?

I assumed that when adding a window to the book, the parent of the new added window is the book itself

Btw, Did you get any progress with the Linux building and displaying?

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 10:37:42 pm
- However, I already fixed the SetSelection() function, unless you find some other new bug in it.

Yes, new :)

I dont have access to your SVN, so how will I be able to see the changes?

When I commit (in a while), you will find it here (http://svn.berlios.de/wsvn/codeblocks/trunk/src/sdk/wxFlatNotebook/?rev=0&sc=0).

I assumed that when adding a window to the book, the parent of the new added window is the book itself

Well, someone has to take ownership. If you want to see the effect, create one page with the frame as its parent and then add it in the notebook...

Btw, Did you get any progress with the Linux building and displaying?

What's wrong with it? It looks and works fine.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:42:10 pm
I thought that earlier here, Ceniza I think said that he wasnt able to see anything on Linux using wxFlatNotebook.

So, If it is OK, no problem here

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 05, 2006, 10:43:39 pm
eranif: How about giving Yiannis developer access to your class? :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:45:38 pm
Hmmm,

Who is Yiannis?

Lol

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 10:47:20 pm
Who is Yiannis?

Lol, me :lol:
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:50:15 pm
No, Problem - Will be easier for the patching things ...

I just need to figure out how do I do that - will check it now

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:52:06 pm
Mandrav, Ok, I need to have your sourceforge user name
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 10:54:40 pm
Mandrav, Ok, I need to have your sourceforge user name

mandrav :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on January 05, 2006, 10:54:48 pm
Nevermind that ... already got it - mandrav is the user name in SF
You are now member in the wxflatnotebook project

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 05, 2006, 10:56:04 pm
I just built Code::Blocks under Linux and the wxFlatNotebook is showing right.

I couldn't see anything with the test program (it was that or the crash), but haven't tested with a more recent version. Maybe it has something to do with one of those changes made by mandrav (maybe the Reparent one?).

I can see the changes to MessageManager have been just committed :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 05, 2006, 10:59:20 pm
Forgot to ask something in the last post :(

mandrav: have you enabled the option to choose if the notebook will be shown at the top or the bottom?

[edit]
I just tried it and see it's hardcoded to be bottom for Messages, but you answered already.

I also noticed the space used by the X button when it doesn't exist is still there. Somebody in wxforum fixed it, but I didn't try it http://wxforum.shadonet.com/viewtopic.php?p=26829#26829 (http://wxforum.shadonet.com/viewtopic.php?p=26829#26829).
[/edit]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 11:12:20 pm
Forgot to ask something in the last post :(

mandrav: have you enabled the option to choose if the notebook will be shown at the top or the bottom?

Not yet. I just set bottom for the Messages but I will add configuration settings for this.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 05, 2006, 11:45:06 pm
Nevermind that ... already got it - mandrav is the user name in SF
You are now member in the wxflatnotebook project

Thanks Eran :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 06, 2006, 05:03:54 pm
Finally, now Code::Blocks is using wxFlatNotebook "everywhere" (three places really), but the Messages notebook is hardcoded to be top and the editor one to always be fancy :(
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 06, 2006, 05:14:30 pm
but the Messages notebook is hardcoded to be top and the editor one to always be fancy :(

Top/bottom is set by right-clicking on a tab.
All three notebooks use the same style setting. Try going to "Settings->Environment" and pressing OK to force writing the settings again.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 06, 2006, 05:32:26 pm
Quote from: mandrav
Top/bottom is set by right-clicking on a tab.

Nice :)

Quote from: mandrav
All three notebooks use the same style setting. Try going to "Settings->Environment" and pressing OK to force writing the settings again.

Did that and the editor's one is still fancy.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 06, 2006, 05:42:56 pm
Quote
Did that and the editor's one is still fancy.

Before I start searching for bugs, could you delete your default.conf and report back?
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 06, 2006, 06:00:05 pm
Ok, renaming (instead of deleting :)) default.conf and starting Code::Blocks fixed the problem, now, how should I edit my current default.conf so the problem is gone?

[edit]
I just opened it and it's still the same one line mess.
[/edit]
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 06, 2006, 06:05:14 pm
[edit]
I just opened it and it's still the same one line mess.
[/edit]

Get revision 1664, build, run C::B, close it and edit default.conf.
You need to delete "environment/editor_tabs_style"...
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 06, 2006, 06:06:31 pm
Removed EDITOR_TABS_STYLE from the mess and worked :)

I'll update anyway :)

Thanks master.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 06, 2006, 06:12:28 pm
The evil bug attacks again!

Try this: in the messages dock select "Build log", close Code::Blocks and open it again. Now "Build log" will be the first tab and 3 (Code::Blocks, Code::Blocks Debug and Search Results) will be "hidden".
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 06, 2006, 06:17:01 pm
The evil bug attacks again!

Try this: in the messages dock select "Build log", close Code::Blocks and open it again. Now "Build log" will be the first tab and 3 (Code::Blocks, Code::Blocks Debug and Search Results) will be "hidden".

You can hit the left button to bring the "hidden" tabs into view, but yes, this is troublesome. :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 13, 2006, 04:15:17 am
I've found sometimes the global style settings for the tabs won't get applied to every notebook (just the same problem I had).

A way to reproduce it:


It could take less steps, but that's a working way to reproduce it.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: mandrav on January 13, 2006, 09:46:58 am
Fixed, thanks.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Ceniza on January 13, 2006, 09:51:55 am
Quote from: lord mandrav
Fixed, thanks.

Thanks :)
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Chriss on January 13, 2006, 02:34:24 pm
there is a bug if you drag one tab, maybe the build tab to the tabs in the main window. code::blocks crashes immediately.
//edit: fixed in jan12 build.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: rickg22 on January 13, 2006, 05:22:18 pm
I noticed something in the Jan 12 build... sometimes the active editor's tab isn't shown.. i have to press the left and right arrows to see it.
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: 280Z28 on January 13, 2006, 05:51:40 pm
I noticed something in the Jan 12 build... sometimes the active editor's tab isn't shown.. i have to press the left and right arrows to see it.

Yep I just had that happen. :o
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on January 26, 2006, 06:37:54 pm
Guys eranif just updated wxFlatNotebook...... Just a heads up

http://wxforum.shadonet.com/viewtopic.php?t=5761&start=90
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Michael on January 26, 2006, 06:41:36 pm
Guys eranif just updated wxFlatNotebook...... Just a heads up

http://wxforum.shadonet.com/viewtopic.php?t=5761&start=90

The changes look really interesting :D.

Michael
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on March 02, 2006, 12:06:37 am
Heh A new version of wxFNB is out. Here is a ripped copy of Eranif's post from here.

http://wxforum.shadonet.com/viewtopic.php?t=5761&postdays=0&postorder=asc&start=120

Need I ask that wxFNB could be updated if possible? Maybe this will fix our drop target problems. :P

Hi,
Since I got several requests from people, I created new version
with the following changes:

Features:
--------

+ Changed the buttons ( <>x buttons ) coloring to be more XP look
+ An option to remove the border around the tab area
+ Set/Get colors of the following:
- Active tab text
- Non-Active text
- Tab area colors
- Active tab color
+ New option introduced to add 'X' button on active tab
+ New event is now fired after page is being closed wxEVT_COMMAND_FLATNOTEBOOK_PAGE_CLOSED -
this allow the application to preform some cleanup after closure of page
+ An option to disable a tab - a tab can now be disabled, which means it will not receive any event, user can not select
it nor navigate to it (using Ctrl+Tab/Tab)


Bugs:
----
+ Fixed minor drawing issues
+ Fixed bug that when closing the a tab using the mouse middle button, the page was set to active and only then closed.
+ Fixed bug that the old selection value in the event when closing a page was incorrect

The files are zipped at sourceforge - enjoy
Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on March 03, 2006, 08:42:20 pm
Quote
Maybe this will fix our drop target problems.

Can you please describe the problem, since I wasnt aware of it

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on March 03, 2006, 08:54:09 pm
http://forums.codeblocks.org/index.php?topic=2371.0
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on March 03, 2006, 09:05:08 pm
Did you try to disable the drag'n'drop of the wxFlatNotebook using the style: wxFNB_NODRAG style?

Eran
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: sethjackson on March 03, 2006, 09:08:47 pm
Did you try to disable the drag'n'drop of the wxFlatNotebook using the style: wxFNB_NODRAG style?

Eran


No... I think we want to keep the drag and drop of wxFND......
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: Pecan on March 03, 2006, 10:11:26 pm
Did you try to disable the drag'n'drop of the wxFlatNotebook using the style: wxFNB_NODRAG style?

I was unaware of that flag. So I wrote a patch to simply set
wxFlatNotebook's drop target back to the original MainFrame
drop target. It works fine.

I wanted to keep the dragNdrop for the notebook tabs (page container),
but also keep the dragNdrop target for the project tree control. The patch
meets that objective. Especially since wxFNB is _not_ using it's wxFlatNotebook
drop target, only it's page container drop target.

Maybe Yiannis or Thomas will want to arbitrate this.

thanks
pecan
Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: eranif on August 21, 2006, 12:20:09 am
Hi,

Sorry to wakeup a "dead" thread like this, but I have a question:

Would you be intersted in adding new 'look' to C::B?
Recently, I developed a whole set of controls for wxWidgets (which I wanted to sell, but eventually I decided to give it for free, including sources, to the community for free project such as C::B)

Here is a screenshots of the control wxStyledNotebook - derived from wxFlatNotebook - to replace it, just do find and replace for the type and you will get this look (In addition to the existing ones):
(http://www.eistware.com/wxes/slide_show_controls/original/Styled_Notebook.png)
Of course that the colorful tabs can be removed  :D

If you are intresting in any other of my controls - here is a screenshot of bunch of them - all for free with source code
(http://www.eistware.com/wxes/slide_show_controls/original/all.png)

The terms for using them are very simple:
If you are developing a free project like C::B or any other - then it is for free, with source files
for any other purpose, contact me

Eran
AKA
eranif


Title: Re: BOUNTY: Notebook class with "close" button at the right
Post by: squizzz on August 21, 2006, 04:58:11 pm
@eranif - these look really amazing... Just as amazing as the fact how much you share your (great) code with others!
I wish you earn a lot of  money selling them.

PS. Consider putting link to your website into your signature (or profile) - it takes a lot of time to find it.
Also, you may consider using PNG image format for all your screenshots here (http://www.eistware.com/wxes/slide_show_controls/thumb.html) - only two of them are jpegs, but their lossy compression really spoils the look.