- 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:
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}.
\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}
}
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
// ----------------------------------------------------------------------------
// 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[];
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,
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();
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;
orient = wxTB_VERTICAL;
// TODO: make more configurable
-
+
#if defined(__WXMAC__) && wxUSE_TOOLBAR && wxUSE_BMPBUTTON
if (style & wxBK_BUTTONBAR)
{
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();
{
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;
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();
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;
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;
}
}
if ( flags )
{
- *flags = wxNB_HITTEST_NOWHERE;
+ *flags = wxBK_HITTEST_NOWHERE;
wxWindowBase * page = GetCurrentPage();
if ( page )
{
rect.x -= pos.x;
rect.y -= pos.y;
if ( rect.Inside( pt ) )
- *flags |= wxNB_HITTEST_ONPAGE;
+ *flags |= wxBK_HITTEST_ONPAGE;
}
}
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;
}
}
}
if ( flags )
- *flags = wxNB_HITTEST_NOWHERE;
+ *flags = wxBK_HITTEST_NOWHERE;
return wxNOT_FOUND;
}
// 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;
*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;
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) )
if ( flags )
{
// TODO: be more precise
- *flags = wxNB_HITTEST_ONITEM;
+ *flags = wxBK_HITTEST_ONITEM;
}
return n;