]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/dialoged/src/winprop.cpp
Added $(OVERRIDEFLAGS) to the end of the flags so default flags can be overridden.
[wxWidgets.git] / utils / dialoged / src / winprop.cpp
index 6b485e5a6979ab185bfd7a0410c6251c33100227..00b91eee7aa930aeadabde445aacc307d247b403 100644 (file)
@@ -286,7 +286,7 @@ wxProperty *wxWindowPropertyInfo::GetProperty(wxString& name)
 {
   wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(m_propertyWindow);
 
-  wxFont *font = m_propertyWindow->GetFont();
+  wxFont *font = m_propertyWindow->GetFont();
   if (name == "fontPoints" || name == "fontFamily" || name == "fontStyle" || name == "fontWeight" ||
       name == "fontUnderlined")
     return GetFontProperty(name, font);
@@ -308,7 +308,7 @@ wxProperty *wxWindowPropertyInfo::GetProperty(wxString& name)
   }
   else if (name == "height")
   {
-    return new wxProperty("width", (long)resource->GetHeight(), "integer");
+    return new wxProperty("height", (long)resource->GetHeight(), "integer");
   }
   else if (name == "id")
   {
@@ -353,12 +353,12 @@ wxProperty *wxWindowPropertyInfo::GetProperty(wxString& name)
 
 bool wxWindowPropertyInfo::SetProperty(wxString& name, wxProperty *property)
 {
-  wxFont *font = m_propertyWindow->GetFont();
+  wxFont *font = m_propertyWindow->GetFont();
   if (font && (name == "fontPoints" || name == "fontFamily" || name == "fontStyle" || name == "fontWeight" || name == "fontUnderlined" ))
   {
     wxFont *newFont = SetFontProperty(name, property, font);
     if (newFont)
-      m_propertyWindow->SetFont(newFont);
+      m_propertyWindow->SetFont(newFont);
     return TRUE;
   }
   else if (name == "name")
@@ -721,7 +721,7 @@ void wxWindowPropertyInfo::SetWindowStyle(wxWindow* win, long style, bool set)
 wxProperty *wxItemPropertyInfo::GetProperty(wxString& name)
 {
   wxControl *itemWindow = (wxControl *)m_propertyWindow; 
-  wxFont *font = itemWindow->GetFont();
+  wxFont *font = itemWindow->GetFont();
 
   if (name == "fontPoints" || name == "fontFamily" || name == "fontStyle" || name == "fontWeight" ||
       name == "fontUnderlined")
@@ -735,13 +735,13 @@ wxProperty *wxItemPropertyInfo::GetProperty(wxString& name)
 bool wxItemPropertyInfo::SetProperty(wxString& name, wxProperty *property)
 {
   wxControl *itemWindow = (wxControl *)m_propertyWindow; 
-  wxFont *font = itemWindow->GetFont();
+  wxFont *font = itemWindow->GetFont();
 
   if (font && (name == "fontPoints" || name == "fontFamily" || name == "fontStyle" || name == "fontWeight" || name == "fontUnderlined" ))
   {
     wxFont *newFont = SetFontProperty(name, property, font);
     if (newFont)
-      itemWindow->SetLabelFont(newFont);
+      itemWindow->SetLabelFont(newFont);
     return TRUE;
   }
   else if (name == "label")
@@ -771,10 +771,10 @@ bool wxItemPropertyInfo::InstantiateResource(wxItemResource *resource)
   wxControl *item = (wxControl *)m_propertyWindow;
   wxString str(item->GetLabel());
   resource->SetTitle(str);
-  if (item->GetFont() && item->GetFont()->Ok())
-    resource->SetFont(wxTheFontList->FindOrCreateFont(item->GetFont()->GetPointSize(),
-               item->GetFont()->GetFamily(), item->GetFont()->GetStyle(), item->GetFont()->GetWeight(),
-               item->GetFont()->GetUnderlined(), item->GetFont()->GetFaceName()));
+  if (item->GetFont().Ok())
+    resource->SetFont(* wxTheFontList->FindOrCreateFont(item->GetFont().GetPointSize(),
+               item->GetFont().GetFamily(), item->GetFont().GetStyle(), item->GetFont().GetWeight(),
+               item->GetFont().GetUnderlined(), item->GetFont().GetFaceName()));
   return TRUE;
 }
 
@@ -810,7 +810,7 @@ bool wxButtonPropertyInfo::InstantiateResource(wxItemResource *resource)
 wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name)
 {
   wxBitmapButton *button = (wxBitmapButton *)m_propertyWindow;
-  if (name == "label")
+  if (name == "bitmapFilename")
   {
     wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(button);
     wxString str("none.bmp");
@@ -819,7 +819,7 @@ wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name)
     {
       str = wxResourceManager::GetCurrentResourceManager()->FindBitmapFilenameForResource(resource);
     }
-    return new wxProperty("label", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp"));
+    return new wxProperty("bitmapFilename", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp"));
   }
   else
     return wxButtonPropertyInfo::GetProperty(name);
@@ -828,7 +828,7 @@ wxProperty *wxBitmapButtonPropertyInfo::GetProperty(wxString& name)
 bool wxBitmapButtonPropertyInfo::SetProperty(wxString& name, wxProperty *property)
 {
   wxBitmapButton *button = (wxBitmapButton *)m_propertyWindow;
-  if (name == "label")
+  if (name == "bitmapFilename")
   {
     char *s = property->GetValue().StringValue();
     if (s && wxFileExists(s))
@@ -854,7 +854,7 @@ bool wxBitmapButtonPropertyInfo::SetProperty(wxString& name, wxProperty *propert
             wxResourceManager::GetCurrentResourceManager()->PossiblyDeleteBitmapResource(oldResource);
         }
 
-        button->SetLabel(bitmap);
+        button->SetLabel(bitmap);
         delete[] s;
         return TRUE;
       }
@@ -867,8 +867,9 @@ bool wxBitmapButtonPropertyInfo::SetProperty(wxString& name, wxProperty *propert
 
 void wxBitmapButtonPropertyInfo::GetPropertyNames(wxStringList& names)
 {
-//  names.Add("label");
   wxButtonPropertyInfo::GetPropertyNames(names);
+  names.Delete("label");
+  names.Add("bitmapFilename");
 }
 
 bool wxBitmapButtonPropertyInfo::InstantiateResource(wxItemResource *resource)
@@ -908,7 +909,7 @@ bool wxStaticTextPropertyInfo::InstantiateResource(wxItemResource *resource)
 wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name)
 {
   wxStaticBitmap *message = (wxStaticBitmap *)m_propertyWindow;
-  if (name == "label")
+  if (name == "bitmapFilename")
   {
     wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(message);
     wxString str("none.bmp");
@@ -917,7 +918,7 @@ wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name)
     {
       str = wxResourceManager::GetCurrentResourceManager()->FindBitmapFilenameForResource(resource);
     }
-    return new wxProperty("label", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp"));
+    return new wxProperty("bitmapFilename", str.GetData(), "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp"));
   }
   else
     return wxItemPropertyInfo::GetProperty(name);
@@ -926,7 +927,7 @@ wxProperty *wxStaticBitmapPropertyInfo::GetProperty(wxString& name)
 bool wxStaticBitmapPropertyInfo::SetProperty(wxString& name, wxProperty *property)
 {
   wxStaticBitmap *message = (wxStaticBitmap *)m_propertyWindow;
-  if (name == "label")
+  if (name == "bitmapFilename")
   {
     char *s = property->GetValue().StringValue();
     if (s && wxFileExists(s))
@@ -953,7 +954,7 @@ bool wxStaticBitmapPropertyInfo::SetProperty(wxString& name, wxProperty *propert
             wxResourceManager::GetCurrentResourceManager()->PossiblyDeleteBitmapResource(oldResource);
         }
 
-        message->SetBitmap(bitmap);
+        message->SetBitmap(bitmap);
         delete[] s;
         return TRUE;
       }
@@ -967,7 +968,7 @@ bool wxStaticBitmapPropertyInfo::SetProperty(wxString& name, wxProperty *propert
 void wxStaticBitmapPropertyInfo::GetPropertyNames(wxStringList& names)
 {
   wxItemPropertyInfo::GetPropertyNames(names);
-  names.Add("label");
+  names.Add("bitmapFilename");
 }
 
 bool wxStaticBitmapPropertyInfo::InstantiateResource(wxItemResource *resource)
@@ -1370,13 +1371,13 @@ wxProperty *wxRadioBoxPropertyInfo::GetProperty(wxString& name)
   if (name == "orientation")
   {
     wxString orient;
-    if (m_propertyWindow->GetWindowStyleFlag() & wxRA_HORIZONTAL)
-      orient = "wxRA_HORIZONTAL";
+    if (m_propertyWindow->GetWindowStyleFlag() & wxRA_SPECIFY_COLS)
+      orient = "wxRA_SPECIFY_COLS";
     else
-      orient = "wxRA_VERTICAL";
+      orient = "wxRA_SPECIFY_ROWS";
 
     return new wxProperty("orientation", orient, "string",
-       new wxStringListValidator(new wxStringList("wxRA_HORIZONTAL", "wxRA_VERTICAL",
+       new wxStringListValidator(new wxStringList("wxRA_SPECIFY_COLS", "wxRA_SPECIFY_ROWS",
           NULL)));
   }
   else if (name == "values")
@@ -1404,17 +1405,17 @@ bool wxRadioBoxPropertyInfo::SetProperty(wxString& name, wxProperty *property)
   {
     long windowStyle = radioBox->GetWindowStyleFlag();
     wxString val(property->GetValue().StringValue());
-    if (val == "wxRA_HORIZONTAL")
+    if (val == "wxRA_SPECIFY_COLS")
     {
-      if (windowStyle & wxRA_VERTICAL)
-        windowStyle -= wxRA_VERTICAL;
-      windowStyle |= wxRA_HORIZONTAL;
+      if (windowStyle & wxRA_SPECIFY_ROWS)
+        windowStyle -= wxRA_SPECIFY_ROWS;
+      windowStyle |= wxRA_SPECIFY_COLS;
     }
     else
     {
-      if (windowStyle & wxRA_HORIZONTAL)
-        windowStyle -= wxRA_HORIZONTAL;
-      windowStyle |= wxRA_VERTICAL;
+      if (windowStyle & wxRA_SPECIFY_COLS)
+        windowStyle -= wxRA_SPECIFY_COLS;
+      windowStyle |= wxRA_SPECIFY_ROWS;
     }
     radioBox->SetWindowStyleFlag(windowStyle);
     wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(radioBox);
@@ -1875,6 +1876,8 @@ bool wxScrollBarPropertyInfo::InstantiateResource(wxItemResource *resource)
 wxProperty *wxPanelPropertyInfo::GetProperty(wxString& name)
 {
   wxPanel *panelWindow = (wxPanel *)m_propertyWindow; 
+
+/*
   wxFont *labelFont = panelWindow->GetLabelFont();
   wxFont *buttonFont = panelWindow->GetButtonFont();
   
@@ -1884,7 +1887,9 @@ wxProperty *wxPanelPropertyInfo::GetProperty(wxString& name)
   else if (name == "buttonFontPoints" || name == "buttonFontFamily" || name == "buttonFontStyle" || name == "buttonFontWeight" ||
       name == "buttonFontUnderlined")
     return GetFontProperty(name, buttonFont);
-  else if (name == "no3D")
+*/
+
+  if (name == "no3D")
   {
     bool userColours;
     if (panelWindow->GetWindowStyleFlag() & wxNO_3D)
@@ -1946,24 +1951,27 @@ wxProperty *wxPanelPropertyInfo::GetProperty(wxString& name)
 bool wxPanelPropertyInfo::SetProperty(wxString& name, wxProperty *property)
 {
   wxPanel *panelWindow = (wxPanel *)m_propertyWindow; 
+/*
   wxFont *labelFont = panelWindow->GetLabelFont();
   wxFont *buttonFont = panelWindow->GetButtonFont();
-  
+
   if (labelFont && (name == "labelFontPoints" || name == "labelFontFamily" || name == "labelFontStyle" || name == "labelFontWeight" || name == "labelFontUnderlined" ))
   {
     wxFont *newFont = SetFontProperty(name, property, labelFont);
     if (newFont)
-      panelWindow->SetLabelFont(newFont);
+      panelWindow->SetLabelFont(newFont);
     return TRUE;
   }
   else if (buttonFont && (name == "buttonFontPoints" || name == "buttonFontFamily" || name == "buttonFontStyle" || name == "buttonFontWeight" || name == "buttonFontUnderlined" ))
   {
     wxFont *newFont = SetFontProperty(name, property, buttonFont);
     if (newFont)
-      panelWindow->SetButtonFont(newFont);
+      panelWindow->SetButtonFont(newFont);
     return TRUE;
   }
-  else if (name == "no3D")
+*/
+
+  if (name == "no3D")
   {
     bool userColours = property->GetValue().BoolValue();
     
@@ -2096,10 +2104,10 @@ void wxPanelPropertyInfo::GetPropertyNames(wxStringList& names)
 bool wxPanelPropertyInfo::InstantiateResource(wxItemResource *resource)
 {
   wxPanel *panel = (wxPanel *)m_propertyWindow;
-  if (panel->GetFont() && panel->GetFont()->Ok())
-    resource->SetFont(wxTheFontList->FindOrCreateFont(panel->GetFont()->GetPointSize(),
-               panel->GetFont()->GetFamily(), panel->GetFont()->GetStyle(), panel->GetFont()->GetWeight(),
-               panel->GetFont()->GetUnderlined(), panel->GetFont()->GetFaceName()));
+  if (panel->GetFont().Ok())
+    resource->SetFont(* wxTheFontList->FindOrCreateFont(panel->GetFont().GetPointSize(),
+               panel->GetFont().GetFamily(), panel->GetFont().GetStyle(), panel->GetFont().GetWeight(),
+               panel->GetFont().GetUnderlined(), panel->GetFont().GetFaceName()));
 
   resource->SetBackgroundColour(wxColour(panel->GetBackgroundColour()));
 
@@ -2125,7 +2133,7 @@ void wxPanelPropertyInfo::ConvertDialogUnits(bool toDialogUnits)
     }
     resource->SetSize(pt.x, pt.y, sz.x, sz.y);
 
-    wxNode* node = m_propertyWindow->GetChildren()->First();
+    wxNode* node = m_propertyWindow->GetChildren().First();
     while (node)
     {
         wxWindow* child = (wxWindow*) node->Data();