Add missing wxUSE_TOOLTIPS and wxUSE_UXTHEME checks to wxMSW.

Allow compiling wxStatusBar without tooltips and theme support.

Closes #13846.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70310 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-01-10 17:01:09 +00:00
parent f52f37959d
commit 864c08b2ed
2 changed files with 10 additions and 0 deletions

View File

@@ -76,8 +76,10 @@ protected:
// used by DoUpdateStatusText() // used by DoUpdateStatusText()
wxClientDC *m_pDC; wxClientDC *m_pDC;
#if wxUSE_TOOLTIPS
// the tooltips used when wxSTB_SHOW_TIPS is given // the tooltips used when wxSTB_SHOW_TIPS is given
wxVector<wxToolTip*> m_tooltips; wxVector<wxToolTip*> m_tooltips;
#endif
private: private:
struct MSWBorders struct MSWBorders

View File

@@ -153,11 +153,13 @@ wxStatusBar::~wxStatusBar()
// occupy // occupy
PostSizeEventToParent(); PostSizeEventToParent();
#if wxUSE_TOOLTIPS
// delete existing tooltips // delete existing tooltips
for (size_t i=0; i<m_tooltips.size(); i++) for (size_t i=0; i<m_tooltips.size(); i++)
{ {
wxDELETE(m_tooltips[i]); wxDELETE(m_tooltips[i]);
} }
#endif // wxUSE_TOOLTIPS
wxDELETE(m_pDC); wxDELETE(m_pDC);
} }
@@ -178,6 +180,7 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths)
// keep in synch also our m_tooltips array // keep in synch also our m_tooltips array
#if wxUSE_TOOLTIPS
// reset all current tooltips // reset all current tooltips
for (size_t i=0; i<m_tooltips.size(); i++) for (size_t i=0; i<m_tooltips.size(); i++)
{ {
@@ -186,6 +189,7 @@ void wxStatusBar::SetFieldsCount(int nFields, const int *widths)
// shrink/expand the array: // shrink/expand the array:
m_tooltips.resize(nFields, NULL); m_tooltips.resize(nFields, NULL);
#endif // wxUSE_TOOLTIPS
wxStatusBarBase::SetFieldsCount(nFields, widths); wxStatusBarBase::SetFieldsCount(nFields, widths);
@@ -318,6 +322,7 @@ void wxStatusBar::DoUpdateStatusText(int nField)
wxLogLastError("StatusBar_SetText"); wxLogLastError("StatusBar_SetText");
} }
#if wxUSE_TOOLTIPS
if (HasFlag(wxSTB_SHOW_TIPS)) if (HasFlag(wxSTB_SHOW_TIPS))
{ {
wxASSERT(m_tooltips.size() == m_panes.GetCount()); wxASSERT(m_tooltips.size() == m_panes.GetCount());
@@ -346,6 +351,7 @@ void wxStatusBar::DoUpdateStatusText(int nField)
//else: leave m_tooltips[nField]==NULL //else: leave m_tooltips[nField]==NULL
} }
} }
#endif // wxUSE_TOOLTIPS
} }
wxStatusBar::MSWBorders wxStatusBar::MSWGetBorders() const wxStatusBar::MSWBorders wxStatusBar::MSWGetBorders() const
@@ -388,12 +394,14 @@ const wxStatusBar::MSWMetrics& wxStatusBar::MSWGetMetrics()
// into account to make sure the text drawn by user fits inside the // into account to make sure the text drawn by user fits inside the
// pane. Notice that it's not the value returned by SB_GETBORDERS // pane. Notice that it's not the value returned by SB_GETBORDERS
// which, at least on this Windows 2003 system, returns {0, 2, 2} // which, at least on this Windows 2003 system, returns {0, 2, 2}
#if wxUSE_UXTHEME
if ( wxUxThemeEngine::GetIfActive() ) if ( wxUxThemeEngine::GetIfActive() )
{ {
s_metrics.gripWidth = 20; s_metrics.gripWidth = 20;
s_metrics.textMargin = 8; s_metrics.textMargin = 8;
} }
else // classic/unthemed look else // classic/unthemed look
#endif // wxUSE_UXTHEME
{ {
s_metrics.gripWidth = 18; s_metrics.gripWidth = 18;
s_metrics.textMargin = 4; s_metrics.textMargin = 4;