wxNB_HITTEST_* flags renamed to wxBK_HITTEST_* to serve all book controls.
authorWłodzimierz Skiba <abx@abx.art.pl>
Wed, 5 Jul 2006 12:21:13 +0000 (12:21 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Wed, 5 Jul 2006 12:21:13 +0000 (12:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
docs/changes.txt
docs/latex/wx/notebook.tex
include/wx/bookctrl.h
include/wx/notebook.h
samples/notebook/notebook.cpp
src/generic/listbkg.cpp
src/generic/toolbkg.cpp
src/generic/treebkg.cpp
src/gtk/notebook.cpp
src/gtk1/notebook.cpp
src/mac/carbon/notebmac.cpp
src/msw/notebook.cpp
src/univ/notebook.cpp

index 518391a689f1081e806228a1c5a547307bdd4641..a06114daedff292e059f612bac036a16b4384ff9 100644 (file)
@@ -158,6 +158,7 @@ All (GUI):
 - Added support for tabs in wxRichTextCtrl (Ashish More).
 - Fixed problem with zoom setting in print preview.
 - Moved wxRichTextCtrl from the advanced library to its own.
+- wxNB_HITTEST_* flags renamed to wxBK_HITTEST_* to serve all book controls.
 
 wxMSW:
 
index b7ca1197328e77c9826191c48a4d4f760b467e55..5b382764547ed0493a61d0f1530c2fe1506d7a3e 100644 (file)
@@ -46,7 +46,7 @@ See also \helpref{window styles overview}{windowstyles}.
 On Windows XP, the default theme paints a gradient on the notebook's pages.
 If you wish to suppress this theme, for aesthetic or performance reasons,
 there are three ways of doing it. You can use wxNB\_NOPAGETHEME to disable
-themed drawing for a particular notebook, you can call {\tt wxSystemOptions::SetOption} 
+themed drawing for a particular notebook, you can call {\tt wxSystemOptions::SetOption}
 to disable it for the whole application, or you can disable it for individual
 pages by using {\tt SetBackgroundColour}.
 
@@ -283,11 +283,11 @@ inside the tab is returned as well.
 \docparam{flags}{Return value for detailed information. One of the following values:
 \twocolwidtha{7cm}
 \begin{twocollist}\itemsep=0pt
-\twocolitem{{\bf wxNB\_HITTEST\_NOWHERE}}{There was no tab under this point.}
-\twocolitem{{\bf wxNB\_HITTEST\_ONICON}}{The point was over an icon (currently wxMSW only).}
-\twocolitem{{\bf wxNB\_HITTEST\_ONLABEL}}{The point was over a label (currently wxMSW only).}
-\twocolitem{{\bf wxNB\_HITTEST\_ONITEM}}{The point was over an item, but not on the label or icon.}
-\twocolitem{{\bf wxNB\_HITTEST\_ONPAGE}}{The point was over a currently selected page, not over any tab. Note that this flag is present only if {\tt wxNOT\_FOUND} is returned.}
+\twocolitem{{\bf wxBK\_HITTEST\_NOWHERE}}{There was no tab under this point.}
+\twocolitem{{\bf wxBK\_HITTEST\_ONICON}}{The point was over an icon (currently wxMSW only).}
+\twocolitem{{\bf wxBK\_HITTEST\_ONLABEL}}{The point was over a label (currently wxMSW only).}
+\twocolitem{{\bf wxBK\_HITTEST\_ONITEM}}{The point was over an item, but not on the label or icon.}
+\twocolitem{{\bf wxBK\_HITTEST\_ONPAGE}}{The point was over a currently selected page, not over any tab. Note that this flag is present only if {\tt wxNOT\_FOUND} is returned.}
 \end{twocollist}
 }
 
index 4cea68ba31230c34f62e8833596c8277466017e6..50b6dcdf13fda9bc67442df7b8de0777e1273687 100644 (file)
@@ -27,6 +27,20 @@ WX_DEFINE_EXPORTED_ARRAY_PTR(wxWindow *, wxArrayPages);
 
 class WXDLLEXPORT wxImageList;
 
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// wxBookCtrl hit results
+enum
+{
+    wxBK_HITTEST_NOWHERE = 1,   // not on tab
+    wxBK_HITTEST_ONICON  = 2,   // on icon
+    wxBK_HITTEST_ONLABEL = 4,   // on label
+    wxBK_HITTEST_ONITEM  = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL,
+    wxBK_HITTEST_ONPAGE  = 8    // not on tab control, but over the selected page
+};
+
 // ----------------------------------------------------------------------------
 // wxBookCtrlBase
 // ----------------------------------------------------------------------------
index bb36c49302cbb2c76e13f289a8ec83f09a812d95..88551e2f235d77c87b0e943979b540859fdf728f 100644 (file)
 // constants
 // ----------------------------------------------------------------------------
 
-// wxNotebook hit results
+#if WXWIN_COMPATIBILITY_2_6
+
+// wxNotebook hit results, use wxBK_HITTEST so other book controls can share them
+// if wxUSE_NOTEBOOK is disabled
 enum
 {
-    wxNB_HITTEST_NOWHERE = 1,   // not on tab
-    wxNB_HITTEST_ONICON  = 2,   // on icon
-    wxNB_HITTEST_ONLABEL = 4,   // on label
-    wxNB_HITTEST_ONITEM  = wxNB_HITTEST_ONICON | wxNB_HITTEST_ONLABEL,
-    wxNB_HITTEST_ONPAGE  = 8    // not on tab control, but over the selected page
+    wxNB_HITTEST_NOWHERE = wxBK_HITTEST_NOWHERE,
+    wxNB_HITTEST_ONICON  = wxBK_HITTEST_ONICON,
+    wxNB_HITTEST_ONLABEL = wxBK_HITTEST_ONLABEL,
+    wxNB_HITTEST_ONITEM  = wxBK_HITTEST_ONITEM,
+    wxNB_HITTEST_ONPAGE  = wxBK_HITTEST_ONPAGE
 };
 
+#endif // WXWIN_COMPATIBILITY_2_6
+
 typedef wxWindow wxNotebookPage;  // so far, any window can be a page
 
 extern WXDLLEXPORT_DATA(const wxChar) wxNotebookNameStr[];
index 6adfd7ef7c6dea25bc75b802321ce1e093bba583..4149cd884a6ef085027e13acf8ac31f24bcf4514 100644 (file)
@@ -584,10 +584,10 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event))
 
     wxString flagsStr;
 
