diff --git a/docs/latex/wx/dialog.tex b/docs/latex/wx/dialog.tex index 4e78cf23d9..f9ff3ab0cf 100644 --- a/docs/latex/wx/dialog.tex +++ b/docs/latex/wx/dialog.tex @@ -32,9 +32,9 @@ dialog to respond to system close events. \twocolwidtha{5cm} \begin{twocollist}\itemsep=0pt \twocolitem{\windowstyle{wxDIALOG\_MODAL}}{Specifies that the dialog box will be modal.} -\twocolitem{\windowstyle{wxCAPTION}}{Puts a caption on the dialog box (Motif only).} +\twocolitem{\windowstyle{wxCAPTION}}{Puts a caption on the dialog box.} \twocolitem{\windowstyle{wxDEFAULT\_DIALOG\_STYLE}}{Equivalent to a combination of wxCAPTION, wxSYSTEM\_MENU and wxTHICK\_FRAME} -\twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Display a resizeable frame around the window (Unix only).} +\twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Display a resizeable frame around the window.} \twocolitem{\windowstyle{wxSYSTEM\_MENU}}{Display a system menu.} \twocolitem{\windowstyle{wxTHICK\_FRAME}}{Display a thick frame around the window.} \twocolitem{\windowstyle{wxSTAY\_ON\_TOP}}{The dialog stays on top of all other windows (Windows only).} diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 835ddd4d10..e80276a71e 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -3143,7 +3143,7 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa wxString title(resource->GetTitle()); long theWindowStyle = resource->GetStyle(); - bool isModal = (resource->GetValue1() != 0); + bool isModal = (resource->GetValue1() != 0) ; int x = resource->GetX(); int y = resource->GetY(); int width = resource->GetWidth(); diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 5a4f08ef23..3594e49841 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -474,9 +474,10 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const } else // single-selection listbox { - aSelections.Add(ListBox_GetCurSel(GetHwnd())); + if (ListBox_GetCurSel(GetHwnd()) > -1) + aSelections.Add(ListBox_GetCurSel(GetHwnd())); - return 1; + return aSelections.Count(); } } diff --git a/utils/dialoged/src/reseditr.cpp b/utils/dialoged/src/reseditr.cpp index c4f1543585..5f1b105bbb 100644 --- a/utils/dialoged/src/reseditr.cpp +++ b/utils/dialoged/src/reseditr.cpp @@ -2776,11 +2776,19 @@ bool wxResourceManager::ChangeOldToNewResource(wxItemResource* parent, wxItemRes res->SetType(wxT("wxDialog")); if (itemType == wxT("wxDialogBox") || itemType == wxT("wxDialog")) - res->SetSize(res->GetX(), res->GetY(), res->GetWidth(), res->GetHeight() + s_increaseDialogSize ); + { + // Only change the height if it has a caption, i.e. it's going to be + // used as a proper dialog and not a panel + if (res->GetStyle() & wxCAPTION) + res->SetSize(res->GetX(), res->GetY(), res->GetWidth(), res->GetHeight() + s_increaseDialogSize ); + } if (s_useSystemDefaultsAlways) res->SetResourceStyle(res->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS); + if (res->GetValue1()) + res->SetStyle(res->GetStyle() | wxDIALOG_MODAL); + wxNode *node = res->GetChildren().First(); while (node) { diff --git a/utils/dialoged/src/winprop.cpp b/utils/dialoged/src/winprop.cpp index 277776f655..e32b9b2940 100644 --- a/utils/dialoged/src/winprop.cpp +++ b/utils/dialoged/src/winprop.cpp @@ -2055,6 +2055,11 @@ wxProperty *wxPanelPropertyInfo::GetProperty(wxString& name) return new wxProperty(name, ((panelWindow->GetWindowStyleFlag() & wxTHICK_FRAME) == wxTHICK_FRAME), "bool"); } + else if (name == "modal") + { + return new wxProperty(name, ((panelWindow->GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL), + "bool"); + } else if (name == "useSystemDefaults") { wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow); @@ -2162,6 +2167,14 @@ bool wxPanelPropertyInfo::SetProperty(wxString& name, wxProperty *property) resource->SetStyle(panelWindow->GetWindowStyleFlag()); return TRUE; } + else if (name == "modal") + { + SetWindowStyle(panelWindow, wxDIALOG_MODAL, property->GetValue().BoolValue()); + + wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow); + resource->SetStyle(panelWindow->GetWindowStyleFlag()); + return TRUE; + } else if (name == "useSystemDefaults") { wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow); @@ -2224,6 +2237,7 @@ void wxPanelPropertyInfo::GetPropertyNames(wxStringList& names) names.Add("thickFrame"); names.Add("useSystemDefaults"); names.Add("useDialogUnits"); + names.Add("modal"); } bool wxPanelPropertyInfo::InstantiateResource(wxItemResource *resource) diff --git a/utils/dialoged/src/winstyle.cpp b/utils/dialoged/src/winstyle.cpp index c4abe1509a..b0b1dae327 100644 --- a/utils/dialoged/src/winstyle.cpp +++ b/utils/dialoged/src/winstyle.cpp @@ -238,6 +238,7 @@ static wxWindowStylePair g_WindowStylesDialog[] = { { "wxSYSTEM_MENU", wxSYSTEM_MENU}, { "wxMINIMIZE_BOX", wxMINIMIZE_BOX}, { "wxMAXIMIZE_BOX", wxMAXIMIZE_BOX}, + { "wxDIALOG_MODAL", wxDIALOG_MODAL}, { "wxRESIZE_BOX", wxRESIZE_BOX} };