]> 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 c32447bfa775e8c9f4987fe6c2c265d244add3b1..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;
 }
@@ -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
   {