]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/wincmn.cpp
C/POSIX locales (or absence of locale information) corresponds to wxLANGUAGE_ENGLISH_...
[wxWidgets.git] / src / common / wincmn.cpp
index a2f7a427662b124bf8aa152df45525adf4ae3b84..8c393888f31b12c11ab58d9c817ddbb4e13d980e 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 )