]> git.lyx.org Git - features.git/commitdiff
allow derived classes to manipulate signal connections
authorAllan Rae <rae@lyx.org>
Fri, 29 Sep 2000 06:34:04 +0000 (06:34 +0000)
committerAllan Rae <rae@lyx.org>
Fri, 29 Sep 2000 06:34:04 +0000 (06:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1054 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/frontends/xforms/FormBase.C
src/frontends/xforms/FormBase.h

index b5219563e9e8265ef7448276164c078a9e612c89..f09f9ace78c92dc93b0c449e2abb3e50efa3bab4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-09-29  Allan Rae  <rae@lyx.org>
+
+       * src/frontends/xforms/FormBase.[Ch] (connect, disconnect): new.
+       Allow derived type to control connection and disconnection from signals
+       of its choice if desired.
+
 2000-09-28  Juergen Vigna  <jug@sad.it>
 
        * src/insets/insettabular.C (update): fixed cursor setting when
index a11d47a0e5cb8cb886fe376af1415d12fa6e2ec5..90b77d7b799a82d5af8522ed7a09cf83feeca006 100644 (file)
@@ -64,9 +64,7 @@ void FormBase::show()
                             FL_PLACE_MOUSE | FL_FREE_SIZE,
                             FL_TRANSIENT,
                             title.c_str());
-               if( uSignal_ )
-                       u_ = uSignal_->connect(slot(this, &FormBase::update));
-               h_ = hSignal_->connect(slot(this, &FormBase::hide));
+               connect();
        }
 }
 
@@ -75,8 +73,7 @@ void FormBase::hide()
 {
        if (form() && form()->visible) {
                fl_hide_form(form());
-               u_.disconnect();
-               h_.disconnect();
+               disconnect();
        }
 
        // free up the dialog for another inset
@@ -85,6 +82,24 @@ void FormBase::hide()
 }
 
 
+void FormBase::connect()
+{
+       if ( uSignal_ ) {
+               u_ = uSignal_->connect(slot(this, &FormBase::update));
+       }
+       h_ = hSignal_->connect(slot(this, &FormBase::hide));
+}
+
+
+void FormBase::disconnect()
+{
+       if (u_) {
+               u_.disconnect();
+       }
+       h_.disconnect();
+}
+
+
 int FormBase::WMHideCB(FL_FORM * form, void *)
 {
        // Ensure that the signals (u and h) are disconnected even if the
index d03525800e975607d63ef50cc65f6285d6d27adb..45c2c41536c458f5cf03223e427a91fc09cc6df2 100644 (file)
@@ -29,6 +29,7 @@ using SigC::Signal0;
 #endif
 
 /** This class is an XForms GUI base class
+    @author Angus Leeming
  */
 class FormBase : public DialogBase, public noncopyable {
 public:
@@ -59,6 +60,10 @@ protected:
        void show();
        /// Hide the dialog.
        void hide();
+       /// Connect signals
+       virtual void connect();
+       /// Disconnect signals
+       virtual void disconnect();
        /// Build the dialog
        virtual void build() = 0;
        /// Filter the inputs on callback from xforms