}
#ifndef __WXWINCE__
- if ( style & wxSYSTEM_MENU )
+ // notice that if wxCLOSE_BOX is specified we need to use WS_SYSMENU too as
+ // otherwise the close box doesn't appear
+ if ( style & (wxSYSTEM_MENU | wxCLOSE_BOX) )
msflags |= WS_SYSMENU;
-#endif
+#endif // !__WXWINCE__
// NB: under CE these 2 styles are not supported currently, we should
// call Minimize()/Maximize() "manually" if we want to support them
return (os_type == wxOS_WINDOWS_NT && ver_major >= 5);
}
+
+void wxTopLevelWindowMSW::Freeze()
+{
+ if ( !m_frozenness++) {
+ if (IsShown()) {
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow *child = node->GetData();
+ if ( child->IsTopLevel() )
+ continue;
+ else
+ child->Freeze();
+ }
+ }
+ }
+}
+
+void wxTopLevelWindowMSW::Thaw()
+{
+ wxASSERT_MSG( m_frozenness > 0, _T("Thaw() without matching Freeze()") );
+ if ( --m_frozenness == 0 )
+ {
+ if ( IsShown() ) {
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow *child = node->GetData();
+ if ( child->IsTopLevel() )
+ continue;
+ else
+ child->Thaw();
+ }
+ }
+ }
+}
+
+
+void wxTopLevelWindowMSW::AddChild(wxWindowBase *child )
+{
+ //adding a child while frozen will assert when thawn,
+ // so freeze it
+ if (child && !child->IsTopLevel() && IsFrozen()) {
+ //need to match our current freeze level
+ for (unsigned int ii=0;ii< m_frozenness;ii++) {
+ child->Freeze();
+ }
+ }
+ wxTopLevelWindowBase::AddChild(child);
+}
+
+
// ----------------------------------------------------------------------------
// wxTopLevelWindow event handling
// ----------------------------------------------------------------------------