]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
compilation fix for wxUSE_UNICODE_MSLU
[wxWidgets.git] / src / msw / window.cpp
index 93c237878c84acec6bb5dbf13245f1bbc0533032..3e34e88e6d58e096d2630ce03e1fc970bca5d060 100644 (file)
@@ -230,40 +230,97 @@ static inline void wxBringWindowToTop(HWND hwnd)
     IMPLEMENT_ABSTRACT_CLASS(wxWindowMSW, wxWindowBase)
 #else // __WXMSW__
 #if wxUSE_EXTENDED_RTTI
-IMPLEMENT_DYNAMIC_CLASS_XTI(wxWindow, wxWindowBase,"wx/window.h")
+
+// windows that are created from a parent window during its Create method, eg. spin controls in a calendar controls
+// must never been streamed out separately otherwise chaos occurs. Right now easiest is to test for negative ids, as
+// windows with negative ids never can be recreated anyway
+
+bool wxWindowStreamingCallback( const wxObject *object, wxWriter * , wxPersister * , wxxVariantArray & )
+{
+    const wxWindow * win = dynamic_cast<const wxWindow*>(object) ;
+    if ( win && win->GetId() < 0 )
+        return false ;
+    return true ;
+}
+
+IMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK(wxWindow, wxWindowBase,"wx/window.h", wxWindowStreamingCallback)
+
+// make wxWindowList known before the property is used
+
+WX_COLLECTION_TYPE_INFO( wxWindow* , wxWindowList ) ;
+
+template<> void wxCollectionToVariantArray( wxWindowList const &theList, wxxVariantArray &value)
+{
+    wxListCollectionToVariantArray<wxWindowList::compatibility_iterator>( theList , value ) ;
+}
+
+WX_DEFINE_FLAGS( wxWindowStyle )
+
+WX_BEGIN_FLAGS( wxWindowStyle )
+    // new style border flags, we put them first to
+    // use them for streaming out
+    WX_FLAGS_MEMBER(wxBORDER_SIMPLE)
+    WX_FLAGS_MEMBER(wxBORDER_SUNKEN)
+    WX_FLAGS_MEMBER(wxBORDER_DOUBLE)
+    WX_FLAGS_MEMBER(wxBORDER_RAISED)
+    WX_FLAGS_MEMBER(wxBORDER_STATIC)
+    WX_FLAGS_MEMBER(wxBORDER_NONE)
+    
+    // old style border flags
+    WX_FLAGS_MEMBER(wxSIMPLE_BORDER)
+    WX_FLAGS_MEMBER(wxSUNKEN_BORDER)
+    WX_FLAGS_MEMBER(wxDOUBLE_BORDER)
+    WX_FLAGS_MEMBER(wxRAISED_BORDER)
+    WX_FLAGS_MEMBER(wxSTATIC_BORDER)
+    WX_FLAGS_MEMBER(wxNO_BORDER)
+
+    // standard window styles
+    WX_FLAGS_MEMBER(wxTAB_TRAVERSAL)
+    WX_FLAGS_MEMBER(wxCLIP_CHILDREN)
+    WX_FLAGS_MEMBER(wxTRANSPARENT_WINDOW)
+    WX_FLAGS_MEMBER(wxWANTS_CHARS)
+    WX_FLAGS_MEMBER(wxNO_FULL_REPAINT_ON_RESIZE)
+    WX_FLAGS_MEMBER(wxALWAYS_SHOW_SB )
+    WX_FLAGS_MEMBER(wxVSCROLL)
+    WX_FLAGS_MEMBER(wxHSCROLL)
+
+WX_END_FLAGS( wxWindowStyle )
 
 WX_BEGIN_PROPERTIES_TABLE(wxWindow)
     // Always constructor Properties first
 
