]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/notebook.cpp
First cut at socket support in wxX11
[wxWidgets.git] / src / generic / notebook.cpp
index b1c74e6fb62bbc68d2a9c9c19bca586664796ad7..118b9dd1f7760f57c94661bfcf2abdf739355c1d 100644 (file)
@@ -112,7 +112,7 @@ bool wxNotebook::Create(wxWindow *parent,
     if (!wxWindow::Create(parent, id, pos, size, style|wxNO_BORDER, name))
         return FALSE;
 
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
 
     SetTabView(new wxNotebookTabView(this));
 
@@ -214,6 +214,24 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
     return FALSE;
 }
 
+// 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)
+{
+    // TODO
+}
+
 // ----------------------------------------------------------------------------
 // wxNotebook operations
 // ----------------------------------------------------------------------------
@@ -661,4 +679,36 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
   m_notebook->GetEventHandler()->ProcessEvent(event);
 }
 
+// Allows Vetoing
+bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
+{
+  bool retval = TRUE;
+  
+  if (m_notebook)
+  {
+    wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
+
+#if defined (__WIN16__)
+    int activatePos = activateId;
+    int deactivatePos = deactivateId;
+#else
+    // Translate from wxTabView's ids (which aren't position-dependent)
+    // to wxNotebook's (which are).
+    wxNotebookPage* pActive = (wxNotebookPage*) activateId;
+    wxNotebookPage* pDeactive = (wxNotebookPage*) deactivateId;
+
+    int activatePos = m_notebook->FindPagePosition(pActive);
+    int deactivatePos = m_notebook->FindPagePosition(pDeactive);
+
+#endif
+    event.SetEventObject(m_notebook);
+    event.SetSelection(activatePos);
+    event.SetOldSelection(deactivatePos);
+    if (m_notebook->GetEventHandler()->ProcessEvent(event))
+    {
+      retval = event.IsAllowed();
+    }
+  }
+  return retval;
+}