]> git.saurik.com Git - wxWidgets.git/blame - src/common/nbkbase.cpp
A little clarification
[wxWidgets.git] / src / common / nbkbase.cpp
CommitLineData
07b8d7ec
VZ
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
14f355c2 20#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
07b8d7ec
VZ
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
07b8d7ec
VZ
34#endif //WX_PRECOMP
35
bd52bee1
JS
36#include "wx/notebook.h"
37
07b8d7ec
VZ
38// ============================================================================
39// implementation
40// ============================================================================
41
1169a919
JS
42wxNotebookBase::wxNotebookBase()
43{
44}
45
46wxNotebookBase::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
07b8d7ec
VZ
56// ----------------------------------------------------------------------------
57// geometry
58// ----------------------------------------------------------------------------
59
2ce7af35 60wxSize wxNotebookBase::CalcSizeFromPage(const wxSize& sizePage) const
07b8d7ec 61{
550e6c01
VZ
62 // this is, of course, totally bogus -- but we must do something by
63 // default because not all ports implement this
07b8d7ec 64 wxSize sizeTotal = sizePage;
550e6c01 65
07b8d7ec 66 if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
eaf336e0 67 {
07b8d7ec 68 sizeTotal.x += 90;
eaf336e0 69 sizeTotal.y += 10;
eaf336e0 70 }
550e6c01 71 else // tabs on top/bottom side
eaf336e0 72 {
eaf336e0 73 sizeTotal.x += 10;
07b8d7ec 74 sizeTotal.y += 40;
eaf336e0 75 }
07b8d7ec
VZ
76
77 return sizeTotal;
78}
79
07b8d7ec
VZ
80#endif // wxUSE_NOTEBOOK
81