DECLARE_DYNAMIC_CLASS(wxDialog)
public:
- wxDialog();
+ wxDialog() { Init(); }
// Constructor with a modal flag, but no window id - the old convention
wxDialog(wxWindow *parent,
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
- long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
+ Init();
+ m_isModalStyle = modal;
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height),
- style | modalStyle, name);
+ style, name);
}
// Constructor with no modal flag - the new convention.
long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr)
{
+ Init();
Create(parent, id, title, pos, size, style, name);
}
void DoShowModal();
private:
+ void Init();
+ bool m_isModalStyle;
DECLARE_EVENT_TABLE()
};
#endif
-wxDialog::wxDialog()
+wxDialog::Init()
{
- m_isShown = FALSE;
+ m_isModalStyle = false;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
}
{
if ( flag )
{
- m_windowStyle |= wxDIALOG_MODAL;
+ m_isModalStyle = true;
wxModelessWindows.DeleteObject(this);
#if TARGET_CARBON
}
else
{
- m_windowStyle &= ~wxDIALOG_MODAL;
+ m_isModalStyle = false;
wxModelessWindows.Append(this);
}
bool wxDialog::IsModal() const
{
- return (GetWindowStyleFlag() & wxDIALOG_MODAL) != 0;
+ return m_isModalStyle;
}