virtual bool SetTransparent(wxByte alpha);
virtual bool CanSetTransparent();
+ //Top level windows have different freeze semantics on Windows
+ virtual void Freeze();
+ virtual void Thaw();
+
+ virtual void AddChild( wxWindowBase *child );
+
// implementation from now on
// --------------------------
bool HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
- // number of calls to Freeze() minus number of calls to Thaw()
- unsigned int m_frozenness;
+
// current defer window position operation handle (may be NULL)
WXHANDLE m_hDWP;
wxPoint m_pendingPosition;
wxSize m_pendingSize;
+ // number of calls to Freeze() minus number of calls to Thaw()
+ // protected so that wxTopLevelWindowMSW can access it
+ unsigned int m_frozenness;
+
private:
#ifdef __POCKETPC__
bool m_contextMenuEnabled;
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
// ----------------------------------------------------------------------------