]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menuitem.cpp
fix null-pointer crash
[wxWidgets.git] / src / msw / menuitem.cpp
index e2063200cda27f53052f5cd679104a2221debc95..e4a9d1beb90e7e780156978fd013249bdabd1541 100644 (file)
@@ -170,9 +170,13 @@ void wxMenuItem::Init()
 
     #undef  SYS_COLOR
 
-    // we don't want normal items be owner-drawn
+    // setting default colors switched ownerdraw on: switch it off again
     ResetOwnerDrawn();
 
+    //  switch ownerdraw back on if using a non default margin
+    if ( GetId() != wxID_SEPARATOR )
+        SetMarginWidth(GetMarginWidth());
+
     // tell the owner drawing code to to show the accel string as well
     SetAccelString(m_text.AfterFirst(_T('\t')));
 #endif // wxUSE_OWNER_DRAWN