-    WX_READONLY_PROPERTY( Parent,wxWindow*, GetParent,  )
-       WX_PROPERTY( Id,wxWindowID, SetId, GetId, -1 )
-       WX_PROPERTY_SET_BY_REF( Position,wxPoint, SetPosition , GetPosition, wxPoint(-1,-1) ) // pos
-       WX_PROPERTY_SET_BY_REF( Size,wxSize, SetSize, GetSize, wxSize(-1,-1) ) // size
-    WX_PROPERTY( WindowStyle , long , SetWindowStyle , GetWindowStyle , ) // style 
+    WX_READONLY_PROPERTY( Parent,wxWindow*, GetParent,  , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+       WX_PROPERTY( Id,wxWindowID, SetId, GetId, -1, 0 /*flags*/ , wxT("Helpstring") , wxT("group") )
+       WX_PROPERTY( Position,wxPoint, SetPosition , GetPosition, wxPoint(-1,-1) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // pos
+       WX_PROPERTY( Size,wxSize, SetSize, GetSize, wxSize(-1,-1) , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // size
+    WX_PROPERTY( WindowStyle , long , SetWindowStyleFlag , GetWindowStyleFlag , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // style
 
     // Then all relations of the object graph
 
-    WX_READONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetChildren )
+    WX_READONLY_PROPERTY_COLLECTION( Children , wxWindowList , wxWindowBase* , GetWindowChildren , wxPROP_OBJECT_GRAPH /*flags*/ , wxT("Helpstring") , wxT("group"))
 
    // and finally all other properties
 
-       WX_PROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , ) // extstyle
-       WX_PROPERTY_SET_BY_REF_RET_BOOL( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , ) // bg
-       WX_PROPERTY_SET_BY_REF_RET_BOOL( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , ) // fg
-       WX_PROPERTY_SET_RET_BOOL( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) )
-       WX_PROPERTY_SET_RET_BOOL( Shown , bool , Show , IsShown , wxxVariant((bool)true) )
+       WX_PROPERTY( ExtraStyle , long , SetExtraStyle , GetExtraStyle , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // extstyle
+       WX_PROPERTY( BackgroundColour , wxColour , SetBackgroundColour , GetBackgroundColour , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // bg
+       WX_PROPERTY( ForegroundColour , wxColour , SetForegroundColour , GetForegroundColour , , 0 /*flags*/ , wxT("Helpstring") , wxT("group")) // fg
+       WX_PROPERTY( Enabled , bool , Enable , IsEnabled , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
+       WX_PROPERTY( Shown , bool , Show , IsShown , wxxVariant((bool)true) , 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
 #if 0
     // possible property candidates (not in xrc) or not valid in all subclasses
-       WX_PROPERTY_SET_BY_REF( Title,wxString, SetTitle, GetTitle, wxT("") )
-       WX_PROPERTY_SET_AND_GET_BY_REF_RET_BOOL( Font , wxFont , SetFont , GetFont  , )
-       WX_PROPERTY_SET_BY_REF( Label,wxString, SetLabel, GetLabel, wxT("") )
+       WX_PROPERTY( Title,wxString, SetTitle, GetTitle, wxT("") )
+       WX_PROPERTY( Font , wxFont , SetFont , GetWindowFont  , )
+       WX_PROPERTY( Label,wxString, SetLabel, GetLabel, wxT("") )
        // MaxHeight, Width , MinHeight , Width
        // TODO switch label to control and title to toplevels
+
        WX_PROPERTY( ThemeEnabled , bool , SetThemeEnabled , GetThemeEnabled , )
-       //WX_PROPERTY_SET_BY_REF( Cursor , wxCursor , SetCursor , GetCursor , )
+       //WX_PROPERTY( Cursor , wxCursor , SetCursor , GetCursor , )
        // WX_PROPERTY( ToolTip , wxString , SetToolTip , GetToolTipText , )
        WX_PROPERTY( AutoLayout , bool , SetAutoLayout , GetAutoLayout , )
+
+
+
 #endif
 WX_END_PROPERTIES_TABLE()
 
@@ -271,6 +328,7 @@ WX_BEGIN_HANDLERS_TABLE(wxWindow)
 WX_END_HANDLERS_TABLE()
 
 WX_CONSTRUCTOR_DUMMY(wxWindow)
+
 #else
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase)
 #endif
@@ -3458,7 +3516,7 @@ wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id),
 
 #endif // USE_OWNER_DRAWN
 
-#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__) 
+#if wxUSE_CONTROLS && !defined(__WXUNIVERSAL__)
 
 #if wxUSE_OWNER_DRAWN
     wxControl *item = wxDynamicCast(FindItem(id), wxControl);