]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/checkedwidgets.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / checkedwidgets.C
index d351372452239941e503ee7686f33d16929d7d5d..41b5b746401da012245aa6b3514951c1f56d39a8 100644 (file)
@@ -1,41 +1,40 @@
 /**
- * \file checkedwidgets.C
+ * \file xforms/checkedwidgets.C
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "checkedwidgets.h"
 #include "xforms_helpers.h"
-#include "lyxlength.h"
 #include "lyxgluelength.h"
-#include "support/LAssert.h"
+
 #include "support/lstrings.h"
-#include "LString.h"
 
-#include FORMS_H_LOCATION
+#include "lyx_forms.h"
+
+using lyx::support::isStrDbl;
+
+using std::string;
 
 
-void addCheckedLyXLength(ButtonControllerBase & bc,
+void addCheckedLyXLength(BCView & bcview,
                         FL_OBJECT * input, FL_OBJECT * label)
 {
-       bc.addCheckedWidget(new CheckedLyXLength(input, label));
+       bcview.addCheckedWidget(new CheckedLyXLength(input, label));
 }
 
 
-void addCheckedGlueLength(ButtonControllerBase & bc,
+void addCheckedGlueLength(BCView & bcview,
                          FL_OBJECT * input, FL_OBJECT * label)
 {
-       bc.addCheckedWidget(new CheckedGlueLength(input, label));
+       bcview.addCheckedWidget(new CheckedGlueLength(input, label));
 }
 
 
@@ -45,8 +44,8 @@ void setWidget(bool valid, FL_OBJECT * input, FL_OBJECT * label)
 {
        // define color to mark invalid input
        FL_COLOR const alert_col = FL_RED;
-       
-       FL_COLOR const lcol = valid ? FL_LCOL : alert_col;
+
+       FL_COLOR const lcol = valid ? FL_COLOR(FL_LCOL) : alert_col;
        if (label->lcol != lcol && isActive(label)) {
                fl_set_object_lcol(label, lcol);
        }
@@ -56,19 +55,19 @@ void setWidget(bool valid, FL_OBJECT * input, FL_OBJECT * label)
 
        // Reflect the validity of the data in the background color of the
        // input widget only when this widget is not being edited.
-       FL_COLOR const icol1 = valid ? FL_COL1 : alert_col;
+       FL_COLOR const icol1 = valid ? FL_COLOR(FL_COL1) : alert_col;
        if (input->col1 != icol1) {
                fl_set_object_color(input, icol1, FL_MCOL);
        }
 }
+
 } // namespace anon
 
 
 CheckedLyXLength::CheckedLyXLength(FL_OBJECT * input, FL_OBJECT * label)
        : input_(input), label_(label ? label : input)
 {
-       lyx::Assert(input && input->objclass == FL_INPUT);
+       BOOST_ASSERT(input && input->objclass == FL_INPUT);
 }
 
 
@@ -88,7 +87,7 @@ bool CheckedLyXLength::check() const
 CheckedGlueLength::CheckedGlueLength(FL_OBJECT * input, FL_OBJECT * label)
        : input_(input), label_(label ? label : input)
 {
-       lyx::Assert(input && input->objclass == FL_INPUT);
+       BOOST_ASSERT(input && input->objclass == FL_INPUT);
 }