]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ButtonControllerBase.C
Move the external dialog to the new scheme.
[lyx.git] / src / frontends / controllers / ButtonControllerBase.C
index 729c0a08522dbefb3e4802daecb9850fe8bdac4b..d35c4d6954bff5f4259becd32000f9ee6019548c 100644 (file)
@@ -8,9 +8,6 @@
  * Full author contact details are available in file CREDITS
  */
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include <config.h>
 #include "ButtonControllerBase.h"
 #include "debug.h"
 
 
+CheckedWidget::~CheckedWidget()
+{}
+
+
 ButtonControllerBase::ButtonControllerBase(string const & cancel,
                                           string const & close)
        : cancel_label_(cancel), close_label_(close)
@@ -98,3 +99,26 @@ void ButtonControllerBase::readWrite()
 {
        readOnly(false);
 }
+
+
+void ButtonControllerBase::addCheckedWidget(CheckedWidget * ptr)
+{
+       if (ptr)
+               checked_widgets.push_back(checked_widget_ptr(ptr));
+}
+
+
+bool ButtonControllerBase::checkWidgets()
+{
+       bool valid = true;
+
+       checked_widget_list::const_iterator it  = checked_widgets.begin();
+       checked_widget_list::const_iterator end = checked_widgets.end();
+
+       for (; it != end; ++it) {
+               valid &= (*it)->check();
+       }
+
+       // return valid status after checking ALL widgets
+       return valid;
+}