]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/notebook.cpp
compilation fixes for wxMSW
[wxWidgets.git] / src / msw / notebook.cpp
index e5ff7ec7f44fb630f556a0ef1adebd192a568a91..d6c5fc5234928a1857e22c93b29aa1ab0cb03071 100644 (file)
@@ -68,8 +68,7 @@
   BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
 
-    // doesn't work yet EVT_WINDOW_CREATE(wxNotebook::OnWindowCreate)
-    EVT_SIZE(wxNotebook::OnWindowCreate)
+    EVT_SIZE(wxNotebook::OnSize)
 
     EVT_SET_FOCUS(wxNotebook::OnSetFocus)
 
@@ -186,7 +185,7 @@ int wxNotebook::GetRowCount() const
 
 int wxNotebook::SetSelection(int nPage)
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") );
 
   ChangePage(m_nSelection, nPage);
 
@@ -205,20 +204,20 @@ void wxNotebook::AdvanceSelection(bool bForward)
 
 bool wxNotebook::SetPageText(int nPage, const wxString& strText)
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
 
   TC_ITEM tcItem;
   tcItem.mask = TCIF_TEXT;
-  tcItem.pszText = (char *)strText.c_str();
+  tcItem.pszText = (wxChar *)strText.c_str();
 
   return TabCtrl_SetItem(m_hwnd, nPage, &tcItem) != 0;
 }
 
 wxString wxNotebook::GetPageText(int nPage) const
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), "", "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), _T(""), _T("notebook page out of range") );
 
-  char buf[256];
+  wxChar buf[256];
   TC_ITEM tcItem;
   tcItem.mask = TCIF_TEXT;
   tcItem.pszText = buf;
@@ -233,7 +232,7 @@ wxString wxNotebook::GetPageText(int nPage) const
 
 int wxNotebook::GetPageImage(int nPage) const
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") );
 
   TC_ITEM tcItem;
   tcItem.mask = TCIF_IMAGE;
@@ -243,7 +242,7 @@ int wxNotebook::GetPageImage(int nPage) const
 
 bool wxNotebook::SetPageImage(int nPage, int nImage)
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
 
   TC_ITEM tcItem;
   tcItem.mask = TCIF_IMAGE;
@@ -273,7 +272,7 @@ void wxNotebook::SetTabSize(const wxSize& sz)
 // remove one page from the notebook
 bool wxNotebook::DeletePage(int nPage)
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
 
   TabCtrl_DeleteItem(m_hwnd, nPage);
 
@@ -286,7 +285,7 @@ bool wxNotebook::DeletePage(int nPage)
 // remove one page from the notebook, without deleting
 bool wxNotebook::RemovePage(int nPage)
 {
-  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, "notebook page out of range" );
+  wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
 
   TabCtrl_DeleteItem(m_hwnd, nPage);
 
@@ -344,13 +343,13 @@ bool wxNotebook::InsertPage(int nPage,
   if (!strText.IsEmpty())
   {
     tcItem.mask    |= TCIF_TEXT;
-    tcItem.pszText = (char *)strText.c_str();
+    tcItem.pszText = (wxChar *)strText.c_str();
   }
   else
-    tcItem.pszText = (char *) NULL;
+    tcItem.pszText = (wxChar *) NULL;
 
   if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 ) {
-    wxLogError("Can't create the notebook page '%s'.", strText.c_str());
+    wxLogError(_T("Can't create the notebook page '%s'."), strText.c_str());
     return FALSE;
   }
 
@@ -378,7 +377,7 @@ bool wxNotebook::InsertPage(int nPage,
 // wxNotebook callbacks
 // ----------------------------------------------------------------------------
 
-void wxNotebook::OnWindowCreate(wxWindowCreateEvent& event)
+void wxNotebook::OnSize(wxSizeEvent& event)
 {
   // make sure the current page is shown and has focus (it's useful because all
   // pages are created invisible initially)