Dialog Editor corrections, wxListBox::GetSelections correction
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,9 +32,9 @@ dialog to respond to system close events.
|
|||||||
\twocolwidtha{5cm}
|
\twocolwidtha{5cm}
|
||||||
\begin{twocollist}\itemsep=0pt
|
\begin{twocollist}\itemsep=0pt
|
||||||
\twocolitem{\windowstyle{wxDIALOG\_MODAL}}{Specifies that the dialog box will be modal.}
|
\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{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{wxSYSTEM\_MENU}}{Display a system menu.}
|
||||||
\twocolitem{\windowstyle{wxTHICK\_FRAME}}{Display a thick frame around the window.}
|
\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).}
|
\twocolitem{\windowstyle{wxSTAY\_ON\_TOP}}{The dialog stays on top of all other windows (Windows only).}
|
||||||
|
@@ -3143,7 +3143,7 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa
|
|||||||
|
|
||||||
wxString title(resource->GetTitle());
|
wxString title(resource->GetTitle());
|
||||||
long theWindowStyle = resource->GetStyle();
|
long theWindowStyle = resource->GetStyle();
|
||||||
bool isModal = (resource->GetValue1() != 0);
|
bool isModal = (resource->GetValue1() != 0) ;
|
||||||
int x = resource->GetX();
|
int x = resource->GetX();
|
||||||
int y = resource->GetY();
|
int y = resource->GetY();
|
||||||
int width = resource->GetWidth();
|
int width = resource->GetWidth();
|
||||||
|
@@ -474,9 +474,10 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const
|
|||||||
}
|
}
|
||||||
else // single-selection listbox
|
else // single-selection listbox
|
||||||
{
|
{
|
||||||
aSelections.Add(ListBox_GetCurSel(GetHwnd()));
|
if (ListBox_GetCurSel(GetHwnd()) > -1)
|
||||||
|
aSelections.Add(ListBox_GetCurSel(GetHwnd()));
|
||||||
|
|
||||||
return 1;
|
return aSelections.Count();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2776,11 +2776,19 @@ bool wxResourceManager::ChangeOldToNewResource(wxItemResource* parent, wxItemRes
|
|||||||
res->SetType(wxT("wxDialog"));
|
res->SetType(wxT("wxDialog"));
|
||||||
|
|
||||||
if (itemType == wxT("wxDialogBox") || itemType == 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)
|
if (s_useSystemDefaultsAlways)
|
||||||
res->SetResourceStyle(res->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
res->SetResourceStyle(res->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
|
||||||
|
|
||||||
|
if (res->GetValue1())
|
||||||
|
res->SetStyle(res->GetStyle() | wxDIALOG_MODAL);
|
||||||
|
|
||||||
wxNode *node = res->GetChildren().First();
|
wxNode *node = res->GetChildren().First();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
|
@@ -2055,6 +2055,11 @@ wxProperty *wxPanelPropertyInfo::GetProperty(wxString& name)
|
|||||||
return new wxProperty(name, ((panelWindow->GetWindowStyleFlag() & wxTHICK_FRAME) == wxTHICK_FRAME),
|
return new wxProperty(name, ((panelWindow->GetWindowStyleFlag() & wxTHICK_FRAME) == wxTHICK_FRAME),
|
||||||
"bool");
|
"bool");
|
||||||
}
|
}
|
||||||
|
else if (name == "modal")
|
||||||
|
{
|
||||||
|
return new wxProperty(name, ((panelWindow->GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL),
|
||||||
|
"bool");
|
||||||
|
}
|
||||||
else if (name == "useSystemDefaults")
|
else if (name == "useSystemDefaults")
|
||||||
{
|
{
|
||||||
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow);
|
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow);
|
||||||
@@ -2162,6 +2167,14 @@ bool wxPanelPropertyInfo::SetProperty(wxString& name, wxProperty *property)
|
|||||||
resource->SetStyle(panelWindow->GetWindowStyleFlag());
|
resource->SetStyle(panelWindow->GetWindowStyleFlag());
|
||||||
return TRUE;
|
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")
|
else if (name == "useSystemDefaults")
|
||||||
{
|
{
|
||||||
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow);
|
wxItemResource *resource = wxResourceManager::GetCurrentResourceManager()->FindResourceForWindow(panelWindow);
|
||||||
@@ -2224,6 +2237,7 @@ void wxPanelPropertyInfo::GetPropertyNames(wxStringList& names)
|
|||||||
names.Add("thickFrame");
|
names.Add("thickFrame");
|
||||||
names.Add("useSystemDefaults");
|
names.Add("useSystemDefaults");
|
||||||
names.Add("useDialogUnits");
|
names.Add("useDialogUnits");
|
||||||
|
names.Add("modal");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxPanelPropertyInfo::InstantiateResource(wxItemResource *resource)
|
bool wxPanelPropertyInfo::InstantiateResource(wxItemResource *resource)
|
||||||
|
@@ -238,6 +238,7 @@ static wxWindowStylePair g_WindowStylesDialog[] = {
|
|||||||
{ "wxSYSTEM_MENU", wxSYSTEM_MENU},
|
{ "wxSYSTEM_MENU", wxSYSTEM_MENU},
|
||||||
{ "wxMINIMIZE_BOX", wxMINIMIZE_BOX},
|
{ "wxMINIMIZE_BOX", wxMINIMIZE_BOX},
|
||||||
{ "wxMAXIMIZE_BOX", wxMAXIMIZE_BOX},
|
{ "wxMAXIMIZE_BOX", wxMAXIMIZE_BOX},
|
||||||
|
{ "wxDIALOG_MODAL", wxDIALOG_MODAL},
|
||||||
{ "wxRESIZE_BOX", wxRESIZE_BOX}
|
{ "wxRESIZE_BOX", wxRESIZE_BOX}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user