projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing header
[wxWidgets.git]
/
src
/
univ
/
notebook.cpp
diff --git
a/src/univ/notebook.cpp
b/src/univ/notebook.cpp
index 29f728072dc22156a8af5afbbc2d2804e3c30cbe..407dc958ae3aee1c60cfaeefb4d53f8d4bc9094c 100644
(file)
--- a/
src/univ/notebook.cpp
+++ b/
src/univ/notebook.cpp
@@
-1,5
+1,5
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: univ/notebook.cpp
+// Name:
src/
univ/notebook.cpp
// Purpose: wxNotebook implementation
// Author: Vadim Zeitlin
// Modified by:
// Purpose: wxNotebook implementation
// Author: Vadim Zeitlin
// Modified by:
@@
-17,14
+17,6
@@
// headers
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "univnotebook.h"
-#endif
-
-#ifdef __VMS
-#pragma message disable unscomzer
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
@@
-33,10
+25,14
@@
#if wxUSE_NOTEBOOK
#if wxUSE_NOTEBOOK
-#include "wx/imaglist.h"
#include "wx/notebook.h"
#include "wx/notebook.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/dcmemory.h"
+#endif
+
+#include "wx/imaglist.h"
#include "wx/spinbutt.h"
#include "wx/spinbutt.h"
-#include "wx/dcmemory.h"
#include "wx/univ/renderer.h"
#include "wx/univ/renderer.h"
@@
-125,6
+121,9
@@
bool wxNotebook::Create(wxWindow *parent,
long style,
const wxString& name)
{
long style,
const wxString& name)
{
+ if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
+ style |= wxBK_TOP;
+
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
return false;
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
return false;
@@
-144,7
+143,7
@@
bool wxNotebook::Create(wxWindow *parent,
wxString wxNotebook::GetPageText(size_t nPage) const
{
wxString wxNotebook::GetPageText(size_t nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage),
_T("")
, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage),
wxEmptyString
, _T("invalid notebook page") );
return m_titles[nPage];
}
return m_titles[nPage];
}
@@
-174,7
+173,7
@@
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
int wxNotebook::GetPageImage(size_t nPage) const
{
int wxNotebook::GetPageImage(size_t nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage),
-1
, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage),
wxNOT_FOUND
, _T("invalid notebook page") );
return m_images[nPage];
}
return m_images[nPage];
}
@@
-213,7
+212,7
@@
wxNotebook::~wxNotebook()
int wxNotebook::SetSelection(size_t nPage)
{
int wxNotebook::SetSelection(size_t nPage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage),
-1
, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage),
wxNOT_FOUND
, _T("invalid notebook page") );
if ( (size_t)nPage == m_sel )
{
if ( (size_t)nPage == m_sel )
{
@@
-473,7
+472,7
@@
void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n)
m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true);
dc.SelectObject(wxNullBitmap);
#else
m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL, true);
dc.SelectObject(wxNullBitmap);
#else
- bmp =
*
m_imageList->GetBitmap(image);
+ bmp = m_imageList->GetBitmap(image);
#endif
}
#endif
}
@@
-658,14
+657,14
@@
bool wxNotebook::IsVertical() const
wxDirection wxNotebook::GetTabOrientation() const
{
long style = GetWindowStyle();
wxDirection wxNotebook::GetTabOrientation() const
{
long style = GetWindowStyle();
- if ( style & wx
NB
_BOTTOM )
+ if ( style & wx
BK
_BOTTOM )
return wxBOTTOM;
return wxBOTTOM;
- else if ( style & wx
NB
_RIGHT )
+ else if ( style & wx
BK
_RIGHT )
return wxRIGHT;
return wxRIGHT;
- else if ( style & wx
NB
_LEFT )
+ else if ( style & wx
BK
_LEFT )
return wxLEFT;
return wxLEFT;
- // wx
NB
_TOP == 0 so we don't have to test for it
+ // wx
BK
_TOP == 0 so we don't have to test for it
return wxTOP;
}
return wxTOP;
}
@@
-745,8
+744,16
@@
wxRect wxNotebook::GetTabsPart() const
const wxSize indent = GetRenderer()->GetTabIndent();
if ( IsVertical() )
{
const wxSize indent = GetRenderer()->GetTabIndent();
if ( IsVertical() )
{
- rect.x += indent.y;
rect.y += indent.x;
rect.y += indent.x;
+ if ( dir == wxLEFT )
+ {
+ rect.x += indent.y;
+ rect.width -= indent.y;
+ }
+ else // wxRIGHT
+ {
+ rect.width -= indent.y;
+ }
}
else // horz
{
}
else // horz
{
@@
-1245,7
+1252,7
@@
void wxNotebook::ScrollLastTo(int page)
wxSize wxNotebook::DoGetBestClientSize() const
{
// calculate the max page size
wxSize wxNotebook::DoGetBestClientSize() const
{
// calculate the max page size
- wxSize size
(0, 0)
;
+ wxSize size;
size_t count = GetPageCount();
if ( count )
size_t count = GetPageCount();
if ( count )
@@
-1423,4
+1430,3
@@
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)
}
#endif // wxUSE_NOTEBOOK
}
#endif // wxUSE_NOTEBOOK
-