]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/resource.cpp
Improved selection mode handling in wxGrid::SelectBlock
[wxWidgets.git] / src / common / resource.cpp
index 19ffdaef1bb55c8bc69e95d8ebc4df38324d8d10..27305db69a31288fbba2413d823b94238d90b495 100644 (file)
@@ -337,7 +337,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
           }
           if (bitmap.Ok())
            control = new wxBitmapButton(parent, id, bitmap, pos, size,
-               childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
+               childResource->GetStyle() | wxBU_AUTODRAW, wxDefaultValidator, childResource->GetName());
         }
         else
           // Normal, text button
@@ -537,7 +537,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
   else
   {
     if (control && childResource->GetFont().Ok())
+    {
       control->SetFont(childResource->GetFont());
+
+#ifdef __WXMSW__
+      // Force the layout algorithm since the size changes the layout
+      if (control->IsKindOf(CLASSINFO(wxRadioBox)))
+      {
+        control->SetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT);
+      }
+#endif
+    }
   }
   return control;
 }
@@ -908,11 +918,11 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
 
       if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
      {
-        // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-       // Do nothing - no label font any more
-      count ++;
-        if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-          controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+       // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+       // Skip past the obsolete label font spec if there are two consecutive specs
+       if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+         count ++;
+       controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
      }
    }
   }
@@ -962,12 +972,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
 
         if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
         {
-         // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-        // Do nothing
-         count ++;
-
-          if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-            controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+         // Skip past the obsolete label font spec if there are two consecutive specs
+         if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+           count ++;
+         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
        }
      }
    }
@@ -1067,10 +1075,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
       }
       if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
       {
-         // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-         count ++;
-         if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-           controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+         // Skip past the obsolete label font spec if there are two consecutive specs
+         if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+           count ++;
+         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
       }
    }
   }
@@ -1093,11 +1101,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
 
       if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
      {
-        // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-      count ++;
-
-        if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-          controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+         // Skip past the obsolete label font spec if there are two consecutive specs
+         if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+           count ++;
+         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
      }
    }
   }
@@ -1129,11 +1136,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
 
         if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
        {
-          // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-        count ++;
-
-          if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-            controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+         // Skip past the obsolete label font spec if there are two consecutive specs
+         if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+           count ++;
+         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
        }
      }
    }
@@ -1167,11 +1173,10 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr)
 
       if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
      {
-        // controlItem->SetLabelFont(wxResourceInterpretFontSpec(expr->Nth(count)));
-      count ++;
-
-        if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
-          controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
+         // Skip past the obsolete label font spec if there are two consecutive specs
+         if (expr->Nth(count+1) && expr->Nth(count+1)->Type() == PrologList)
+           count ++;
+         controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
      }
    }
   }
@@ -2472,7 +2477,9 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
         return wxBitmap(name, bitmapType);
       }
     }
-    return wxNullBitmap;
+#ifndef __WXGTK__
+     return wxNullBitmap;
+#endif
   }
   else
   {