-    AddFlagStrIfFlagPresent( flagsStr, flags, wxNB_HITTEST_NOWHERE, _T("wxNB_HITTEST_NOWHERE") );
-    AddFlagStrIfFlagPresent( flagsStr, flags, wxNB_HITTEST_ONICON,  _T("wxNB_HITTEST_ONICON") );
-    AddFlagStrIfFlagPresent( flagsStr, flags, wxNB_HITTEST_ONLABEL, _T("wxNB_HITTEST_ONLABEL") );
-    AddFlagStrIfFlagPresent( flagsStr, flags, wxNB_HITTEST_ONPAGE,  _T("wxNB_HITTEST_ONPAGE") );
+    AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, _T("wxBK_HITTEST_NOWHERE") );
+    AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON,  _T("wxBK_HITTEST_ONICON") );
+    AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, _T("wxBK_HITTEST_ONLABEL") );
+    AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE,  _T("wxBK_HITTEST_ONPAGE") );
 
     wxLogMessage(wxT("HitTest at (%d,%d): %d: %s"),
                  pt.x,
index c29bf85131cac42b2efa072b3ad0068bf5c80fba..67059a7197843378ab5854a0b3f3982008b1905c 100644 (file)
@@ -166,7 +166,7 @@ int wxListbook::HitTest(const wxPoint& pt, long *flags) const
     int pagePos = wxNOT_FOUND;
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
 
     // convert from listbook control coordinates to list control coordinates
     const wxListView * const list = GetListView();
@@ -185,16 +185,16 @@ int wxListbook::HitTest(const wxPoint& pt, long *flags) const
 
             if ( flagsList & (wxLIST_HITTEST_ONITEMICON |
                               wxLIST_HITTEST_ONITEMSTATEICON ) )
-                *flags |= wxNB_HITTEST_ONICON;
+                *flags |= wxBK_HITTEST_ONICON;
 
             if ( flagsList & wxLIST_HITTEST_ONITEMLABEL )
-                *flags |= wxNB_HITTEST_ONLABEL;
+                *flags |= wxBK_HITTEST_ONLABEL;
         }
     }
     else // not over list control at all
     {
         if ( flags && GetPageRect().Inside(pt) )
-            *flags |= wxNB_HITTEST_ONPAGE;
+            *flags |= wxBK_HITTEST_ONPAGE;
     }
 
     return pagePos;
