]> git.lyx.org Git - lyx.git/blobdiff - src/FuncStatus.C
cleanup after svn hang-up, #undef CursorShape. Should be compilable ganin now.
[lyx.git] / src / FuncStatus.C
index 1998db67d1d0a9f81311606931c334c578d9137e..5961ec27c00b9568135c6c59c9849b0ed04dc41a 100644 (file)
@@ -12,6 +12,8 @@
 
 #include "FuncStatus.h"
 
+using lyx::docstring;
+
 FuncStatus::FuncStatus() : v_(OK)
 {
 }
@@ -20,12 +22,15 @@ FuncStatus::FuncStatus() : v_(OK)
 void FuncStatus::clear()
 {
        v_ = OK;
+       message_.erase();
 }
 
 
 void FuncStatus::operator|=(FuncStatus const & f)
 {
        v_ |= f.v_;
+       if (!f.message_.empty())
+               message_ = f.message_;
 }
 
 
@@ -45,18 +50,18 @@ bool FuncStatus::unknown() const
 }
 
 
-void FuncStatus::disabled(bool b)
+void FuncStatus::enabled(bool b)
 {
        if (b)
-               v_ |= DISABLED;
-       else
                v_ &= !DISABLED;
+       else
+               v_ |= DISABLED;
 }
 
 
-bool FuncStatus::disabled() const
+bool FuncStatus::enabled() const
 {
-       return (v_ & DISABLED);
+       return !(v_ & DISABLED);
 }
 
 
@@ -73,3 +78,15 @@ bool FuncStatus::onoff(bool b) const
        else
                return (v_ & OFF);
 }
+
+
+void FuncStatus::message(docstring const & m)
+{
+       message_ = m;
+}
+
+
+docstring const & FuncStatus::message() const
+{
+       return message_;
+}