]> git.saurik.com Git - wxWidgets.git/commitdiff
paint background by default to avoid unexpected sample appearance
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Apr 2009 14:34:18 +0000 (14:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Apr 2009 14:34:18 +0000 (14:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/image/image.cpp

index 47a2b9d3ae4670927c9ac68cbaec636669dc2a74..fa45e38312c2be353f300edff5ff907ca59593dd 100644 (file)
@@ -143,7 +143,8 @@ public:
         wxMenu *menu = new wxMenu;
         menu->Append(wxID_SAVE);
         menu->AppendSeparator();
-        m_pClearBgMenu = menu->AppendCheckItem(ID_PAINT_BG, _T("&Paint background"));
+        menu->AppendCheckItem(ID_PAINT_BG, _T("&Paint background"),
+                              "Uncheck this for transparent images");
         menu->AppendSeparator();
         menu->Append(ID_RESIZE, _T("&Fit to window\tCtrl-F"));
         menu->AppendSeparator();
@@ -154,6 +155,8 @@ public:
         mbar->Append(menu, _T("&Image"));
         SetMenuBar(mbar);
 
+        mbar->Check(ID_PAINT_BG, true);
+
         CreateStatusBar(2);
         if ( numImages != 1 )
             SetStatusText(wxString::Format("%d images", numImages), 1);
@@ -176,7 +179,7 @@ public:
     {
         wxPaintDC dc(this);
 
-        if (m_pClearBgMenu->IsChecked())
+        if ( GetMenuBar()->IsChecked(ID_PAINT_BG) )
             ClearBackground();
 
         const wxSize size = GetClientSize();
@@ -390,7 +393,6 @@ private:
     }
 
     wxBitmap m_bitmap;
-    wxMenuItem* m_pClearBgMenu;
 
     DECLARE_EVENT_TABLE()
 };