index 0822ab0ae89d157fc23640c68bc58554d583ed54..0ae9b0b607c1f26ec5340c32a85e83eb66b19d63 100644 (file)
@@ -95,7 +95,7 @@ bool wxToolbook::Create(wxWindow *parent,
         orient = wxTB_VERTICAL;
 
     // TODO: make more configurable
-    
+
 #if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON
     if (style & wxBK_BUTTONBAR)
     {
@@ -314,7 +314,7 @@ int wxToolbook::HitTest(const wxPoint& pt, long *flags) const
     int pagePos = wxNOT_FOUND;
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
 
     // convert from wxToolbook coordinates to wxToolBar ones
     const wxToolBarBase * const tbar = GetToolBar();
@@ -330,13 +330,13 @@ int wxToolbook::HitTest(const wxPoint& pt, long *flags) const
         {
             pagePos = tbar->GetToolPos(tool->GetId());
             if ( flags )
-                *flags = wxNB_HITTEST_ONICON | wxNB_HITTEST_ONLABEL;
+                *flags = wxBK_HITTEST_ONICON | wxBK_HITTEST_ONLABEL;
         }
     }
     else // not over the toolbar
     {
         if ( flags && GetPageRect().Inside(pt) )
-            *flags |= wxNB_HITTEST_ONPAGE;
+            *flags |= wxBK_HITTEST_ONPAGE;
     }
 
     return pagePos;
index fcf10b9d351c8bc4d1dd1954e4330891f9fb123b..b93e0b3d89bacbf4a990e20ddc5f4b13c0c9499c 100644 (file)
@@ -728,7 +728,7 @@ int wxTreebook::HitTest(wxPoint const & pt, long * flags) const
     int pagePos = wxNOT_FOUND;
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
 
     // convert from wxTreebook coorindates to wxTreeCtrl ones
     const wxTreeCtrl * const tree = GetTreeCtrl();
@@ -753,16 +753,16 @@ int wxTreebook::HitTest(wxPoint const & pt, long * flags) const
             if ( flagsTree & (wxTREE_HITTEST_ONITEMBUTTON |
                               wxTREE_HITTEST_ONITEMICON |
                               wxTREE_HITTEST_ONITEMSTATEICON) )
-                *flags |= wxNB_HITTEST_ONICON;
+                *flags |= wxBK_HITTEST_ONICON;
 
             if ( flagsTree & wxTREE_HITTEST_ONITEMLABEL )
-                *flags |= wxNB_HITTEST_ONLABEL;
+                *flags |= wxBK_HITTEST_ONLABEL;
         }
     }
     else // not over the tree
     {
         if ( flags && GetPageRect().Inside( pt ) )
-            *flags |= wxNB_HITTEST_ONPAGE;
+            *flags |= wxBK_HITTEST_ONPAGE;
     }
 
     return pagePos;
