mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-22 16:37:28 +00:00
allow derived classes to manipulate signal connections
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1054 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3412eeffda
commit
0d5c7b928f
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user