Bakefiles for wxFlatNotebook 1.3

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
wugo
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Mar 13, 2006 8:05 am

Bakefiles for wxFlatNotebook 1.3

Post by wugo »

Hi,

I just wanted to build wxFlatNotbook with Bcc 5.5 and MSVC 6.0 compilers
but I did not find makefiles for those compilers. So I created simple bkl's
for regenerating makefiles easily.

However there were problems with building wxFlatNotebook with either
Bcc or Msvc. For Msvc I had to :

1. change : BEGIN_EVENT_TABLE(wxPageContainerBase, wxControl)
to : BEGIN_EVENT_TABLE(wxPageContainerBase, wxPanel),

2. replace all std:min(..) with if(...),

3. add

-----------
#ifdef WXMAKINGDLL_WXFLATNOTEBOOK
#define WXDLLIMPEXP_WXFLATNOTEBOOK WXEXPORT
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) WXEXPORT type
#elif defined(WXUSINGDLL)
#define WXDLLIMPEXP_WXFLATNOTEBOOK WXIMPORT
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) WXIMPORT type
#else // not making nor using DLL
#define WXDLLIMPEXP_WXFLATNOTEBOOK
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) type
#endif
-----------

to wxFlatNotebook.h

4. add WXDLLIMPEXP_WXFLATNOTEBOOK to class declarations.


Bcc 5.5 is another thing ... :(

It really does not like contructs like :

wxPen pen = wxPen(m_nStyle & wxFNB_VC71 ? wxColour(247, 243, 233) : wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT))

Such contructs have to be changed to

wxPen pen = wxPen( ( m_nStyle & wxFNB_VC71 ? wxColour(247, 243, 233) : wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT) ) )

Note extra parenthaises around the expression :(

Any chances those small modifications could be incorporated into
future version of wxFlatBook ?

--

Gotenks
wugo
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Mar 13, 2006 8:05 am

Post by wugo »

Oops ! I forgot bakefiles :)

wxFlatNotebook.bkl :

------------------------------
<?xml version="1.0" ?>
<!-- $Id: wxFlatNotebook.bkl,v 1.1 2004/08/03 11:18:10 VZ Exp $ -->

<makefile>

<set var="WX_DISABLE_PRECOMP_HEADERS">1</set>
<include file="../../../build/bakefiles/common_contrib.bkl"/>

<set var="WXFLATNOTEBOOK_SRC">
wxFlatNotebook.cpp
</set>

<headers template="wx_contrib_headers">
<files>
wx/wxFlatNotebook/wxFlatNotebook.h
</files>
</headers>

<dll id="wxFlatNotebookdll" template="wx_contrib_dll" cond="SHARED=='1'">
<define>WXUSINGDLL</define>
<define>WXMAKINGDLL_WXFLATNOTEBOOK</define>
<sources>$(WXFLATNOTEBOOK_SRC)</sources>
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
</dll>

<lib id="wxFlatNotebooklib" template="wx_contrib_lib" cond="SHARED=='0'">
<sources>$(WXFLATNOTEBOOK_SRC)</sources>
</lib>

<set var="MSVC6PRJ_MERGED_TARGETS" append="1">wxFlatNotebook=wxFlatNotebooklib+wxFlatNotebookdll</set>

</makefile>
------------------------------


wxFlatNotebookTest.bkl :

------------------------------
<?xml version="1.0" ?>
<makefile>

<set var="WX_DISABLE_PRECOMP_HEADERS">1</set>
<include file="../../../build/bakefiles/common_samples.bkl"/>
<include file="../../../build/bakefiles/common_contrib.bkl"/>

<exe id="wxFlatNoteBookTest" template="wx_contrib_sample" template_append="wx_append">
<sources>
App.cpp
Frame.cpp
resources.cpp
</sources>
<contrib-lib>wxFlatNotebook</contrib-lib>
<wx-lib>core</wx-lib>
<wx-lib>base</wx-lib>
</exe>

<wx-data id="data">
<files>
App.cpp
Frame.cpp
resources.cpp
</files>
</wx-data>

</makefile>
------------------------------
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Post by eranif »

Hi,
3. add

-----------
#ifdef WXMAKINGDLL_WXFLATNOTEBOOK
#define WXDLLIMPEXP_WXFLATNOTEBOOK WXEXPORT
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) WXEXPORT type
#elif defined(WXUSINGDLL)
#define WXDLLIMPEXP_WXFLATNOTEBOOK WXIMPORT
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) WXIMPORT type
#else // not making nor using DLL
#define WXDLLIMPEXP_WXFLATNOTEBOOK
#define WXDLLIMPEXP_DATA_WXFLATNOTEBOOK(type) type
#endif
-----------
These already included in CVS head - I added them for the DLL build


to wxFlatNotebook.h

4. add WXDLLIMPEXP_WXFLATNOTEBOOK to class declarations.
Same as before this is already included in CVS head.
Also the name is WXDLLIMPEXP_FNB
1. change : BEGIN_EVENT_TABLE(wxPageContainerBase, wxControl)
to : BEGIN_EVENT_TABLE(wxPageContainerBase, wxPanel),
Done
2. replace all std:min(..) with if(...),
Done, I changed all std::min (2 in total) to my own macro

Code: Select all

#define FNB_MIN(a, b) ((a > b) ? b : a)
Such contructs have to be changed to

wxPen pen = wxPen( ( m_nStyle & wxFNB_VC71 ? wxColour(247, 243, 233) : wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT) ) )
Since I dont use bcc, it is hard for me to fix this - since there are other such constructions in the code that I cant tell if it will compile or not under bcc.

To avoid the iteration of such process (I will fix, you test, report if it ok, I will fix more etc) - I will appreciate if you could provide me a file with the fixes, and I will merge it to CVS

Note that the changes that I have made are not part of 1.3 but as CVS head - so in order to get them you need to perform CVS update

Eran

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
wugo
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Mar 13, 2006 8:05 am

Post by wugo »

>Since I dont use bcc, it is hard for me to fix this - since there are other
>such constructions in the code that I cant tell if it will compile or not
>under bcc.

>To avoid the iteration of such process (I will fix, you test, report if it ok,
>I will fix more etc) - I will appreciate if you could provide me a file with
>the fixes, and I will merge it to CVS

>Note that the changes that I have made are not part of 1.3 but as CVS
>head - so in order to get them you need to perform CVS update

Ok, I'll try to update the sources from CVS and will post a
fixed version of wxFlatNotebook for Bcc in a next few days :)

--

Gotenks
Post Reply