projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated samples/html/widget to avoid confusion
[wxWidgets.git]
/
src
/
generic
/
notebook.cpp
diff --git
a/src/generic/notebook.cpp
b/src/generic/notebook.cpp
index 439675439919cbe4003ec9e0c30e507ef9d59518..5cb54f9c67cf4179267703dfd363146f32fd4968 100644
(file)
--- a/
src/generic/notebook.cpp
+++ b/
src/generic/notebook.cpp
@@
-73,7
+73,6
@@
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
void wxNotebook::Init()
{
m_tabView = (wxNotebookTabView*) NULL;
void wxNotebook::Init()
{
m_tabView = (wxNotebookTabView*) NULL;
- m_pImageList = NULL;
m_nSelection = -1;
}
m_nSelection = -1;
}
@@
-113,7
+112,7
@@
bool wxNotebook::Create(wxWindow *parent,
if (!wxWindow::Create(parent, id, pos, size, style|wxNO_BORDER, name))
return FALSE;
if (!wxWindow::Create(parent, id, pos, size, style|wxNO_BORDER, name))
return FALSE;
- SetBackgroundColour(wxSystemSettings::Get
System
Colour(wxSYS_COLOUR_3DFACE));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
SetTabView(new wxNotebookTabView(this));
SetTabView(new wxNotebookTabView(this));
@@
-129,11
+128,6
@@
wxNotebook::~wxNotebook()
// ----------------------------------------------------------------------------
// wxNotebook accessors
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxNotebook accessors
// ----------------------------------------------------------------------------
-int wxNotebook::GetPageCount() const
-{
- return m_aPages.Count();
-}
-
int wxNotebook::GetRowCount() const
{
// TODO
int wxNotebook::GetRowCount() const
{
// TODO
@@
-158,6
+152,7
@@
int wxNotebook::SetSelection(int nPage)
return 0;
}
return 0;
}
+#if 0
void wxNotebook::AdvanceSelection(bool bForward)
{
int nSel = GetSelection();
void wxNotebook::AdvanceSelection(bool bForward)
{
int nSel = GetSelection();
@@
-167,6
+162,7
@@
void wxNotebook::AdvanceSelection(bool bForward)
else
SetSelection(nSel == 0 ? nMax : nSel - 1);
}
else
SetSelection(nSel == 0 ? nMax : nSel - 1);
}
+#endif
bool wxNotebook::SetPageText(int nPage, const wxString& strText)
{
bool wxNotebook::SetPageText(int nPage, const wxString& strText)
{
@@
-218,9
+214,21
@@
bool wxNotebook::SetPageImage(int nPage, int nImage)
return FALSE;
}
return FALSE;
}
-void wxNotebook::SetImageList(wxImageList* imageList)
+// set the size (the same for all pages)
+void wxNotebook::SetPageSize(const wxSize& size)
+{
+ // TODO
+}
+
+// set the padding between tabs (in pixels)
+void wxNotebook::SetPadding(const wxSize& padding)
+{
+ // TODO
+}
+
+// set the size of the tabs for wxNB_FIXEDWIDTH controls
+void wxNotebook::SetTabSize(const wxSize& sz)
{
{
- m_pImageList = imageList;
// TODO
}
// TODO
}
@@
-235,8
+243,8
@@
bool wxNotebook::DeletePage(int nPage)
if (m_nSelection != -1)
{
if (m_nSelection != -1)
{
- m_
aP
ages[m_nSelection]->Show(FALSE);
- m_
aP
ages[m_nSelection]->Lower();
+ m_
p
ages[m_nSelection]->Show(FALSE);
+ m_
p
ages[m_nSelection]->Lower();
}
wxNotebookPage* pPage = GetPage(nPage);
}
wxNotebookPage* pPage = GetPage(nPage);
@@
-246,10
+254,10
@@
bool wxNotebook::DeletePage(int nPage)
m_tabView->RemoveTab((int) (long) pPage);
#endif
m_tabView->RemoveTab((int) (long) pPage);
#endif
-
delete m_aPages[nPage]
;
-
m_aPages.Remove(nPage)
;
+
m_pages.Remove(pPage)
;
+
delete pPage
;
- if (m_
aP
ages.GetCount() == 0)
+ if (m_
p
ages.GetCount() == 0)
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, FALSE);
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, FALSE);
@@
-285,8
+293,8
@@
bool wxNotebook::RemovePage(int nPage)
{
wxCHECK( IS_VALID_PAGE(nPage), FALSE );
{
wxCHECK( IS_VALID_PAGE(nPage), FALSE );
- m_
aP
ages[nPage]->Show(FALSE);
- // m_
aP
ages[nPage]->Lower();
+ m_
p
ages[nPage]->Show(FALSE);
+ // m_
p
ages[nPage]->Lower();
wxNotebookPage* pPage = GetPage(nPage);
#if defined (__WIN16__)
wxNotebookPage* pPage = GetPage(nPage);
#if defined (__WIN16__)
@@
-295,9
+303,9
@@
bool wxNotebook::RemovePage(int nPage)
m_tabView->RemoveTab((int) (long) pPage);
#endif
m_tabView->RemoveTab((int) (long) pPage);
#endif
- m_
aPages.Remove(n
Page);
+ m_
pages.Remove(p
Page);
- if (m_
aP
ages.GetCount() == 0)
+ if (m_
p
ages.GetCount() == 0)
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, TRUE);
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, TRUE);
@@
-342,7
+350,7
@@
int wxNotebook::FindPagePosition(wxNotebookPage* page) const
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
- if (m_
aP
ages[nPage] == page)
+ if (m_
p
ages[nPage] == page)
return nPage;
return -1;
}
return nPage;
return -1;
}
@@
-355,22
+363,13
@@
bool wxNotebook::DeleteAllPages()
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
- delete m_
aP
ages[nPage];
+ delete m_
p
ages[nPage];
- m_
aP
ages.Clear();
+ m_
p
ages.Clear();
return TRUE;
}
return TRUE;
}
-// add a page to the notebook
-bool wxNotebook::AddPage(wxNotebookPage *pPage,
- const wxString& strText,
- bool bSelect,
- int imageId)
-{
- return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
-}
-
// same as AddPage() but does it at given position
bool wxNotebook::InsertPage(int nPage,
wxNotebookPage *pPage,
// same as AddPage() but does it at given position
bool wxNotebook::InsertPage(int nPage,
wxNotebookPage *pPage,
@@
-391,7
+390,7
@@
bool wxNotebook::InsertPage(int nPage,
pPage->Show(FALSE);
// save the pointer to the page
pPage->Show(FALSE);
// save the pointer to the page
- m_
aP
ages.Insert(pPage, nPage);
+ m_
p
ages.Insert(pPage, nPage);
if (bSelect)
{
if (bSelect)
{
@@
-500,9
+499,9
@@
bool wxNotebook::RefreshLayout(bool force)
// fit the notebook page to the tab control's display area
// fit the notebook page to the tab control's display area
- unsigned int nCount = m_
aP
ages.Count();
+ unsigned int nCount = m_
p
ages.Count();
for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
- wxNotebookPage *pPage = m_
aP
ages[nPage];
+ wxNotebookPage *pPage = m_
p
ages[nPage];
if (pPage->IsShown())
{
wxRect clientRect = GetAvailableClientSize();
if (pPage->IsShown())
{
wxRect clientRect = GetAvailableClientSize();
@@
-533,7
+532,7
@@
void wxNotebook::OnSetFocus(wxFocusEvent& event)
{
// set focus to the currently selected page if any
if ( m_nSelection != -1 )
{
// set focus to the currently selected page if any
if ( m_nSelection != -1 )
- m_
aP
ages[m_nSelection]->SetFocus();
+ m_
p
ages[m_nSelection]->SetFocus();
event.Skip();
}
event.Skip();
}
@@
-586,11
+585,11
@@
void wxNotebook::ChangePage(int nOldSel, int nSel)
wxASSERT( nOldSel != nSel ); // impossible
if ( nOldSel != -1 ) {
wxASSERT( nOldSel != nSel ); // impossible
if ( nOldSel != -1 ) {
- m_
aP
ages[nOldSel]->Show(FALSE);
- m_
aP
ages[nOldSel]->Lower();
+ m_
p
ages[nOldSel]->Show(FALSE);
+ m_
p
ages[nOldSel]->Lower();
}
}
- wxNotebookPage *pPage = m_
aP
ages[nSel];
+ wxNotebookPage *pPage = m_
p
ages[nSel];
wxRect clientRect = GetAvailableClientSize();
pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height);
wxRect clientRect = GetAvailableClientSize();
pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height);