projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove some controls from limited screen area of Smartphone.
[wxWidgets.git]
/
src
/
univ
/
notebook.cpp
diff --git
a/src/univ/notebook.cpp
b/src/univ/notebook.cpp
index 408034a35e25c69e02986f00841e9fc9769385fd..c97f7189b8a06f9403bcacf328f704cf83cae201 100644
(file)
--- a/
src/univ/notebook.cpp
+++ b/
src/univ/notebook.cpp
@@
-21,6
+21,10
@@
#pragma implementation "univnotebook.h"
#endif
#pragma implementation "univnotebook.h"
#endif
+#ifdef __VMS
+#pragma message disable unscomzer
+#endif
+
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#include "wx/wxprec.h"
#ifdef __BORLANDC__
@@
-40,7
+44,12
@@
// macros
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
+#if 0
+// due to unsigned type nPage is always >= 0
#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((size_t(nPage)) < GetPageCount()))
#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((size_t(nPage)) < GetPageCount()))
+#else
+#define IS_VALID_PAGE(nPage) (((size_t)nPage) < GetPageCount())
+#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// constants
@@
-59,7
+68,7
@@
class wxNotebookSpinBtn : public wxSpinButton
{
public:
wxNotebookSpinBtn(wxNotebook *nb)
{
public:
wxNotebookSpinBtn(wxNotebook *nb)
- : wxSpinButton(nb,
-1
,
+ : wxSpinButton(nb,
wxID_ANY
,
wxDefaultPosition, wxDefaultSize,
nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL)
{
wxDefaultPosition, wxDefaultSize,
nb->IsVertical() ? wxSP_VERTICAL : wxSP_HORIZONTAL)
{
@@
-79,7
+88,7
@@
private:
};
BEGIN_EVENT_TABLE(wxNotebookSpinBtn, wxSpinButton)
};
BEGIN_EVENT_TABLE(wxNotebookSpinBtn, wxSpinButton)
- EVT_SPIN(
-1
, wxNotebookSpinBtn::OnSpin)
+ EVT_SPIN(
wxID_ANY
, wxNotebookSpinBtn::OnSpin)
END_EVENT_TABLE()
// ============================================================================
END_EVENT_TABLE()
// ============================================================================
@@
-118,7
+127,7
@@
bool wxNotebook::Create(wxWindow *parent,
{
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
{
if ( !wxControl::Create(parent, id, pos, size, style,
wxDefaultValidator, name) )
- return
FALSE
;
+ return
false
;
m_sizePad = GetRenderer()->GetTabPadding();
m_sizePad = GetRenderer()->GetTabPadding();
@@
-126,7
+135,7
@@
bool wxNotebook::Create(wxWindow *parent,
CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
CreateInputHandler(wxINP_HANDLER_NOTEBOOK);
- return
TRUE
;
+ return
true
;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-142,7
+151,7
@@
wxString wxNotebook::GetPageText(size_t nPage) const
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
{
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage),
FALSE
, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage),
false
, _T("invalid notebook page") );
if ( strText != m_titles[nPage] )
{
if ( strText != m_titles[nPage] )
{
@@
-160,7
+169,7
@@
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
}
}
}
}
- return
TRUE
;
+ return
true
;
}
int wxNotebook::GetPageImage(size_t nPage) const
}
int wxNotebook::GetPageImage(size_t nPage) const
@@
-172,9
+181,9
@@
int wxNotebook::GetPageImage(size_t nPage) const
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage),
FALSE
, _T("invalid notebook page") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage),
false
, _T("invalid notebook page") );
- wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(),
FALSE
,
+ wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(),
false
,
_T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
_T("invalid image index in SetPageImage()") );
if ( nImage != m_images[nPage] )
@@
-191,7
+200,7
@@
bool wxNotebook::SetPageImage(size_t nPage, int nImage)
RefreshTab(nPage);
}
RefreshTab(nPage);
}
- return
TRUE
;
+ return
true
;
}
wxNotebook::~wxNotebook()
}
wxNotebook::~wxNotebook()
@@
-233,7
+242,7
@@
int wxNotebook::SetSelection(size_t nPage)
if ( selOld != INVALID_PAGE )
{
if ( selOld != INVALID_PAGE )
{
- RefreshTab(selOld,
TRUE
/* this tab was selected */);
+ RefreshTab(selOld,
true
/* this tab was selected */);
m_pages[selOld]->Hide();
}
m_pages[selOld]->Hide();
}
@@
-284,7
+293,7
@@
bool wxNotebook::InsertPage(size_t nPage,
int imageId)
{
size_t nPages = GetPageCount();
int imageId)
{
size_t nPages = GetPageCount();
- wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage),
FALSE
,
+ wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage),
false
,
_T("invalid notebook page in InsertPage()") );
// modify the data
_T("invalid notebook page in InsertPage()") );
// modify the data
@@
-316,7
+325,7
@@
bool wxNotebook::InsertPage(size_t nPage,
if ( nPages == 0 )
{
// always select the first tab to have at least some selection
if ( nPages == 0 )
{
// always select the first tab to have at least some selection
- bSelect =
TRUE
;
+ bSelect =
true
;
Relayout();
Refresh();
Relayout();
Refresh();
@@
-335,13
+344,13
@@
bool wxNotebook::InsertPage(size_t nPage,
pPage->Hide();
}
pPage->Hide();
}
- return
TRUE
;
+ return
true
;
}
bool wxNotebook::DeleteAllPages()
{
if ( !wxNotebookBase::DeleteAllPages() )
}
bool wxNotebook::DeleteAllPages()
{
if ( !wxNotebookBase::DeleteAllPages() )
- return
FALSE
;
+ return
false
;
// clear the other arrays as well
m_titles.Clear();
// clear the other arrays as well
m_titles.Clear();
@@
-357,7
+366,7
@@
bool wxNotebook::DeleteAllPages()
Relayout();
Relayout();
- return
TRUE
;
+ return
true
;
}
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
}
wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
@@
-461,7
+470,7
@@
void wxNotebook::DoDrawTab(wxDC& dc, const wxRect& rect, size_t n)
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
wxMemoryDC dc;
dc.SelectObject(bmp);
dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));
- m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL,
TRUE
);
+ m_imageList->Draw(image, dc, 0, 0, wxIMAGELIST_DRAW_NORMAL,
true
);
dc.SelectObject(wxNullBitmap);
#else
bmp = *m_imageList->GetBitmap(image);
dc.SelectObject(wxNullBitmap);
#else
bmp = *m_imageList->GetBitmap(image);
@@
-736,8
+745,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
{
@@
-824,7
+841,7
@@
void wxNotebook::ResizeTab(int page)
wxSize sizeTab = CalcTabSize(page);
// we only need full relayout if the page size changes
wxSize sizeTab = CalcTabSize(page);
// we only need full relayout if the page size changes
- bool needsRelayout =
FALSE
;
+ bool needsRelayout =
false
;
if ( IsVertical() )
{
if ( IsVertical() )
{
@@
-836,7
+853,7
@@
void wxNotebook::ResizeTab(int page)
if ( sizeTab.y > m_heightTab )
{
if ( sizeTab.y > m_heightTab )
{
- needsRelayout =
TRUE
;
+ needsRelayout =
true
;
m_heightTab = sizeTab.y;
}
m_heightTab = sizeTab.y;
}
@@
-1062,7
+1079,7
@@
void wxNotebook::UpdateSpinBtn()
{
// this case is special, get rid of it immediately: everything is
// visible and we don't need any spin buttons
{
// this case is special, get rid of it immediately: everything is
// visible and we don't need any spin buttons
- allTabsShown =
TRUE
;
+ allTabsShown =
true
;
// have to reset them manually as we don't call CalcLastVisibleTab()
m_firstVisible =
// have to reset them manually as we don't call CalcLastVisibleTab()
m_firstVisible =
@@
-1118,7
+1135,7
@@
void wxNotebook::UpdateSpinBtn()
}
else // all tabs are visible, we don't need spin button
{
}
else // all tabs are visible, we don't need spin button
{
- if ( m_spinbtn )
+ if ( m_spinbtn
&& m_spinbtn -> IsShown()
)
{
m_spinbtn->Hide();
}
{
m_spinbtn->Hide();
}
@@
-1276,9
+1293,9
@@
void wxNotebook::DoSetSize(int x, int y,
wxSize old_client_size = GetClientSize();
wxControl::DoSetSize(x, y, width, height, sizeFlags);
wxSize old_client_size = GetClientSize();
wxControl::DoSetSize(x, y, width, height, sizeFlags);
-
+
wxSize new_client_size = GetClientSize();
wxSize new_client_size = GetClientSize();
-
+
if (old_client_size != new_client_size)
Relayout();
}
if (old_client_size != new_client_size)
Relayout();
}
@@
-1292,15
+1309,15
@@
bool wxNotebook::PerformAction(const wxControlAction& action,
const wxString& strArg)
{
if ( action == wxACTION_NOTEBOOK_NEXT )
const wxString& strArg)
{
if ( action == wxACTION_NOTEBOOK_NEXT )
- SetSelection(GetNextPage(
TRUE
));
+ SetSelection(GetNextPage(
true
));
else if ( action == wxACTION_NOTEBOOK_PREV )
else if ( action == wxACTION_NOTEBOOK_PREV )
- SetSelection(GetNextPage(
FALSE
));
+ SetSelection(GetNextPage(
false
));
else if ( action == wxACTION_NOTEBOOK_GOTO )
SetSelection((int)numArg);
else
return wxControl::PerformAction(action, numArg, strArg);
else if ( action == wxACTION_NOTEBOOK_GOTO )
SetSelection((int)numArg);
else
return wxControl::PerformAction(action, numArg, strArg);
- return
TRUE
;
+ return
true
;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
@@
-1356,7
+1373,7
@@
bool wxStdNotebookInputHandler::HandleKey(wxInputConsumer *consumer,
break;
}
break;
}
- if ( !
!action
)
+ if ( !
action.IsEmpty()
)
{
return consumer->PerformAction(action, page);
}
{
return consumer->PerformAction(action, page);
}
@@
-1376,7
+1393,7
@@
bool wxStdNotebookInputHandler::HandleMouse(wxInputConsumer *consumer,
{
consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page);
{
consumer->PerformAction(wxACTION_NOTEBOOK_GOTO, page);
- return
FALSE
;
+ return
false
;
}
}
}
}
@@
-1395,7
+1412,7
@@
wxStdNotebookInputHandler::HandleFocus(wxInputConsumer *consumer,
{
HandleFocusChange(consumer);
{
HandleFocusChange(consumer);
- return
FALSE
;
+ return
false
;
}
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
}
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
@@
-1404,7
+1421,7
@@
bool wxStdNotebookInputHandler::HandleActivation(wxInputConsumer *consumer,
// we react to the focus change in the same way as to the [de]activation
HandleFocusChange(consumer);
// we react to the focus change in the same way as to the [de]activation
HandleFocusChange(consumer);
- return
FALSE
;
+ return
false
;
}
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)
}
void wxStdNotebookInputHandler::HandleFocusChange(wxInputConsumer *consumer)