]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
make GetSize() return the size of the window including the decorations and updated...
[wxWidgets.git] / src / common / wincmn.cpp
index a2f7a427662b124bf8aa152df45525adf4ae3b84..7b0bb3c81b94cc746ee0a2ee97998683ce9034ae 100644 (file)
@@ -274,6 +274,28 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent,
     return true;
 }
 
+bool wxWindowBase::ToggleWindowStyle(int flag)
+{
+    wxASSERT_MSG( flag, _T("flags with 0 value can't be toggled") );
+
+    bool rc;
+    long style = GetWindowStyleFlag();
+    if ( style & flag )
+    {
+        style &= ~flag;
+        rc = false;
+    }
+    else // currently off
+    {
+        style |= flag;
+        rc = true;
+    }
+
+    SetWindowStyleFlag(style);
+
+    return rc;
+}
+
 // ----------------------------------------------------------------------------
 // destruction
 // ----------------------------------------------------------------------------
@@ -301,7 +323,7 @@ wxWindowBase::~wxWindowBase()
     {
         wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent((wxWindow*)this),
                                               wxTopLevelWindow);
-        
+
         if ( tlw && tlw->GetDefaultItem() == this )
             tlw->SetDefaultItem(NULL);
         if ( tlw && tlw->GetTmpDefaultItem() == this )
@@ -2264,7 +2286,7 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
         msg.Printf(_T("wxWidgets Library (%s port)\n")
                    _T("Version %d.%d.%d%s%s, compiled at %s %s\n")
                    _T("Runtime version of toolkit used is %d.%d.%s\n")
-                   _T("Copyright (c) 1995-2006 wxWidgets team"),
+                   _T("Copyright (c) 1995-2007 wxWidgets team"),
                    wxPlatformInfo::Get().GetPortIdName().c_str(),
                    wxMAJOR_VERSION,
                    wxMINOR_VERSION,
@@ -2465,6 +2487,10 @@ static void DoNotifyWindowAboutCaptureLost(wxWindow *win)
     event.SetEventObject(win);
     if ( !win->GetEventHandler()->ProcessEvent(event) )
     {
+        // windows must handle this event, otherwise the app wouldn't behave
+        // correctly if it loses capture unexpectedly; see the discussion here:
+        // http://sourceforge.net/tracker/index.php?func=detail&aid=1153662&group_id=9863&atid=109863
+        // http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82376
         wxFAIL_MSG( _T("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") );
     }
 }