Added wxPoem sample; fixed some Dialog Editor problems; wxStaticBitmap and wxBitmapButton

now recognised by resource.cpp.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-12-12 18:50:16 +00:00
parent ae0bdb016f
commit 3013b6f460
23 changed files with 4183 additions and 21 deletions

View File

@@ -1318,7 +1318,22 @@ void wxResourceManager::AlignItems(int flag)
break;
}
wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item);
wxItemResource* parentResource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item->GetParent());
item->SetSize(newX, newY, w, h);
// Also update the associated resource
// We need to convert to dialog units if this is not a dialog or panel, but
// the parent resource specifies dialog units.
if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
{
wxPoint pt = item->GetParent()->ConvertPixelsToDialog(wxPoint(newX, newY));
newX = pt.x; newY = pt.y;
wxSize sz = item->GetParent()->ConvertPixelsToDialog(wxSize(w, h));
w = sz.x; h = sz.y;
}
resource->SetSize(newX, newY, w, h);
}
}
win->Refresh();
@@ -1348,7 +1363,23 @@ void wxResourceManager::CopySize()
{
wxControl *item = (wxControl *)node->Data();
if (item->GetParent() == win)
{
item->SetSize(-1, -1, firstW, firstH);
wxItemResource* resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item);
wxItemResource* parentResource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(item->GetParent());
// Also update the associated resource
// We need to convert to dialog units if this is not a dialog or panel, but
// the parent resource specifies dialog units.
if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
{
wxSize sz = item->GetParent()->ConvertPixelsToDialog(wxSize(firstW, firstH));
firstW = sz.x; firstH = sz.y;
}
resource->SetSize(resource->GetX(), resource->GetY(), firstW, firstH);
}
}
win->Refresh();
}
@@ -1931,30 +1962,30 @@ wxWindowPropertyInfo *wxResourceManager::CreatePropertyInfoForWindow(wxWindow *w
{
info = new wxRadioButtonPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxChoice)))
{
info = new wxChoicePropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxComboBox)))
{
info = new wxComboBoxPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxButton)))
else if (win->IsKindOf(CLASSINFO(wxChoice)))
{
info = new wxButtonPropertyInfo(win);
info = new wxChoicePropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxBitmapButton)))
{
info = new wxBitmapButtonPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxStaticText)))
else if (win->IsKindOf(CLASSINFO(wxButton)))
{
info = new wxStaticTextPropertyInfo(win);
info = new wxButtonPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxStaticBitmap)))
{
info = new wxStaticBitmapPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxStaticText)))
{
info = new wxStaticTextPropertyInfo(win);
}
else if (win->IsKindOf(CLASSINFO(wxTextCtrl)))
{
info = new wxTextPropertyInfo(win);