How to build wxFlatNotebook for VS 2010?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
pstraton
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Oct 02, 2013 3:27 pm

How to build wxFlatNotebook for VS 2010?

Post by pstraton » Sat Nov 30, 2013 7:51 am

I'm on several learning curves: very experienced C programmer upgrading to C++, new to Visual Studio (2010), pretty comfortable with out-of-the-box wxWidgets at this point, but am intrigued by a contributed widget wxFlatNotebook, which appears to address some problematic limitations I've run into with wxNotebook. Downloaded the wxFlatNotebook source and unzipped it but I'm not at all clear about what it takes to properly build a contributed tool like that and configure VS to compile and link it correctly, and I haven't found any useful step-by-step instructions in a couple hours of web surfing. Any help with how to do that would be much appreciated.

Thanks in advance.

User avatar
doublemax
Moderator
Moderator
Posts: 14954
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to build wxFlatNotebook for VS 2010?

Post by doublemax » Sat Nov 30, 2013 12:04 pm

First you should check if wxAuiNotebook does what you need. It's part of wxWidgets and therefore easier to use.

Which wxWidgets version are you using?
wxFlatNotebook will probably only work out of the box with wx 2.8.12. For newer versions it may require some tweaking.

In the wx 2.8.12 source tree should be a directory "contrib". And if you unpack the wxFlatNotebook source, the toplevel directoy will also be "contrib". Copy the files from the wxFlatNotebook tree over the wxWIdgets tree, so that the files will end up in the same directories.

Then go to ./contrib/build/wxFlatNotebook/ and load the VS project file. Theoretically it should build out of the box. Good luck :)
Use the source, Luke!

pstraton
In need of some credit
In need of some credit
Posts: 9
Joined: Wed Oct 02, 2013 3:27 pm

Re: How to build wxFlatNotebook for VS 2010?

Post by pstraton » Sat Nov 30, 2013 8:00 pm

Thanks for the clarifying information, doublemax.

I am using wxWidgets 2.9.5, which doesn't include a "contrib" directory, which where I got lost and wandered off into the weeds.

What took me down that path was the desire to set the background color of the page tabs to be the same color as the page body. That is desirable because my notebook has two pages with similar components and layout (multiple file pickers, since my app operates on multiple files simultaneously), so the two pages look very similar but have dramatically different functionality. In order to help the user not accidentally try to use the wrong page for their momentary need, I've set distinct background colors for each page, so that users will associate the color-environment with a particular type of task. Having gray tab background just looks funky in the context of the color, and it also hides the task-associated color of hidden tabs.

Browsing for help on how to set the background color of a wxNotebook page tab, I bumped into wxFlatNotebook references, which looked promising in that regard.

Based on your guidance, I have now experimented with wxAuiNotebook and find it to be a much improved look-and-feel and, given the hurdles to get wxFlatNotebook going in 2.9.5, I'll probably stick with it. But I'm not finding an obvious way to set tab background colors for it either. So I am still curious whether there is a way to do so.

Best regards, and thanks again for your valuable help.

User avatar
doublemax
Moderator
Moderator
Posts: 14954
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: How to build wxFlatNotebook for VS 2010?

Post by doublemax » Sun Dec 01, 2013 9:07 am

I don't think there is a way to do that in wxAuiNoteBook either. You can set the tab color of the active page and the other pages, but not for each page individually. Can't you work with colored icons for the tabs?
Use the source, Luke!

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2465
Joined: Sun Jan 03, 2010 5:45 pm

Re: How to build wxFlatNotebook for VS 2010?

Post by PB » Sun Dec 01, 2013 1:25 pm

I have not done it, so it may not be as easy as it sounds, but: Can't you just use custom wxAuiTabArt for the notebook? Simplest but not most elegant or efficient solution would be just to override its DrawTab method and copy the code from e.g. wxAuiSimpleTabArt, only changing the color/brush to your liking...

Post Reply