index 25efc437f89210899e493431d50624581219fa53..b8dfb49c813dd01d987b9d490fb6abce11c08a5c 100644 (file)
@@ -778,15 +778,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 
                 if ( pixmap && IsPointInsideWidget(pt, pixmap, x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONICON;
+                    *flags = wxBK_HITTEST_ONICON;
                 }
                 else if ( IsPointInsideWidget(pt, GTK_WIDGET(nb_page->m_label), x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONLABEL;
+                    *flags = wxBK_HITTEST_ONLABEL;
                 }
                 else
                 {
-                    *flags = wxNB_HITTEST_ONITEM;
+                    *flags = wxBK_HITTEST_ONITEM;
                 }
             }
 
@@ -796,7 +796,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 
     if ( flags )
     {
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
         wxWindowBase * page = GetCurrentPage();
         if ( page )
         {
@@ -808,7 +808,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
             rect.x -= pos.x;
             rect.y -= pos.y;
             if ( rect.Inside( pt ) )
-                *flags |= wxNB_HITTEST_ONPAGE;
+                *flags |= wxBK_HITTEST_ONPAGE;
         }
     }
 
index 4f08d0c1d55846e0fa14cbc6e3b761f4fd9e1257..ffa2e2a428bf8a16929db78aed1438a7af6ab6d4 100644 (file)
@@ -780,15 +780,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 
                 if ( pixmap && IsPointInsideWidget(pt, pixmap, x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONICON;
+                    *flags = wxBK_HITTEST_ONICON;
                 }
                 else if ( IsPointInsideWidget(pt, GTK_WIDGET(nb_page->m_label), x, y) )
                 {
-                    *flags = wxNB_HITTEST_ONLABEL;
+                    *flags = wxBK_HITTEST_ONLABEL;
                 }
                 else
                 {
-                    *flags = wxNB_HITTEST_ONITEM;
+                    *flags = wxBK_HITTEST_ONITEM;
                 }
             }
 
@@ -797,7 +797,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
     }
 
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
 
     return wxNOT_FOUND;
 }
index 3764fd37cecbf256f87093945c3c7b14202e7df7..414bc978f95366947ab30371d039c703e670ad7e 100644 (file)
@@ -376,9 +376,9 @@ int wxNotebook::HitTest(const wxPoint& pt, long * flags) const
 
         // we cannot differentiate better
         if (resultV >= 0)
-            *flags |= wxNB_HITTEST_ONLABEL;
+            *flags |= wxBK_HITTEST_ONLABEL;
         else
-            *flags |= wxNB_HITTEST_NOWHERE;
+            *flags |= wxBK_HITTEST_NOWHERE;
     }
 
     return resultV;
index 97e0049061ff26dfe4cf8863bf24f849c6e2f8f3..a7fcdfa20261e770a221b02a2c705c6563b3bd76 100644 (file)
@@ -814,15 +814,15 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
         *flags = 0;
 
         if ((hitTestInfo.flags & TCHT_NOWHERE) == TCHT_NOWHERE)
-            *flags |= wxNB_HITTEST_NOWHERE;
+            *flags |= wxBK_HITTEST_NOWHERE;
         if ((hitTestInfo.flags & TCHT_ONITEM) == TCHT_ONITEM)
-            *flags |= wxNB_HITTEST_ONITEM;
+            *flags |= wxBK_HITTEST_ONITEM;
         if ((hitTestInfo.flags & TCHT_ONITEMICON) == TCHT_ONITEMICON)
-            *flags |= wxNB_HITTEST_ONICON;
+            *flags |= wxBK_HITTEST_ONICON;
         if ((hitTestInfo.flags & TCHT_ONITEMLABEL) == TCHT_ONITEMLABEL)
-            *flags |= wxNB_HITTEST_ONLABEL;
+            *flags |= wxBK_HITTEST_ONLABEL;
         if ( item == wxNOT_FOUND && GetPageSize().Inside(pt) )
-            *flags |= wxNB_HITTEST_ONPAGE;
+            *flags |= wxBK_HITTEST_ONPAGE;
     }
 
     return item;
index 407dc958ae3aee1c60cfaeefb4d53f8d4bc9094c..4fe59855e84baf2c955379e05b470ad49bff901d 100644 (file)
@@ -585,7 +585,7 @@ void wxNotebook::DoDraw(wxControlRenderer *renderer)
 int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
 {
     if ( flags )
-        *flags = wxNB_HITTEST_NOWHERE;
+        *flags = wxBK_HITTEST_NOWHERE;
 
     // first check that it is in this window at all
     if ( !GetClientRect().Inside(pt) )
@@ -631,7 +631,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
             if ( flags )
             {
                 // TODO: be more precise
-                *flags = wxNB_HITTEST_ONITEM;
+                *flags = wxBK_HITTEST_ONITEM;
             }
 
             return n;