]> git.saurik.com Git - wxWidgets.git/blob - src/common/nbkbase.cpp
A little clarification
[wxWidgets.git] / src / common / nbkbase.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/nbkbase.cpp
3 // Purpose: common wxNotebook methods
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 02.07.01
7 // RCS-ID: $Id$
8 // Copyright: (c) 2001 Vadim Zeitlin
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "notebookbase.h"
22 #endif
23
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
26
27 #ifdef __BORLANDC__
28 #pragma hdrstop
29 #endif
30
31 #if wxUSE_NOTEBOOK
32
33 #ifndef WX_PRECOMP
34 #endif //WX_PRECOMP
35
36 #include "wx/notebook.h"
37
38 // ============================================================================
39 // implementation
40 // ============================================================================
41
42 wxNotebookBase::wxNotebookBase()
43 {
44 }
45
46 wxNotebookBase::wxNotebookBase(wxWindow *parent,
47 wxWindowID id,
48 const wxPoint& pos,
49 const wxSize& size,
50 long style,
51 const wxString& name)
52 : wxBookCtrl(parent, id, pos, size, style, name)
53 {
54 }
55
56 // ----------------------------------------------------------------------------
57 // geometry
58 // ----------------------------------------------------------------------------
59
60 wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
61 {
62 // this is, of course, totally bogus -- but we must do something by
63 // default because not all ports implement this
64 wxSize sizeTotal = sizePage;
65
66 if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
67 {
68 sizeTotal.x += 90;
69 sizeTotal.y += 10;
70 }
71 else // tabs on top/bottom side
72 {
73 sizeTotal.x += 10;
74 sizeTotal.y += 40;
75 }
76
77 return sizeTotal;
78 }
79
80 #endif // wxUSE_NOTEBOOK
81