Dialog Editor bug fixes, several other small ones
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1020,7 +1020,7 @@ bool wxResourceManager::CreatePanelItem(wxItemResource *panelResource, wxPanel *
|
||||
|
||||
if ((panelResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
|
||||
{
|
||||
wxPoint pt = panel->ConvertPixelsToDialog(pt);
|
||||
wxPoint pt = panel->ConvertPixelsToDialog(wxPoint(x, y));
|
||||
res->SetSize(pt.x, pt.y, -1, -1);
|
||||
}
|
||||
else res->SetSize(x, y, -1, -1);
|
||||
@@ -1159,6 +1159,16 @@ bool wxResourceManager::CreatePanelItem(wxItemResource *panelResource, wxPanel *
|
||||
if (!newItem)
|
||||
return FALSE;
|
||||
|
||||
int actualW, actualH;
|
||||
newItem->GetSize(&actualW, &actualH);
|
||||
wxSize actualSize(actualW, actualH);
|
||||
|
||||
if ((panelResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS) != 0)
|
||||
{
|
||||
actualSize = panel->ConvertPixelsToDialog(actualSize);
|
||||
}
|
||||
res->SetSize(res->GetX(), res->GetY(), actualSize.x, actualSize.y);
|
||||
|
||||
wxString newIdName;
|
||||
int id = GenerateWindowId(prefix, newIdName);
|
||||
res->SetId(id);
|
||||
@@ -1759,7 +1769,7 @@ wxWindow *wxResourceManager::RecreateWindowFromResource(wxWindow *win, wxWindowP
|
||||
wxWindow *parent = win->GetParent();
|
||||
wxItemResource* parentResource = NULL;
|
||||
if (parent)
|
||||
FindResourceForWindow(parent);
|
||||
parentResource = FindResourceForWindow(parent);
|
||||
|
||||
if (win->IsKindOf(CLASSINFO(wxPanel)))
|
||||
{
|
||||
|
@@ -310,7 +310,9 @@ bool wxResourceTableWithSaving::SaveResource(ostream& stream, wxItemResource* it
|
||||
node = node->Next();
|
||||
}
|
||||
}
|
||||
stream << "], ";
|
||||
stream << "]";
|
||||
/* Styles are now in the window style, not in a separate arg
|
||||
stream << ", ";
|
||||
switch (item->GetValue1())
|
||||
{
|
||||
case wxLB_MULTIPLE:
|
||||
@@ -330,6 +332,8 @@ bool wxResourceTableWithSaving::SaveResource(ostream& stream, wxItemResource* it
|
||||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (item->GetFont().Ok())
|
||||
{
|
||||
stream << ",\\\n ";
|
||||
|
@@ -1086,22 +1086,16 @@ wxProperty *wxListBoxPropertyInfo::GetProperty(wxString& name)
|
||||
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
|
||||
if (!resource)
|
||||
return NULL;
|
||||
|
||||
char *mult = "wxLB_SINGLE";
|
||||
|
||||
char *mult = "wxSINGLE";
|
||||
|
||||
switch (resource->GetValue1())
|
||||
{
|
||||
case wxLB_MULTIPLE:
|
||||
if ((listBox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0)
|
||||
mult = "wxLB_MULTIPLE";
|
||||
break;
|
||||
case wxLB_EXTENDED:
|
||||
else if ((listBox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)
|
||||
mult = "wxLB_EXTENDED";
|
||||
break;
|
||||
default:
|
||||
case wxLB_SINGLE:
|
||||
else
|
||||
mult = "wxLB_SINGLE";
|
||||
break;
|
||||
}
|
||||
|
||||
return new wxProperty("multiple", mult, "string",
|
||||
new wxStringListValidator(new wxStringList("wxLB_SINGLE", "wxLB_MULTIPLE", "wxLB_EXTENDED",
|
||||
NULL)));
|
||||
@@ -1128,17 +1122,21 @@ bool wxListBoxPropertyInfo::SetProperty(wxString& name, wxProperty *property)
|
||||
}
|
||||
else if (name == "multiple")
|
||||
{
|
||||
int mult = wxLB_SINGLE;
|
||||
SetWindowStyle(m_propertyWindow, wxLB_SINGLE, FALSE);
|
||||
SetWindowStyle(m_propertyWindow, wxLB_MULTIPLE, FALSE);
|
||||
SetWindowStyle(m_propertyWindow, wxLB_EXTENDED, FALSE);
|
||||
|
||||
wxString str(property->GetValue().StringValue());
|
||||
if (str == "wxLB_MULTIPLE")
|
||||
mult = wxLB_MULTIPLE;
|
||||
SetWindowStyle(m_propertyWindow, wxLB_MULTIPLE, TRUE);
|
||||
else if (str == "wxLB_EXTENDED")
|
||||
mult = wxLB_EXTENDED;
|
||||
SetWindowStyle(m_propertyWindow, wxLB_EXTENDED, TRUE);
|
||||
else
|
||||
mult = wxLB_SINGLE;
|
||||
SetWindowStyle(m_propertyWindow, wxLB_SINGLE, TRUE);
|
||||
|
||||
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(listBox);
|
||||
if (resource)
|
||||
resource->SetValue1(mult);
|
||||
resource->SetStyle(m_propertyWindow->GetWindowStyleFlag());
|
||||
wxResourceManager::GetCurrentResourceManager()->RecreateWindowFromResource(listBox, this);
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user