projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Widen the hash key for win64
[wxWidgets.git]
/
src
/
os2
/
notebook.cpp
diff --git
a/src/os2/notebook.cpp
b/src/os2/notebook.cpp
index ff60f14a897643832f1c314547d28c0bf1583d4f..89f0f9d6fd3513bf532393a4ffbefc5b8db48587 100644
(file)
--- a/
src/os2/notebook.cpp
+++ b/
src/os2/notebook.cpp
@@
-35,7
+35,11
@@
// ----------------------------------------------------------------------------
// check that the page index is valid
// ----------------------------------------------------------------------------
// check that the page index is valid
-#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
+#define IS_VALID_PAGE(nPage) ( \
+ /* size_t is _always_ >= 0 */ \
+ /* ((nPage) >= 0) && */ \
+ ((nPage) < GetPageCount()) \
+ )
// hide the ugly cast
#define m_hWnd (HWND)GetHWND()
// hide the ugly cast
#define m_hWnd (HWND)GetHWND()
@@
-112,14
+116,12
@@
wxNotebook::wxNotebook(
//
// Create() function
//
//
// Create() function
//
-bool wxNotebook::Create(
- wxWindow* pParent
-, wxWindowID vId
-, const wxPoint& rPos
-, const wxSize& rSize
-, long lStyle
-, const wxString& rsName
-)
+bool wxNotebook::Create( wxWindow* pParent,
+ wxWindowID vId,
+ const wxPoint& rPos,
+ const wxSize& rSize,
+ long lStyle,
+ const wxString& rsName )
{
//
// Base init
{
//
// Base init
@@
-132,21
+134,21
@@
bool wxNotebook::Create(
,wxDefaultValidator
,rsName
))
,wxDefaultValidator
,rsName
))
- return
FALSE
;
+ return
false
;
//
// Notebook, so explicitly specify 0 as last parameter
//
//
// Notebook, so explicitly specify 0 as last parameter
//
- if (!OS2CreateControl(
"NOTEBOOK"
- ,
_T("")
+ if (!OS2CreateControl(
wxT("NOTEBOOK")
+ ,
wxEmptyString
,rPos
,rSize
,lStyle | wxTAB_TRAVERSAL
))
,rPos
,rSize
,lStyle | wxTAB_TRAVERSAL
))
- return
FALSE
;
+ return
false
;
SetBackgroundColour(wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
SetBackgroundColour(wxColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
- return
TRUE
;
+ return
true
;
} // end of wxNotebook::Create
WXDWORD wxNotebook::OS2GetStyle (
} // end of wxNotebook::Create
WXDWORD wxNotebook::OS2GetStyle (
@@
-205,9
+207,7
@@
int wxNotebook::GetRowCount() const
);
} // end of wxNotebook::GetRowCount
);
} // end of wxNotebook::GetRowCount
-int wxNotebook::SetSelection(
- size_t nPage
-)
+int wxNotebook::SetSelection( size_t nPage )
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
@@
-240,10
+240,8
@@
int wxNotebook::SetSelection(
return nPage;
} // end of wxNotebook::SetSelection
return nPage;
} // end of wxNotebook::SetSelection
-bool wxNotebook::SetPageText(
- size_t nPage
-, const wxString& rsStrText
-)
+bool wxNotebook::SetPageText( size_t nPage,
+ const wxString& rsStrText )
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
return (bool)::WinSendMsg( m_hWnd
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") );
return (bool)::WinSendMsg( m_hWnd
@@
-253,9
+251,7
@@
bool wxNotebook::SetPageText(
);
} // end of wxNotebook::SetPageText
);
} // end of wxNotebook::SetPageText
-wxString wxNotebook::GetPageText (
- size_t nPage
-) const
+wxString wxNotebook::GetPageText ( size_t nPage ) const
{
BOOKTEXT vBookText;
wxChar zBuf[256];
{
BOOKTEXT vBookText;
wxChar zBuf[256];
@@
-280,7
+276,7
@@
wxString wxNotebook::GetPageText (
return wxEmptyString;
}
vBookText.textLen = ulRc + 1; // To get the null terminator
return wxEmptyString;
}
vBookText.textLen = ulRc + 1; // To get the null terminator
- vBookText.pString = zBuf;
+ vBookText.pString =
(char*)
zBuf;
//
// Now get the actual text
//
// Now get the actual text
@@
-298,13
+294,11
@@
wxString wxNotebook::GetPageText (
ulRc = 255L;
vBookText.pString[ulRc] = '\0';
ulRc = 255L;
vBookText.pString[ulRc] = '\0';
- sStr = vBookText.pString;
+ sStr =
(wxChar*)
vBookText.pString;
return sStr;
} // end of wxNotebook::GetPageText
return sStr;
} // end of wxNotebook::GetPageText
-int wxNotebook::GetPageImage (
- size_t nPage
-) const
+int wxNotebook::GetPageImage ( size_t nPage ) const
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
{
wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
@@
-319,12
+313,12
@@
bool wxNotebook::SetPageImage (
, int nImage
)
{
, int nImage
)
{
- wxBitmap
* pBitmap = (wxBitmap*
)m_imageList->GetBitmap(nImage);
+ wxBitmap
vBitmap = (wxBitmap
)m_imageList->GetBitmap(nImage);
return (bool)::WinSendMsg( GetHWND()
,BKM_SETTABBITMAP
,MPFROMLONG((ULONG)m_alPageId[nPage])
return (bool)::WinSendMsg( GetHWND()
,BKM_SETTABBITMAP
,MPFROMLONG((ULONG)m_alPageId[nPage])
- ,(MPARAM)
pBitmap->
GetHBITMAP()
+ ,(MPARAM)
vBitmap.
GetHBITMAP()
);
} // end of wxNotebook::SetPageImage
);
} // end of wxNotebook::SetPageImage
@@
-332,10
+326,10
@@
void wxNotebook::SetImageList (
wxImageList* pImageList
)
{
wxImageList* pImageList
)
{
- //
+ //
// Does not really do anything yet, but at least we need to
// update the base class.
// Does not really do anything yet, but at least we need to
// update the base class.
- //
+ //
wxNotebookBase::SetImageList(pImageList);
} // end of wxNotebook::SetImageList
wxNotebookBase::SetImageList(pImageList);
} // end of wxNotebook::SetImageList
@@
-378,11
+372,9
@@
void wxNotebook::SetTabSize (
//
// Remove one page from the notebook, without deleting
//
//
// Remove one page from the notebook, without deleting
//
-wxNotebookPage* wxNotebook::DoRemovePage (
- size_t nPage
-)
+wxNotebookPage* wxNotebook::DoRemovePage ( size_t nPage )
{
{
- wxNotebookPage*
pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
+ wxNotebookPage* pPageRemoved = wxNotebookBase::DoRemovePage(nPage);
if (!pPageRemoved)
return NULL;
if (!pPageRemoved)
return NULL;
@@
-463,7
+455,8
@@
bool wxNotebook::DeleteAllPages()
,(MPARAM)BKA_ALL
);
m_nSelection = -1;
,(MPARAM)BKA_ALL
);
m_nSelection = -1;
- return TRUE;
+
+ return true;
} // end of wxNotebook::DeleteAllPages
//
} // end of wxNotebook::DeleteAllPages
//
@@
-487,13
+480,11
@@
bool wxNotebook::AddPage (
//
// Same as AddPage() but does it at given position
//
//
// Same as AddPage() but does it at given position
//
-bool wxNotebook::InsertPage (
- size_t nPage
-, wxNotebookPage* pPage
-, const wxString& rsStrText
-, bool bSelect
-, int nImageId
-)
+bool wxNotebook::InsertPage ( size_t nPage,
+ wxNotebookPage* pPage,
+ const wxString& rsStrText,
+ bool bSelect,
+ int nImageId )
{
ULONG ulApiPage;
{
ULONG ulApiPage;
@@
-585,9
+576,9
@@
bool wxNotebook::InsertPage (
// Now set TAB dimenstions
//
// Now set TAB dimenstions
//
- wxWindowDC
vDC(this);
- wxCoord
nTextX;
- wxCoord
nTextY;
+ wxWindowDC vDC(this);
+ wxCoord nTextX;
+ wxCoord nTextY;
vDC.GetTextExtent(rsStrText, &nTextX, &nTextY);
nTextY *= 2;
vDC.GetTextExtent(rsStrText, &nTextX, &nTextY);
nTextY *= 2;
@@
-604,7
+595,7
@@
bool wxNotebook::InsertPage (
//
// Now set any TAB text
//
//
// Now set any TAB text
//
- if (!rsStrText.
IsE
mpty())
+ if (!rsStrText.
e
mpty())
{
if (!SetPageText( nPage
,rsStrText
{
if (!SetPageText( nPage
,rsStrText
@@
-845,12
+836,10
@@
bool wxNotebook::DoPhase (
// ----------------------------------------------------------------------------
// wxNotebook Windows message handlers
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxNotebook Windows message handlers
// ----------------------------------------------------------------------------
-bool wxNotebook::OS2OnScroll (
- int nOrientation
-, WXWORD wSBCode
-, WXWORD wPos
-, WXHWND wControl
-)
+bool wxNotebook::OS2OnScroll ( int nOrientation,
+ WXWORD wSBCode,
+ WXWORD wPos,
+ WXHWND wControl )
{
//
// Don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
{
//
// Don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
@@
-866,4
+855,3
@@
bool wxNotebook::OS2OnScroll (
} // end of wxNotebook::OS2OnScroll
#endif // wxUSE_NOTEBOOK
} // end of wxNotebook::OS2OnScroll
#endif // wxUSE_NOTEBOOK
-