]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/infobar.cpp
Use CFSocket instead of CFFileDescriptor in wxCFEventLoopSource.
[wxWidgets.git] / src / generic / infobar.cpp
index 242242c1745baa5697a640bab60ffa309f0de07c..31f0d0ed7fed2bf715fafa44ff7b5c855d8ac22b 100644 (file)
 #endif // WX_PRECOMP
 
 #include "wx/artprov.h"
-#include "wx/renderer.h"
 #include "wx/scopeguard.h"
 
 BEGIN_EVENT_TABLE(wxInfoBarGeneric, wxInfoBarBase)
     EVT_BUTTON(wxID_ANY, wxInfoBarGeneric::OnButton)
 END_EVENT_TABLE()
 
-// ----------------------------------------------------------------------------
-// local helpers
-// ----------------------------------------------------------------------------
-
-namespace
-{
-
-#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
-
-wxBitmap
-GetCloseButtonBitmap(wxWindow *win,
-                     const wxSize& size,
-                     const wxColour& colBg,
-                     int flags = 0)
-{
-    wxBitmap bmp(size);
-    wxMemoryDC dc(bmp);
-    dc.SetBackground(colBg);
-    dc.Clear();
-    wxRendererNative::Get().
-        DrawTitleBarBitmap(win, dc, size, wxTITLEBAR_BUTTON_CLOSE, flags);
-    return bmp;
-}
-
-#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
-
-} // anonymous namespace
-
 // ============================================================================
 // implementation
 // ============================================================================
@@ -111,31 +82,7 @@ bool wxInfoBarGeneric::Create(wxWindow *parent, wxWindowID winid)
 
     m_text = new wxStaticText(this, wxID_ANY, "");
 
-#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
-    const wxSize sizeBmp = wxArtProvider::GetSizeHint(wxART_BUTTON);
-    wxBitmap bmp = GetCloseButtonBitmap(this, sizeBmp, colBg);
-#else // !wxHAS_DRAW_TITLE_BAR_BITMAP
-    wxBitmap bmp = wxArtProvider::GetBitmap(wxART_CLOSE, wxART_BUTTON);
-#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
-    m_button = new wxBitmapButton
-                   (
-                    this,
-                    wxID_ANY,
-                    bmp,
-                    wxDefaultPosition,
-                    wxDefaultSize,
-                    wxBORDER_NONE
-                   );
-
-#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
-    m_button->SetBitmapPressed(
-        GetCloseButtonBitmap(this, sizeBmp, colBg, wxCONTROL_PRESSED));
-
-    m_button->SetBitmapCurrent(
-        GetCloseButtonBitmap(this, sizeBmp, colBg, wxCONTROL_CURRENT));
-#endif // wxHAS_DRAW_TITLE_BAR_BITMAP
-
-    m_button->SetBackgroundColour(colBg);
+    m_button = wxBitmapButton::NewCloseButton(this, wxID_ANY);
     m_button->SetToolTip(_("Hide this notification message."));
 
     // center the text inside the sizer with an icon to the left of it and a
@@ -229,7 +176,7 @@ wxShowEffect wxInfoBarGeneric::GetHideEffect() const
 
 void wxInfoBarGeneric::UpdateParent()
 {
-    wxWindow * const parent = wxGetTopLevelParent(GetParent());
+    wxWindow * const parent = GetParent();
     parent->Layout();
 }