Repaired radiobox problem.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-10-05 10:13:49 +00:00
parent b8d3a4f1a1
commit 8d950bdb57

View File

@@ -117,7 +117,10 @@ wxDialogEditorPropertyListFrame::~wxDialogEditorPropertyListFrame()
bool wxPropertyInfo::Edit(wxWindow *parent, const wxString& title) bool wxPropertyInfo::Edit(wxWindow *parent, const wxString& title)
{ {
if (sm_propertyWindow) if (sm_propertyWindow)
return FALSE; {
sm_propertyWindow->Raise();
return TRUE;
}
int width = wxResourceManager::GetCurrentResourceManager()->GetPropertyWindowSize().width; int width = wxResourceManager::GetCurrentResourceManager()->GetPropertyWindowSize().width;
int height = wxResourceManager::GetCurrentResourceManager()->GetPropertyWindowSize().height; int height = wxResourceManager::GetCurrentResourceManager()->GetPropertyWindowSize().height;
@@ -1269,14 +1272,14 @@ wxProperty *wxRadioBoxPropertyInfo::GetProperty(wxString& name)
} }
if (name == "orientation") if (name == "orientation")
{ {
char *pos = NULL; wxString orient;
if (propertyWindow->GetWindowStyleFlag() & wxHORIZONTAL) if (propertyWindow->GetWindowStyleFlag() & wxRA_HORIZONTAL)
pos = "wxHORIZONTAL"; orient = "wxRA_HORIZONTAL";
else else
pos = "wxVERTICAL"; orient = "wxRA_VERTICAL";
return new wxProperty("orientation", pos, "string", return new wxProperty("orientation", orient, "string",
new wxStringListValidator(new wxStringList("wxHORIZONTAL", "wxVERTICAL", new wxStringListValidator(new wxStringList("wxRA_HORIZONTAL", "wxRA_VERTICAL",
NULL))); NULL)));
} }
else if (name == "values") else if (name == "values")
@@ -1304,19 +1307,21 @@ bool wxRadioBoxPropertyInfo::SetProperty(wxString& name, wxProperty *property)
{ {
long windowStyle = radioBox->GetWindowStyleFlag(); long windowStyle = radioBox->GetWindowStyleFlag();
wxString val(property->GetValue().StringValue()); wxString val(property->GetValue().StringValue());
if (val == "wxHORIZONTAL") if (val == "wxRA_HORIZONTAL")
{ {
if (windowStyle & wxVERTICAL) if (windowStyle & wxRA_VERTICAL)
windowStyle -= wxVERTICAL; windowStyle -= wxRA_VERTICAL;
windowStyle |= wxHORIZONTAL; windowStyle |= wxRA_HORIZONTAL;
} }
else else
{ {
if (windowStyle & wxHORIZONTAL) if (windowStyle & wxRA_HORIZONTAL)
windowStyle -= wxHORIZONTAL; windowStyle -= wxRA_HORIZONTAL;
windowStyle |= wxVERTICAL; windowStyle |= wxRA_VERTICAL;
} }
radioBox->SetWindowStyleFlag(windowStyle); radioBox->SetWindowStyleFlag(windowStyle);
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(radioBox);
resource->SetStyle(windowStyle);
wxResourceManager::GetCurrentResourceManager()->RecreateWindowFromResource(radioBox, this); wxResourceManager::GetCurrentResourceManager()->RecreateWindowFromResource(radioBox, this);
return TRUE; return TRUE;