]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dialog.cpp
wxNavigationKeyEvent doesn't derive from wxCommandEvent (but from wxEvent)
[wxWidgets.git] / src / msw / dialog.cpp
index f54a3164bf9dff6b019846534a1a7f74ba57aaee..727670f33e7b781666cb7f108efd83c1f47e7845 100644 (file)
@@ -17,7 +17,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "dialog.h"
 #endif
 
@@ -68,7 +68,62 @@ static wxWindowList wxModalDialogs;
 // wxWin macros
 // ----------------------------------------------------------------------------
 
+#if wxUSE_EXTENDED_RTTI
+WX_DEFINE_FLAGS( wxDialogStyle )
+
+wxBEGIN_FLAGS( wxDialogStyle )
+    // new style border flags, we put them first to
+    // use them for streaming out
+    wxFLAGS_MEMBER(wxBORDER_SIMPLE)
+    wxFLAGS_MEMBER(wxBORDER_SUNKEN)
+    wxFLAGS_MEMBER(wxBORDER_DOUBLE)
+    wxFLAGS_MEMBER(wxBORDER_RAISED)
+    wxFLAGS_MEMBER(wxBORDER_STATIC)
+    wxFLAGS_MEMBER(wxBORDER_NONE)
+    
+    // old style border flags
+    wxFLAGS_MEMBER(wxSIMPLE_BORDER)
+    wxFLAGS_MEMBER(wxSUNKEN_BORDER)
+    wxFLAGS_MEMBER(wxDOUBLE_BORDER)
+    wxFLAGS_MEMBER(wxRAISED_BORDER)
+    wxFLAGS_MEMBER(wxSTATIC_BORDER)
+    wxFLAGS_MEMBER(wxNO_BORDER)
+
+    // standard window styles
+    wxFLAGS_MEMBER(wxTAB_TRAVERSAL)
+    wxFLAGS_MEMBER(wxCLIP_CHILDREN)
+
+    // dialog styles
+    wxFLAGS_MEMBER(wxDIALOG_MODAL)
+    wxFLAGS_MEMBER(wxDIALOG_MODELESS)
+    wxFLAGS_MEMBER(wxNO_3D)
+    wxFLAGS_MEMBER(wxWS_EX_VALIDATE_RECURSIVELY)
+    wxFLAGS_MEMBER(wxSTAY_ON_TOP)
+    wxFLAGS_MEMBER(wxCAPTION)
+    wxFLAGS_MEMBER(wxTHICK_FRAME)
+    wxFLAGS_MEMBER(wxSYSTEM_MENU)
+    wxFLAGS_MEMBER(wxRESIZE_BORDER)
+    wxFLAGS_MEMBER(wxRESIZE_BOX)
+    wxFLAGS_MEMBER(wxCLOSE_BOX)
+    wxFLAGS_MEMBER(wxMAXIMIZE_BOX)
+    wxFLAGS_MEMBER(wxMINIMIZE_BOX)
+wxEND_FLAGS( wxDialogStyle )
+
+IMPLEMENT_DYNAMIC_CLASS_XTI(wxDialog, wxTopLevelWindow,"wx/dialog.h")
+
+wxBEGIN_PROPERTIES_TABLE(wxDialog)
+    wxPROPERTY( Title,wxString, SetTitle, GetTitle, wxString() , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+    wxPROPERTY_FLAGS( WindowStyle , wxDialogStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
+wxEND_PROPERTIES_TABLE()
+
+wxBEGIN_HANDLERS_TABLE(wxDialog)
+wxEND_HANDLERS_TABLE()
+
+wxCONSTRUCTOR_6( wxDialog , wxWindow* , Parent , wxWindowID , Id , wxString , Title , wxPoint , Position , wxSize , Size , long , WindowStyle) 
+
+#else
 IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
+#endif
 
 BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
     EVT_BUTTON(wxID_OK, wxDialog::OnOK)
@@ -191,7 +246,7 @@ bool wxDialog::IsModal() const
 
 bool wxDialog::IsModalShowing() const
 {
-    return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast
+    return !!wxModalDialogs.Find(wxConstCast(this, wxDialog));
 }
 
 wxWindow *wxDialog::FindSuitableParent() const