+2000-07-13 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * src/frontends/Dialogs.h (hideCitation) : new signal to prevent
+ crashes when closing dialog to a deleted inset.
+
+ * src/insets/insetcite.[Ch] (Edit) : the return of this former
+ method! Now similar to other insets.
+
2000-07-13 Juergen Vigna <jug@sad.it>
* src/text.C (GetVisibleRow): fixed clearing of rows with insets!
--- /dev/null
+#!/bin/sh
+echo "This is NOT the listerrors program."
+echo ""
+echo "Here was the problem when we tried to build listerrors:"
+echo The NOWEB notangle was not found.
#include "intl.h"
#include "support/LAssert.h"
#include "frontends/Dialogs.h"
-#include "insets/insetcite.h"
#ifdef SIGC_CXX_NAMESPACES
using SigC::slot;
inset->InsetButtonRelease(bv_, x, y, button);
} else {
inset_hit->InsetButtonRelease(bv_, x, y, button);
-
- switch( inset_hit->LyxCode() ) {
- case Inset::CITATION_CODE:
- {
- owner_->getDialogs()->
- showCitation( (InsetCitation *)inset_hit );
- }
- break;
- default:
- inset_hit->Edit(bv_, x, y, button);
- break;
- }
+ inset_hit->Edit(bv_, x, y, button);
}
return;
}
///
Signal1<void, string const &> createCitation;
///
+ Signal1<void, InsetCitation *> hideCitation;
+ ///
Signal1<void, InsetBibtex *> showBibtex;
///
Signal1<void, InsetInfo *> showInfo;
// storing a copy because we won't be disconnecting.
d->showCitation.connect(slot(this, &FormCitation::showInset));
d->createCitation.connect(slot(this, &FormCitation::createInset));
+ d->hideCitation.connect(slot(this, &FormCitation::hideInset));
}
}
+void FormCitation::hideInset(InsetCitation * ti)
+{
+ if (inset_ == ti) {
+ inset_ = 0;
+ hide();
+ }
+}
+
+
void FormCitation::show()
{
if (!dialog_) {
blist.clear();
+ fl_freeze_form( dialog_->form_citation );
+
updateBrowser( dialog_->bibBrsr, bibkeys );
updateBrowser( dialog_->citeBrsr, citekeys );
fl_clear_browser( dialog_->infoBrsr );
setSize( size, bibPresent );
fl_set_input( dialog_->textAftr, textAfter.c_str() );
+
+ fl_unfreeze_form( dialog_->form_citation );
}
{
fl_clear_browser( browser );
- fl_freeze_form( browser->form );
for( unsigned int i = 0; i < keys.size(); ++i )
fl_add_browser_line( browser, keys[i].c_str() );
- fl_unfreeze_form( browser->form );
}
// awaiting natbib support
fl_hide_object( dialog_->textBefore );
- fl_set_object_geometry( dialog_->textAftr, 100, ypos, 250, 30 );
+ fl_set_object_position(dialog_->textAftr, 100, ypos);
+// fl_set_object_geometry( dialog_->textAftr, 100, ypos, 250, 30 );
fl_set_object_geometry( dialog_->ok, 230, ypos+50, 90, 30 );
fl_set_object_geometry( dialog_->cancel, 330, ypos+50, 90, 30 );
}
#include "DialogBase.h"
#include "LString.h"
#include <vector>
-#include "form_citation.h"
class Dialogs;
// same arguement as in Dialogs.h s/LyX/UI/
class LyXView;
class InsetCitation;
+struct FD_form_citation;
/** This class provides an XForms implementation of the FormCitation Dialog.
*/
///
void showInset( InsetCitation * );
///
+ void hideInset( InsetCitation * );
+ ///
void show();
/// Hide the dialog.
void hide();
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
#ifndef FD_form_citation_h_
#define FD_form_citation_h_
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
#ifndef FD_form_copyright_h_
#define FD_form_copyright_h_
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
#ifndef FD_form_bind_h_
#define FD_form_bind_h_
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
#ifndef FD_form_print_h_
#define FD_form_print_h_
-/** Header file generated with fdesign on Thu Jul 13 16:53:24 2000.**/
+/** Header file generated with fdesign on Fri Jul 14 09:35:06 2000.**/
#ifndef FD_form_tabular_h_
#define FD_form_tabular_h_
--- /dev/null
+# cat someFile.h | sed -f fdfixh.sed
+
+# It contains the instructions that sed requires to manipulate
+# the header files produced by fdesign into a form usable by LyX
+
+# In summary it...
+
+# s/\(extern \)\(.*\)/\1 "C" \2/
+#
+# Replaces lines such as "extern void func(args);"
+# with "extern "C" void func(args);"
+
+# /create_form_/d
+#
+# Deletes lines containing "/create_form_/d"
+
+# Rewrites as
+# typedef struct { struct someStruct {
+# ... ...
+# void *vdata; ...
+# char *cdata; };
+# long ldata;
+# ...
+# } someStruct;
+#
+# This is detailed more closely below
+
+s/\(extern \)\(.*\)/\1 "C" \2/
+/create_form_/d
+
+/typedef struct {/,/} .*;/{
+# delete lines containing ...
+/typedef struct {/d
+/vdata/d
+/cdata/d
+/ldata/d
+
+# copy remaining lines into the hold space
+H
+
+# rewrite "} someStruct;" as "struct someStruct {" and print
+s/} \(.*\);/struct \1 {/p
+
+# delete line from pattern space
+d
+}
+# swap the hold space back into the pattern space and...
+/^$/x
+{
+# rewrite "} someStruct;" as "};"
+s/} \(.*\);/};/
+}
#endif
#include "insetcite.h"
+#include "LyXView.h"
+#include "BufferView.h"
+#include "frontends/Dialogs.h"
InsetCitation::InsetCitation(string const & key, string const & note)
- : InsetCommand("cite", key, note)
+ : InsetCommand("cite", key, note), dialogs_(0)
{
}
+InsetCitation::~InsetCitation()
+{
+ if( dialogs_ != 0 )
+ dialogs_->hideCitation( this );
+}
+
string InsetCitation::getScreenLabel() const
{
string temp("[");
return temp + ']';
}
+
+void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
+{
+ dialogs_ = bv->owner()->getDialogs();
+ dialogs_->showCitation( this );
+}
+
#endif
#include "insetcommand.h"
+class Dialogs;
/** Used to insert citations
*/
explicit
InsetCitation(string const & key, string const & note = string());
///
+ ~InsetCitation();
+ ///
Inset * Clone() const {
return new InsetCitation(getContents(), getOptions());
}
///
string getScreenLabel() const;
///
- Code LyxCode() const { return CITATION_CODE; }
- ///
EDITABLE Editable() const { return IS_EDITABLE; }
+ ///
+ void Edit(BufferView *, int, int, unsigned int);
private:
///
- InsetCitation() : InsetCommand("cite") {}
+ InsetCitation() : InsetCommand("cite"), dialogs_(0) {}
+ ///
+ Dialogs * dialogs_;
};
#endif // INSET_CITE_H
#pragma implementation
#endif
+#include "gettext.h"
#include "insetloa.h"
#include "LaTeXFeatures.h"
#include "BufferView.h"
#endif
#include "insetcommand.h"
-#include "gettext.h"
class Buffer;
#pragma implementation
#endif
+#include "gettext.h"
#include "insetlof.h"
#include "BufferView.h"
#include "LyXView.h"
#define INSET_LOF_H
#include "insetcommand.h"
-#include "gettext.h"
// Created by Lgb 970527
#pragma implementation
#endif
+#include "gettext.h"
#include "insetlot.h"
#include "BufferView.h"
#include "LyXView.h"
#endif
#include "insetcommand.h"
-#include "gettext.h"
// Created by Lgb 970527
#include "lyxfunc.h"
#include "commandtags.h"
#include "buffer.h"
+#include "gettext.h"
using std::ostream;
#endif
#include "insetcommand.h"
-#include "gettext.h"
class Buffer;
#pragma implementation
#endif
+#include "gettext.h"
#include "insettoc.h"
#include "commandtags.h"
#include "lyxfunc.h"
#endif
#include "insetcommand.h"
-#include "gettext.h"
class Buffer;
///
EXTERNAL_CODE,
///
- CITATION_CODE,
- ///
THEOREM_CODE
};