+2000-10-19 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * src/frontends/xforms/FormBase.[Ch]:
+ * src/frontends/xforms/FormXXX.[Ch] where XXX is a FormBase daughter:
+ read the xforms manual to discover that fl_set_form_minsize()/maxsize()
+ work only for the next call to fl_show_form(). The correct place to set
+ them, therefore is in connect() immediately BEFORE fl_show_form(). Now
+ done. FormBase also stores minw_, minh_ itself. All dialogs derived
+ from FormBase have the minimum size set; no more stupid crashes with
+ tabbed folders etc.
+
+2000-10-20 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+
+ * lib/ui/default.ui: fix shortcut for Insert->Include File.
+
2000-10-19 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+ * lib/CREDITS: add Andre' Poenitz and Kornelia Pietsch
+
* src/support/lyxlib.h: changed second argument of mkdir to
unsigned long int (unsigned int would probably have been enough,
but...). Removed <sys/types.h> header.
2000-09-27 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/insets/insettext.C (Ascii): return numer of '\n' in the text
- outputed to the ostream.
+ output to the ostream.
* several files: fixed types based on warnings from cxx
What's new in LyX version 1.1.6?
--------------------------------
-As for all of the 1.1.x versions of LyX, this release contains a lot
+As with all of the 1.1.x versions of LyX, this release contains a lot
of new code: in particular, half of the changes described in the
ChangeLog (which dates back to the 1.1.0 release) describe changes in
LyX 1.1.6!
from the older development version:
- many popups have been rewritten to use the new GUI-I scheme. In the
- process they have gotten a nice cleanup: the Document and Paragraph
+ process they have received a nice cleanup: the Document and Paragraph
popups now contain in one single place what was previously scattered
in many places. Similarly, the citation and cross reference popups
have been overhauled.
- LyX now has a Preference popup where you can change most of your
lyxrc settings [Allan, details?]
-- The menus can now be defined in a text file, and they automatically
+- the menus can now be defined in a text file, and they automatically
display the keyboard bindings associated with commands.
- it is now possible to provide your own icons for the toolbar.
- last but not least, work has begun on a KDE and a Gnome frontend for
LyX. They are not officially supported for this version, but this
- can give you an idea of what is happening.
+ will give you an idea of what is happening.
Other major changes in 1.1.6 include:
- the table support has been completely rewritten. It is now a modular
- object (inset) which owns for each cell a (also) newly written text
+ object (inset), each cell of which owns a (also) newly written text
inset. This now permits automatic text-wrap inside a tabular
cell (if you define a width), multiparagraph mode AND setting of
layouts for the paragraphs (lists inside a tabular cell!). Last but
- not least, a wide tabular now scroll automatically so that all of it
+ not least, a wide tabular now scrolls automatically so that all of it
is visible without the need to enlarge the window!
- While there are yet no other new features, they will be now MUCH
+ While there are as yet no other new features, they will be now MUCH
easier to add. It may be that because of being "young" code some
features may not work right now, but at least it is much
better than before.
- LyX can do command line exports without opening any GUI components.
-- The multilingual support was improved. It is now possible to use in a
+- The multilingual support has been improved. It is now possible to use in a
document languages with different encodings, e.g. German (iso8859-1) and
Czech (iso8859-2). Such a document can be viewed on screen using an
iso10646-1 (Unicode) font. However, it is (currently) not possible to
@iE-mail: sp2joap1@ida.his.se
po-file for Swedish, a tool for picking shortcuts,
bug reports and hacking at random
+@bKornelia Pietsch
+@iE-mail: pietsch@mathematik.tu-chemnitz.de
+ provided siamltex document class
+@bAndré Poenitz
+@iE-mail: poenitz@HTWM.De
+ --export and --import command line options
+ file io with streams
@bAlkis Polyzotis
Keymap work.
@bBernhard Psaier
Item "Figure...|g" "figure-insert"
Item "Tabular...|T" "dialog-tabular-insert"
Separator
- Item "Include File...|I" "buffer-child-insert"
+ Item "Include File...|c" "buffer-child-insert"
Submenu "Import ascii file|a" "insert_ascii"
Item "Insert LyX file...|X" "file-insert"
Item "Insert external material...|e" "external-insert"
FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t,
ButtonPolicy * bp, char const * close, char const * cancel)
- : lv_(lv), bc_(bp, cancel, close), d_(d), h_(0), title(t), bp_(bp)
+ : lv_(lv), bc_(bp, cancel, close), d_(d), h_(0), title(t), bp_(bp),
+ minw_(0), minh_(0)
{}
}
+void FormBase::connect()
+{
+ fl_set_form_minsize( form(), minw_, minh_ );
+}
+
+
void FormBase::show()
{
if (!form()) {
if (form()->visible) {
fl_raise_form(form());
} else {
+ // calls to fl_set_form_minsize/maxsize apply only to the next
+ // fl_show_form(), so connect() comes first.
+ connect();
fl_show_form(form(),
FL_PLACE_MOUSE | FL_FREE_SIZE,
FL_TRANSIENT,
title.c_str());
- connect();
}
}
void FormBaseBI::connect()
{
h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide));
+ FormBase::connect();
}
connect(slot(this, &FormBaseBD::update));
h_ = d_->hideBufferDependent.
connect(slot(this, &FormBaseBD::hide));
+ FormBase::connect();
}
*/
class FormBase : public DialogBase, public noncopyable {
public:
- /** Constructor.
- #FormBase(lv, d, _("DialogName"), BUFFER_DEPENDENT, new ButtonPolicy)#
- */
- FormBase(LyXView *, Dialogs *, string const &,
- ButtonPolicy *, char const *, char const *);
- ///
- virtual ~FormBase();
-
/// Callback functions
static int WMHideCB(FL_FORM *, void *);
///
static void RestoreCB(FL_OBJECT *, long);
protected: // methods
+ /** Constructor.
+ #FormBase(lv, d, _("DialogName"), BUFFER_DEPENDENT, new ButtonPolicy)#
+ */
+ FormBase(LyXView *, Dialogs *, string const &,
+ ButtonPolicy *, char const *, char const *);
+ ///
+ virtual ~FormBase();
+
/// Create the dialog if necessary, update it and display it.
void show();
/// Hide the dialog.
/// bool indicates if a buffer switch took place
virtual void update(bool = false) {}
/// Connect signals. Also perform any necessary initialisation.
- virtual void connect() = 0;
+ virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect() = 0;
/// Build the dialog
/// Pointer to the actual instantiation of xform's form
virtual FL_FORM * form() const = 0;
-protected: // data
/** Which LyXFunc do we use?
We could modify Dialogs to have a visible LyXFunc* instead and
save a couple of bytes per dialog.
string title;
///
ButtonPolicy * bp_;
+ /// Overcome a dumb xforms sizing bug
+ mutable int minw_;
+ ///
+ mutable int minh_;
};
an update() function which is also supported by restore().
*/
class FormBaseBI : public FormBase {
-public:
+protected:
/// Constructor
FormBaseBI(LyXView *, Dialogs *, string const &,
ButtonPolicy * bp = new OkApplyCancelPolicy,
char const * close = N_("Close"),
char const * cancel = N_("Cancel"));
-protected:
/// Connect signals
virtual void connect();
/// Disconnect signals
/** This class is an XForms GUI base class for Buffer Dependent dialogs
*/
class FormBaseBD : public FormBase {
-public:
+protected:
/// Constructor
FormBaseBD(LyXView *, Dialogs *, string const &,
ButtonPolicy * bp = new OkApplyCancelReadOnlyPolicy,
char const * close = N_("Close"),
char const * cancel = N_("Cancel"));
-protected:
/// Connect signals
virtual void connect();
/// Disconnect signals
using std::min;
using std::find;
-static int min_wform;
FormCitation::FormCitation(LyXView * lv, Dialogs * d)
: FormCommand(lv, d, _("Citation")), dialog_(0)
}
+void FormCitation::connect()
+{
+ fl_set_form_maxsize( dialog_->form, 3*minw_, minh_ );
+ FormCommand::connect();
+}
+
+
void FormCitation::disconnect()
{
citekeys.clear();
void FormCitation::build()
{
dialog_ = build_citation();
- min_wform = dialog_->form->w;
+
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
static int const htext = dialog_->textAftr->h;
static int const hok = dialog_->button_ok->h;
- int const wform = dialog_->form->w;
int hform = dh1 + hbrsr + dh1;
if ( bibPresent ) hform += hinfo + dh1;
if ( natbib ) hform += hstyle + dh1 + htext + dh2;
hform += htext + dh1 + hok + dh2;
- bool const sizeSet = ( hform != dialog_->form->h );
- if ( sizeSet ) fl_set_form_size( dialog_->form, wform, hform );
-
- // No vertical resizing is allowed
- // min_wform set in build()
- fl_set_form_minsize( dialog_->form, min_wform, hform );
- fl_set_form_maxsize( dialog_->form, 3*min_wform, hform );
-
- if ( !sizeSet ) return;
+ if ( hform != minh_ ) {
+ minh_ = hform;
+ fl_set_form_size( dialog_->form, minw_, minh_ );
+ } else
+ return;
int x = 0;
int y = 0;
- fl_set_object_geometry( dialog_->box, x, y, wform, hform );
+ fl_set_object_geometry( dialog_->box, x, y, minw_, minh_ );
x = dialog_->citeBrsr->x;
y += dh1;
///
OFF
};
+ /// Connect signals etc. Set form's max size.
+ virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
void FormCopyright::build()
{
dialog_ = build_copyright();
+
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
bc_.setUndoAll(dialog_->button_restore);
bc_.refresh();
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
+
// the document paper form
paper_ = build_doc_paper();
fl_addto_choice(paper_->choice_papersize2,
#include "form_error.h"
#include "insets/inseterror.h"
-static int minh, minw;
-
FormError::FormError( LyXView * lv, Dialogs * d )
: FormInset( lv, d, _("LaTeX Error") ),
dialog_(0), inset_(0), message_("")
return;
}
- fl_set_form_minsize(form(), minw, minh);
fl_set_object_label(dialog_->message, message_.c_str());
}
{
dialog_ = build_error();
- // XFORMS bug workaround
- // Define the min/max dimensions. Actually applied in update()
- minw = form()->w; minh = form()->h;
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
#include "lyxfunc.h"
FormIndex::FormIndex(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Index")), minh(0), minw(0), dialog_(0)
+ : FormCommand(lv, d, _("Index")), dialog_(0)
{
// let the dialog be shown
// These are permanent connections so we won't bother
}
+void FormIndex::connect()
+{
+ fl_set_form_maxsize( form(), 2*minw_, minh_ );
+ FormCommand::connect();
+}
+
+
void FormIndex::build()
{
dialog_ = build_index();
#ifdef WITH_WARNINGS
#warning use the buttoncontroller
#endif
- // XFORMS bug workaround
- // Define the min/max dimensions. Actually applied in update()
- minw = form()->w; minh = form()->h;
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
return;
}
- fl_set_form_minsize(form(), minw, minh);
- fl_set_form_maxsize(form(), 2*minw, minh);
-
fl_set_input(dialog_->key, params.getContents().c_str());
if ( lv_->buffer()->isReadonly() ) {
///
~FormIndex();
private:
+ /// Connect signals etc. Set form's max size.
+ virtual void connect();
/// Build the dialog
virtual void build();
/// Update dialog before showing it
virtual FL_FORM * form() const;
///
FD_form_index * build_index();
- ///
- int minh;
- ///
- int minw;
/// Real GUI implementation.
FD_form_index * dialog_;
};
connect(slot(this, &FormInset::update));
h_ = d_->hideBufferDependent.
connect(slot(this, &FormInset::hide));
+ FormBase::connect();
}
/** This class is an XForms GUI base class to insets
*/
class FormInset : public FormBaseBD {
-public:
+protected:
/// Constructor
FormInset( LyXView *, Dialogs *, string const &,
ButtonPolicy * bp = new OkCancelReadOnlyPolicy,
char const * close = N_("Close"),
char const * cancel = N_("Cancel"));
-protected: // methods
/// Connect signals. Also perform any necessary initialisation.
virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
-protected: // data
/// inset::hide connection.
Connection ih_;
};
InsetCommand
*/
class FormCommand : public FormInset {
-public:
+protected:
/// Constructor
FormCommand( LyXView *, Dialogs *, string const &,
ButtonPolicy * = new OkCancelReadOnlyPolicy,
char const * close = N_("Close"),
char const * cancel = N_("Cancel"));
-protected:
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
// the tabbed folder
dialog_ = build_tabbed_paragraph();
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
+
// manage the restore, ok, apply and cancel/close buttons
bc_.setOK(dialog_->button_ok);
bc_.setApply(dialog_->button_apply);
: FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy),
dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
lnf_general_(0), screen_fonts_(0), interface_(0),
- printer_(0), paths_(0), outputs_general_(0), minw_(0), minh_(0)
+ printer_(0), paths_(0), outputs_general_(0)
{
// let the dialog be shown
// This is a permanent connection so we won't bother
bc_.refresh();
// Workaround dumb xforms sizing bug
- minw_ = dialog_->form->w;
- minh_ = dialog_->form->h;
+ minw_ = form()->w;
+ minh_ = form()->h;
// build the tab folders
outputs_tab_ = build_outer_tab();
}
-void FormPreferences::connect()
-{
- FormBaseBI::connect();
- fl_set_form_minsize(dialog_->form,
- minw_,
- minh_);
-}
-
-
void FormPreferences::apply()
{
// set the new lyxrc entries
///
~FormPreferences();
private:
- ///
- virtual void connect();
/// Update the dialog.
virtual void update(bool = false);
///
FD_form_paths * paths_;
///
FD_form_outputs_general * outputs_general_;
- /// Overcome a dumb xforms sizing bug
- int minw_;
- ///
- int minh_;
};
#endif
{
dialog_ = build_print();
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
+
// manage the ok, apply and cancel/close buttons
bc_.setOK(dialog_->button_ok);
bc_.setApply(dialog_->button_apply);
}
-void FormPrint::connect()
-{
- FormBaseBD::connect();
- fl_set_form_minsize(dialog_->form,
- dialog_->form->w,
- dialog_->form->h);
-}
-
-
FL_FORM * FormPrint::form() const
{
if (dialog_) return dialog_->form;
virtual void apply();
/// Filter the inputs
virtual bool input(FL_OBJECT *, long);
- ///
- virtual void connect();
/// Pointer to the actual instantiation of the xform's form
virtual FL_FORM * form() const;
/// Build the dialog
using std::sort;
using std::vector;
-static int formw;
-static int formh;
-
FormRef::FormRef(LyXView * lv, Dialogs * d)
: FormCommand(lv, d, _("Reference")), toggle(GOBACK), dialog_(0)
{
}
+void FormRef::connect()
+{
+ fl_set_form_maxsize( form(), 2*minw_, minh_ );
+ FormCommand::connect();
+}
+
+
void FormRef::disconnect()
{
refs.clear();
fl_addto_choice(dialog_->type,
_(" Ref | Page | TextRef | TextPage | PrettyRef "));
- // XFORMS bug workaround
- // Define the min/max dimensions. Actually applied in update()
- formw = form()->w, formh = form()->h;
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
// Name is irrelevant to LaTeX documents
if ( lv_->buffer()->isLatex() ) {
fl_show_object( dialog_->button_update );
fl_show_object( dialog_->sort );
- setSize( formw, formh, 0 );
+ setSize( minw_, minh_, 0 );
fl_deactivate_object( dialog_->type );
fl_set_object_lcol( dialog_->type, FL_INACTIVE );
fl_hide_object( dialog_->button_update );
fl_hide_object( dialog_->sort );
- setSize( 250, formh, 280 );
+ setSize( 250, minh_, 280 );
fl_activate_object( dialog_->type );
fl_set_object_lcol( dialog_->type, FL_BLACK );
static int x6 = dialog_->button_cancel->x;
static int y6 = dialog_->button_cancel->y;
- if ( form()->w != w )
- fl_set_form_size( form(), w, h );
-
- fl_set_form_minsize( form(), w, h );
- fl_set_form_maxsize( form(), 2*w, h );
-
- if ( form()->w == w ) return;
-
+ if ( form()->w != w ) {
+ minw_ = w;
+ minh_ = h;
+ fl_set_form_size( form(), minw_, minh_ );
+ } else
+ return;
+
fl_set_object_position( dialog_->name, x1-dx, y1 );
fl_set_object_position( dialog_->ref, x2-dx, y2 );
fl_set_object_position( dialog_->type, x3-dx, y3 );
GOFIRST
};
+ /// Connect signals etc. Set form's max size.
+ virtual void connect();
/// Disconnect signals. Also perform any necessary housekeeping.
virtual void disconnect();
void FormToc::build()
{
dialog_ = build_toc();
+
fl_addto_choice(dialog_->type,
_(" TOC | LOF | LOT | LOA "));
// Don't need to limit size of this dialog
+ // (but fixing min size is a GOOD thing).
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
#include "lyxfunc.h"
FormUrl::FormUrl(LyXView * lv, Dialogs * d)
- : FormCommand(lv, d, _("Url")), minh(0), minw(0), dialog_(0)
+ : FormCommand(lv, d, _("Url")), dialog_(0)
{
// let the dialog be shown
// These are permanent connections so we won't bother
}
+void FormUrl::connect()
+{
+ fl_set_form_maxsize( form(), 2*minw_, minh_ );
+ FormCommand::connect();
+}
+
+
void FormUrl::build()
{
dialog_ = build_url();
#ifdef WITH_WARNINGS
#warning use the buttoncontroller
#endif
- // XFORMS bug workaround
- // Define the min/max dimensions. Actually applied in update()
- minw = form()->w;
- minh = form()->h;
+ // Workaround dumb xforms sizing bug
+ minw_ = form()->w;
+ minh_ = form()->h;
}
return;
}
- fl_set_form_minsize(form(), minw, minh);
- fl_set_form_maxsize(form(), 2*minw, minh);
-
fl_set_input(dialog_->url, params.getContents().c_str());
fl_set_input(dialog_->name, params.getOptions().c_str());
///
~FormUrl();
private:
+ /// Connect signals etc. Set form's max size.
+ virtual void connect();
/// Build the dialog
virtual void build();
/// Update dialog before showing it
virtual FL_FORM * form() const;
///
FD_form_url * build_url();
- ///
- int minh;
- ///
- int minw;
/// Real GUI implementation.
FD_form_url * dialog_;
};