]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
Removed TABs that had gotten in to the source
[wxWidgets.git] / src / generic / notebook.cpp
index e33702a3d58ca94912afd616fea9d4dcaa765d3f..439675439919cbe4003ec9e0c30e507ef9d59518 100644 (file)
 #pragma hdrstop
 #endif
 
-#include  <wx/string.h>
-#include  <wx/log.h>
-#include  <wx/settings.h>
-#include  <wx/generic/imaglist.h>
-#include  <wx/generic/notebook.h>
-#include  <wx/dcclient.h>
+#include  "wx/string.h"
+#include  "wx/log.h"
+#include  "wx/settings.h"
+#include  "wx/generic/imaglist.h"
+#include  "wx/notebook.h"
+#include  "wx/dcclient.h"
 
 // ----------------------------------------------------------------------------
 // macros
@@ -45,7 +45,9 @@
 // event table
 // ----------------------------------------------------------------------------
 
-#if !USE_SHARED_LIBRARIES
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
+
 BEGIN_EVENT_TABLE(wxNotebook, wxControl)
     EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
     EVT_SIZE(wxNotebook::OnSize)
@@ -58,7 +60,6 @@ END_EVENT_TABLE()
 
 IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
-#endif
 
 // ============================================================================
 // implementation
@@ -218,7 +219,7 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
 }
 
 void wxNotebook::SetImageList(wxImageList* imageList)
-{ 
+{
     m_pImageList = imageList;
     // TODO
 }
@@ -476,10 +477,10 @@ bool wxNotebook::RefreshLayout(bool force)
         rect.y = tabHeight + 4;
         rect.width = cw - 8;
         rect.height = ch - 4 - rect.y ;
-  
+
         m_tabView->SetViewRect(rect);
 
-        m_tabView->Layout();
+        m_tabView->LayoutTabs();
 
         // Need to do it a 2nd time to get the tab height with
         // the new view width, since changing the view width changes the
@@ -489,10 +490,10 @@ bool wxNotebook::RefreshLayout(bool force)
         rect.y = tabHeight + 4;
         rect.width = cw - 8;
         rect.height = ch - 4 - rect.y ;
-  
+
         m_tabView->SetViewRect(rect);
 
-        m_tabView->Layout();
+        m_tabView->LayoutTabs();
 
         if (!force && (rect == oldRect))
           return FALSE;
@@ -569,7 +570,7 @@ bool wxNotebook::DoPhase(int /* nPhase */)
     return TRUE;
 }
 
-void wxNotebook::Command(wxCommandEvent& event)
+void wxNotebook::Command(wxCommandEvent& WXUNUSED(event))
 {
     wxFAIL_MSG("wxNotebook::Command not implemented");
 }
@@ -594,12 +595,12 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
     wxRect clientRect = GetAvailableClientSize();
     pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height);
 
+    Refresh();
+
     pPage->Show(TRUE);
     pPage->Raise();
     pPage->SetFocus();
 
-    Refresh();
-
     m_nSelection = nSel;
 }
 
@@ -636,7 +637,7 @@ wxRect wxNotebook::GetAvailableClientSize()
 /*
  * wxNotebookTabView
  */
+
 IMPLEMENT_CLASS(wxNotebookTabView, wxTabView)
 
 wxNotebookTabView::wxNotebookTabView(wxNotebook *notebook, long style): wxTabView(style)
@@ -658,12 +659,7 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   if (!m_notebook)
     return;
 
-// Because of name truncation!
-#if defined(__BORLANDC__) && defined(__WIN16__)
-  wxNotebookEvent event(wxEVT_COMMAND_NB_PAGE_CHANGED, m_notebook->GetId());
-#else
   wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
-#endif
 
 #if defined (__WIN16__)
   int activatePos = activateId;