mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
The forms resize patch, and small updates
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1142 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
edbcab7c2d
commit
8effd3eec4
19
ChangeLog
19
ChangeLog
@ -1,5 +1,22 @@
|
|||||||
|
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>
|
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
|
* src/support/lyxlib.h: changed second argument of mkdir to
|
||||||
unsigned long int (unsigned int would probably have been enough,
|
unsigned long int (unsigned int would probably have been enough,
|
||||||
but...). Removed <sys/types.h> header.
|
but...). Removed <sys/types.h> header.
|
||||||
@ -1469,7 +1486,7 @@
|
|||||||
2000-09-27 Lars Gullik Bjønnes <larsbj@lyx.org>
|
2000-09-27 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||||
|
|
||||||
* src/insets/insettext.C (Ascii): return numer of '\n' in the text
|
* 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
|
* several files: fixed types based on warnings from cxx
|
||||||
|
|
||||||
|
16
NEWS
16
NEWS
@ -1,7 +1,7 @@
|
|||||||
What's new in LyX version 1.1.6?
|
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
|
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
|
ChangeLog (which dates back to the 1.1.0 release) describe changes in
|
||||||
LyX 1.1.6!
|
LyX 1.1.6!
|
||||||
@ -12,7 +12,7 @@ GUI-independent branch of development has been merged, as well as code
|
|||||||
from the older development version:
|
from the older development version:
|
||||||
|
|
||||||
- many popups have been rewritten to use the new GUI-I scheme. In the
|
- 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
|
popups now contain in one single place what was previously scattered
|
||||||
in many places. Similarly, the citation and cross reference popups
|
in many places. Similarly, the citation and cross reference popups
|
||||||
have been overhauled.
|
have been overhauled.
|
||||||
@ -20,26 +20,26 @@ from the older development version:
|
|||||||
- LyX now has a Preference popup where you can change most of your
|
- LyX now has a Preference popup where you can change most of your
|
||||||
lyxrc settings [Allan, details?]
|
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.
|
display the keyboard bindings associated with commands.
|
||||||
|
|
||||||
- it is now possible to provide your own icons for the toolbar.
|
- 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
|
- 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
|
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:
|
Other major changes in 1.1.6 include:
|
||||||
|
|
||||||
- the table support has been completely rewritten. It is now a modular
|
- 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
|
inset. This now permits automatic text-wrap inside a tabular
|
||||||
cell (if you define a width), multiparagraph mode AND setting of
|
cell (if you define a width), multiparagraph mode AND setting of
|
||||||
layouts for the paragraphs (lists inside a tabular cell!). Last but
|
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!
|
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
|
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
|
features may not work right now, but at least it is much
|
||||||
better than before.
|
better than before.
|
||||||
@ -60,7 +60,7 @@ Other major changes in 1.1.6 include:
|
|||||||
|
|
||||||
- LyX can do command line exports without opening any GUI components.
|
- 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
|
document languages with different encodings, e.g. German (iso8859-1) and
|
||||||
Czech (iso8859-2). Such a document can be viewed on screen using an
|
Czech (iso8859-2). Such a document can be viewed on screen using an
|
||||||
iso10646-1 (Unicode) font. However, it is (currently) not possible to
|
iso10646-1 (Unicode) font. However, it is (currently) not possible to
|
||||||
|
@ -136,6 +136,13 @@
|
|||||||
@iE-mail: sp2joap1@ida.his.se
|
@iE-mail: sp2joap1@ida.his.se
|
||||||
po-file for Swedish, a tool for picking shortcuts,
|
po-file for Swedish, a tool for picking shortcuts,
|
||||||
bug reports and hacking at random
|
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
|
@bAlkis Polyzotis
|
||||||
Keymap work.
|
Keymap work.
|
||||||
@bBernhard Psaier
|
@bBernhard Psaier
|
||||||
|
@ -178,7 +178,7 @@ Menuset
|
|||||||
Item "Figure...|g" "figure-insert"
|
Item "Figure...|g" "figure-insert"
|
||||||
Item "Tabular...|T" "dialog-tabular-insert"
|
Item "Tabular...|T" "dialog-tabular-insert"
|
||||||
Separator
|
Separator
|
||||||
Item "Include File...|I" "buffer-child-insert"
|
Item "Include File...|c" "buffer-child-insert"
|
||||||
Submenu "Import ascii file|a" "insert_ascii"
|
Submenu "Import ascii file|a" "insert_ascii"
|
||||||
Item "Insert LyX file...|X" "file-insert"
|
Item "Insert LyX file...|X" "file-insert"
|
||||||
Item "Insert external material...|e" "external-insert"
|
Item "Insert external material...|e" "external-insert"
|
||||||
|
@ -32,7 +32,8 @@ C_GENERICCB(FormBase, RestoreCB)
|
|||||||
|
|
||||||
FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t,
|
FormBase::FormBase(LyXView * lv, Dialogs * d, string const & t,
|
||||||
ButtonPolicy * bp, char const * close, char const * cancel)
|
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)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -42,6 +43,12 @@ FormBase::~FormBase()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormBase::connect()
|
||||||
|
{
|
||||||
|
fl_set_form_minsize( form(), minw_, minh_ );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormBase::show()
|
void FormBase::show()
|
||||||
{
|
{
|
||||||
if (!form()) {
|
if (!form()) {
|
||||||
@ -57,11 +64,13 @@ void FormBase::show()
|
|||||||
if (form()->visible) {
|
if (form()->visible) {
|
||||||
fl_raise_form(form());
|
fl_raise_form(form());
|
||||||
} else {
|
} 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_show_form(form(),
|
||||||
FL_PLACE_MOUSE | FL_FREE_SIZE,
|
FL_PLACE_MOUSE | FL_FREE_SIZE,
|
||||||
FL_TRANSIENT,
|
FL_TRANSIENT,
|
||||||
title.c_str());
|
title.c_str());
|
||||||
connect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,6 +146,7 @@ FormBaseBI::FormBaseBI(LyXView * lv, Dialogs * d, string const & t,
|
|||||||
void FormBaseBI::connect()
|
void FormBaseBI::connect()
|
||||||
{
|
{
|
||||||
h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide));
|
h_ = d_->hideAll.connect(slot(this, &FormBaseBI::hide));
|
||||||
|
FormBase::connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,6 +170,7 @@ void FormBaseBD::connect()
|
|||||||
connect(slot(this, &FormBaseBD::update));
|
connect(slot(this, &FormBaseBD::update));
|
||||||
h_ = d_->hideBufferDependent.
|
h_ = d_->hideBufferDependent.
|
||||||
connect(slot(this, &FormBaseBD::hide));
|
connect(slot(this, &FormBaseBD::hide));
|
||||||
|
FormBase::connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,14 +33,6 @@ class LyXView;
|
|||||||
*/
|
*/
|
||||||
class FormBase : public DialogBase, public noncopyable {
|
class FormBase : public DialogBase, public noncopyable {
|
||||||
public:
|
public:
|
||||||
/** Constructor.
|
|
||||||
#FormBase(lv, d, _("DialogName"), BUFFER_DEPENDENT, new ButtonPolicy)#
|
|
||||||
*/
|
|
||||||
FormBase(LyXView *, Dialogs *, string const &,
|
|
||||||
ButtonPolicy *, char const *, char const *);
|
|
||||||
///
|
|
||||||
virtual ~FormBase();
|
|
||||||
|
|
||||||
/// Callback functions
|
/// Callback functions
|
||||||
static int WMHideCB(FL_FORM *, void *);
|
static int WMHideCB(FL_FORM *, void *);
|
||||||
///
|
///
|
||||||
@ -55,6 +47,14 @@ public:
|
|||||||
static void RestoreCB(FL_OBJECT *, long);
|
static void RestoreCB(FL_OBJECT *, long);
|
||||||
|
|
||||||
protected: // methods
|
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.
|
/// Create the dialog if necessary, update it and display it.
|
||||||
void show();
|
void show();
|
||||||
/// Hide the dialog.
|
/// Hide the dialog.
|
||||||
@ -62,7 +62,7 @@ protected: // methods
|
|||||||
/// bool indicates if a buffer switch took place
|
/// bool indicates if a buffer switch took place
|
||||||
virtual void update(bool = false) {}
|
virtual void update(bool = false) {}
|
||||||
/// Connect signals. Also perform any necessary initialisation.
|
/// Connect signals. Also perform any necessary initialisation.
|
||||||
virtual void connect() = 0;
|
virtual void connect();
|
||||||
/// Disconnect signals. Also perform any necessary housekeeping.
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
||||||
virtual void disconnect() = 0;
|
virtual void disconnect() = 0;
|
||||||
/// Build the dialog
|
/// Build the dialog
|
||||||
@ -91,7 +91,6 @@ protected: // methods
|
|||||||
/// Pointer to the actual instantiation of xform's form
|
/// Pointer to the actual instantiation of xform's form
|
||||||
virtual FL_FORM * form() const = 0;
|
virtual FL_FORM * form() const = 0;
|
||||||
|
|
||||||
protected: // data
|
|
||||||
/** Which LyXFunc do we use?
|
/** Which LyXFunc do we use?
|
||||||
We could modify Dialogs to have a visible LyXFunc* instead and
|
We could modify Dialogs to have a visible LyXFunc* instead and
|
||||||
save a couple of bytes per dialog.
|
save a couple of bytes per dialog.
|
||||||
@ -107,6 +106,10 @@ protected: // data
|
|||||||
string title;
|
string title;
|
||||||
///
|
///
|
||||||
ButtonPolicy * bp_;
|
ButtonPolicy * bp_;
|
||||||
|
/// Overcome a dumb xforms sizing bug
|
||||||
|
mutable int minw_;
|
||||||
|
///
|
||||||
|
mutable int minh_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -115,14 +118,13 @@ protected: // data
|
|||||||
an update() function which is also supported by restore().
|
an update() function which is also supported by restore().
|
||||||
*/
|
*/
|
||||||
class FormBaseBI : public FormBase {
|
class FormBaseBI : public FormBase {
|
||||||
public:
|
protected:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
FormBaseBI(LyXView *, Dialogs *, string const &,
|
FormBaseBI(LyXView *, Dialogs *, string const &,
|
||||||
ButtonPolicy * bp = new OkApplyCancelPolicy,
|
ButtonPolicy * bp = new OkApplyCancelPolicy,
|
||||||
char const * close = N_("Close"),
|
char const * close = N_("Close"),
|
||||||
char const * cancel = N_("Cancel"));
|
char const * cancel = N_("Cancel"));
|
||||||
|
|
||||||
protected:
|
|
||||||
/// Connect signals
|
/// Connect signals
|
||||||
virtual void connect();
|
virtual void connect();
|
||||||
/// Disconnect signals
|
/// Disconnect signals
|
||||||
@ -133,14 +135,13 @@ protected:
|
|||||||
/** This class is an XForms GUI base class for Buffer Dependent dialogs
|
/** This class is an XForms GUI base class for Buffer Dependent dialogs
|
||||||
*/
|
*/
|
||||||
class FormBaseBD : public FormBase {
|
class FormBaseBD : public FormBase {
|
||||||
public:
|
protected:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
FormBaseBD(LyXView *, Dialogs *, string const &,
|
FormBaseBD(LyXView *, Dialogs *, string const &,
|
||||||
ButtonPolicy * bp = new OkApplyCancelReadOnlyPolicy,
|
ButtonPolicy * bp = new OkApplyCancelReadOnlyPolicy,
|
||||||
char const * close = N_("Close"),
|
char const * close = N_("Close"),
|
||||||
char const * cancel = N_("Cancel"));
|
char const * cancel = N_("Cancel"));
|
||||||
|
|
||||||
protected:
|
|
||||||
/// Connect signals
|
/// Connect signals
|
||||||
virtual void connect();
|
virtual void connect();
|
||||||
/// Disconnect signals
|
/// Disconnect signals
|
||||||
|
@ -34,7 +34,6 @@ using std::max;
|
|||||||
using std::min;
|
using std::min;
|
||||||
using std::find;
|
using std::find;
|
||||||
|
|
||||||
static int min_wform;
|
|
||||||
|
|
||||||
FormCitation::FormCitation(LyXView * lv, Dialogs * d)
|
FormCitation::FormCitation(LyXView * lv, Dialogs * d)
|
||||||
: FormCommand(lv, d, _("Citation")), dialog_(0)
|
: FormCommand(lv, d, _("Citation")), dialog_(0)
|
||||||
@ -60,6 +59,13 @@ FL_FORM * FormCitation::form() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormCitation::connect()
|
||||||
|
{
|
||||||
|
fl_set_form_maxsize( dialog_->form, 3*minw_, minh_ );
|
||||||
|
FormCommand::connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormCitation::disconnect()
|
void FormCitation::disconnect()
|
||||||
{
|
{
|
||||||
citekeys.clear();
|
citekeys.clear();
|
||||||
@ -73,7 +79,10 @@ void FormCitation::disconnect()
|
|||||||
void FormCitation::build()
|
void FormCitation::build()
|
||||||
{
|
{
|
||||||
dialog_ = build_citation();
|
dialog_ = build_citation();
|
||||||
min_wform = dialog_->form->w;
|
|
||||||
|
// Workaround dumb xforms sizing bug
|
||||||
|
minw_ = form()->w;
|
||||||
|
minh_ = form()->h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -223,25 +232,20 @@ void FormCitation::setSize( int hbrsr, bool bibPresent ) const
|
|||||||
static int const htext = dialog_->textAftr->h;
|
static int const htext = dialog_->textAftr->h;
|
||||||
static int const hok = dialog_->button_ok->h;
|
static int const hok = dialog_->button_ok->h;
|
||||||
|
|
||||||
int const wform = dialog_->form->w;
|
|
||||||
int hform = dh1 + hbrsr + dh1;
|
int hform = dh1 + hbrsr + dh1;
|
||||||
if ( bibPresent ) hform += hinfo + dh1;
|
if ( bibPresent ) hform += hinfo + dh1;
|
||||||
if ( natbib ) hform += hstyle + dh1 + htext + dh2;
|
if ( natbib ) hform += hstyle + dh1 + htext + dh2;
|
||||||
hform += htext + dh1 + hok + dh2;
|
hform += htext + dh1 + hok + dh2;
|
||||||
|
|
||||||
bool const sizeSet = ( hform != dialog_->form->h );
|
if ( hform != minh_ ) {
|
||||||
if ( sizeSet ) fl_set_form_size( dialog_->form, wform, hform );
|
minh_ = hform;
|
||||||
|
fl_set_form_size( dialog_->form, minw_, minh_ );
|
||||||
// No vertical resizing is allowed
|
} else
|
||||||
// min_wform set in build()
|
return;
|
||||||
fl_set_form_minsize( dialog_->form, min_wform, hform );
|
|
||||||
fl_set_form_maxsize( dialog_->form, 3*min_wform, hform );
|
|
||||||
|
|
||||||
if ( !sizeSet ) return;
|
|
||||||
|
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 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;
|
x = dialog_->citeBrsr->x;
|
||||||
y += dh1;
|
y += dh1;
|
||||||
|
@ -47,6 +47,8 @@ private:
|
|||||||
///
|
///
|
||||||
OFF
|
OFF
|
||||||
};
|
};
|
||||||
|
/// Connect signals etc. Set form's max size.
|
||||||
|
virtual void connect();
|
||||||
/// Disconnect signals. Also perform any necessary housekeeping.
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
||||||
virtual void disconnect();
|
virtual void disconnect();
|
||||||
|
|
||||||
|
@ -42,4 +42,8 @@ FL_FORM * FormCopyright::form() const
|
|||||||
void FormCopyright::build()
|
void FormCopyright::build()
|
||||||
{
|
{
|
||||||
dialog_ = build_copyright();
|
dialog_ = build_copyright();
|
||||||
|
|
||||||
|
// Workaround dumb xforms sizing bug
|
||||||
|
minw_ = form()->w;
|
||||||
|
minh_ = form()->h;
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,10 @@ void FormDocument::build()
|
|||||||
bc_.setUndoAll(dialog_->button_restore);
|
bc_.setUndoAll(dialog_->button_restore);
|
||||||
bc_.refresh();
|
bc_.refresh();
|
||||||
|
|
||||||
|
// Workaround dumb xforms sizing bug
|
||||||
|
minw_ = form()->w;
|
||||||
|
minh_ = form()->h;
|
||||||
|
|
||||||
// the document paper form
|
// the document paper form
|
||||||
paper_ = build_doc_paper();
|
paper_ = build_doc_paper();
|
||||||
fl_addto_choice(paper_->choice_papersize2,
|
fl_addto_choice(paper_->choice_papersize2,
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#include "form_error.h"
|
#include "form_error.h"
|
||||||
#include "insets/inseterror.h"
|
#include "insets/inseterror.h"
|
||||||
|
|
||||||
static int minh, minw;
|
|
||||||
|
|
||||||
FormError::FormError( LyXView * lv, Dialogs * d )
|
FormError::FormError( LyXView * lv, Dialogs * d )
|
||||||
: FormInset( lv, d, _("LaTeX Error") ),
|
: FormInset( lv, d, _("LaTeX Error") ),
|
||||||
dialog_(0), inset_(0), message_("")
|
dialog_(0), inset_(0), message_("")
|
||||||
@ -75,7 +73,6 @@ void FormError::update(bool switched)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fl_set_form_minsize(form(), minw, minh);
|
|
||||||
fl_set_object_label(dialog_->message, message_.c_str());
|
fl_set_object_label(dialog_->message, message_.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +81,7 @@ void FormError::build()
|
|||||||
{
|
{
|
||||||
dialog_ = build_error();
|
dialog_ = build_error();
|
||||||
|
|
||||||
// XFORMS bug workaround
|
// Workaround dumb xforms sizing bug
|
||||||
// Define the min/max dimensions. Actually applied in update()
|
minw_ = form()->w;
|
||||||
minw = form()->w; minh = form()->h;
|
minh_ = form()->h;
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "lyxfunc.h"
|
#include "lyxfunc.h"
|
||||||
|
|
||||||
FormIndex::FormIndex(LyXView * lv, Dialogs * d)
|
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
|
// let the dialog be shown
|
||||||
// These are permanent connections so we won't bother
|
// These are permanent connections so we won't bother
|
||||||
@ -49,6 +49,13 @@ FL_FORM * FormIndex::form() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormIndex::connect()
|
||||||
|
{
|
||||||
|
fl_set_form_maxsize( form(), 2*minw_, minh_ );
|
||||||
|
FormCommand::connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormIndex::build()
|
void FormIndex::build()
|
||||||
{
|
{
|
||||||
dialog_ = build_index();
|
dialog_ = build_index();
|
||||||
@ -56,9 +63,9 @@ void FormIndex::build()
|
|||||||
#ifdef WITH_WARNINGS
|
#ifdef WITH_WARNINGS
|
||||||
#warning use the buttoncontroller
|
#warning use the buttoncontroller
|
||||||
#endif
|
#endif
|
||||||
// XFORMS bug workaround
|
// Workaround dumb xforms sizing bug
|
||||||
// Define the min/max dimensions. Actually applied in update()
|
minw_ = form()->w;
|
||||||
minw = form()->w; minh = form()->h;
|
minh_ = form()->h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -69,9 +76,6 @@ void FormIndex::update(bool switched)
|
|||||||
return;
|
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());
|
fl_set_input(dialog_->key, params.getContents().c_str());
|
||||||
|
|
||||||
if ( lv_->buffer()->isReadonly() ) {
|
if ( lv_->buffer()->isReadonly() ) {
|
||||||
|
@ -28,6 +28,8 @@ public:
|
|||||||
///
|
///
|
||||||
~FormIndex();
|
~FormIndex();
|
||||||
private:
|
private:
|
||||||
|
/// Connect signals etc. Set form's max size.
|
||||||
|
virtual void connect();
|
||||||
/// Build the dialog
|
/// Build the dialog
|
||||||
virtual void build();
|
virtual void build();
|
||||||
/// Update dialog before showing it
|
/// Update dialog before showing it
|
||||||
@ -38,10 +40,6 @@ private:
|
|||||||
virtual FL_FORM * form() const;
|
virtual FL_FORM * form() const;
|
||||||
///
|
///
|
||||||
FD_form_index * build_index();
|
FD_form_index * build_index();
|
||||||
///
|
|
||||||
int minh;
|
|
||||||
///
|
|
||||||
int minw;
|
|
||||||
/// Real GUI implementation.
|
/// Real GUI implementation.
|
||||||
FD_form_index * dialog_;
|
FD_form_index * dialog_;
|
||||||
};
|
};
|
||||||
|
@ -35,6 +35,7 @@ void FormInset::connect()
|
|||||||
connect(slot(this, &FormInset::update));
|
connect(slot(this, &FormInset::update));
|
||||||
h_ = d_->hideBufferDependent.
|
h_ = d_->hideBufferDependent.
|
||||||
connect(slot(this, &FormInset::hide));
|
connect(slot(this, &FormInset::hide));
|
||||||
|
FormBase::connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,20 +23,18 @@
|
|||||||
/** This class is an XForms GUI base class to insets
|
/** This class is an XForms GUI base class to insets
|
||||||
*/
|
*/
|
||||||
class FormInset : public FormBaseBD {
|
class FormInset : public FormBaseBD {
|
||||||
public:
|
protected:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
FormInset( LyXView *, Dialogs *, string const &,
|
FormInset( LyXView *, Dialogs *, string const &,
|
||||||
ButtonPolicy * bp = new OkCancelReadOnlyPolicy,
|
ButtonPolicy * bp = new OkCancelReadOnlyPolicy,
|
||||||
char const * close = N_("Close"),
|
char const * close = N_("Close"),
|
||||||
char const * cancel = N_("Cancel"));
|
char const * cancel = N_("Cancel"));
|
||||||
|
|
||||||
protected: // methods
|
|
||||||
/// Connect signals. Also perform any necessary initialisation.
|
/// Connect signals. Also perform any necessary initialisation.
|
||||||
virtual void connect();
|
virtual void connect();
|
||||||
/// Disconnect signals. Also perform any necessary housekeeping.
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
||||||
virtual void disconnect();
|
virtual void disconnect();
|
||||||
|
|
||||||
protected: // data
|
|
||||||
/// inset::hide connection.
|
/// inset::hide connection.
|
||||||
Connection ih_;
|
Connection ih_;
|
||||||
};
|
};
|
||||||
@ -46,14 +44,13 @@ protected: // data
|
|||||||
InsetCommand
|
InsetCommand
|
||||||
*/
|
*/
|
||||||
class FormCommand : public FormInset {
|
class FormCommand : public FormInset {
|
||||||
public:
|
protected:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
FormCommand( LyXView *, Dialogs *, string const &,
|
FormCommand( LyXView *, Dialogs *, string const &,
|
||||||
ButtonPolicy * = new OkCancelReadOnlyPolicy,
|
ButtonPolicy * = new OkCancelReadOnlyPolicy,
|
||||||
char const * close = N_("Close"),
|
char const * close = N_("Close"),
|
||||||
char const * cancel = N_("Cancel"));
|
char const * cancel = N_("Cancel"));
|
||||||
|
|
||||||
protected:
|
|
||||||
/// Disconnect signals. Also perform any necessary housekeeping.
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
||||||
virtual void disconnect();
|
virtual void disconnect();
|
||||||
|
|
||||||
|
@ -61,6 +61,10 @@ void FormParagraph::build()
|
|||||||
// the tabbed folder
|
// the tabbed folder
|
||||||
dialog_ = build_tabbed_paragraph();
|
dialog_ = build_tabbed_paragraph();
|
||||||
|
|
||||||
|
// Workaround dumb xforms sizing bug
|
||||||
|
minw_ = form()->w;
|
||||||
|
minh_ = form()->h;
|
||||||
|
|
||||||
// manage the restore, ok, apply and cancel/close buttons
|
// manage the restore, ok, apply and cancel/close buttons
|
||||||
bc_.setOK(dialog_->button_ok);
|
bc_.setOK(dialog_->button_ok);
|
||||||
bc_.setApply(dialog_->button_apply);
|
bc_.setApply(dialog_->button_apply);
|
||||||
|
@ -31,7 +31,7 @@ FormPreferences::FormPreferences(LyXView * lv, Dialogs * d)
|
|||||||
: FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy),
|
: FormBaseBI(lv, d, _("Preferences"), new PreferencesPolicy),
|
||||||
dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
|
dialog_(0), outputs_tab_(0), look_n_feel_tab_(0), inputs_tab_(0),
|
||||||
lnf_general_(0), screen_fonts_(0), interface_(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
|
// let the dialog be shown
|
||||||
// This is a permanent connection so we won't bother
|
// This is a permanent connection so we won't bother
|
||||||
@ -80,8 +80,8 @@ void FormPreferences::build()
|
|||||||
bc_.refresh();
|
bc_.refresh();
|
||||||
|
|
||||||
// Workaround dumb xforms sizing bug
|
// Workaround dumb xforms sizing bug
|
||||||
minw_ = dialog_->form->w;
|
minw_ = form()->w;
|
||||||
minh_ = dialog_->form->h;
|
minh_ = form()->h;
|
||||||
|
|
||||||
// build the tab folders
|
// build the tab folders
|
||||||
outputs_tab_ = build_outer_tab();
|
outputs_tab_ = build_outer_tab();
|
||||||
@ -225,15 +225,6 @@ FL_FORM * FormPreferences::form() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormPreferences::connect()
|
|
||||||
{
|
|
||||||
FormBaseBI::connect();
|
|
||||||
fl_set_form_minsize(dialog_->form,
|
|
||||||
minw_,
|
|
||||||
minh_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FormPreferences::apply()
|
void FormPreferences::apply()
|
||||||
{
|
{
|
||||||
// set the new lyxrc entries
|
// set the new lyxrc entries
|
||||||
|
@ -45,8 +45,6 @@ public:
|
|||||||
///
|
///
|
||||||
~FormPreferences();
|
~FormPreferences();
|
||||||
private:
|
private:
|
||||||
///
|
|
||||||
virtual void connect();
|
|
||||||
/// Update the dialog.
|
/// Update the dialog.
|
||||||
virtual void update(bool = false);
|
virtual void update(bool = false);
|
||||||
///
|
///
|
||||||
@ -100,10 +98,6 @@ private:
|
|||||||
FD_form_paths * paths_;
|
FD_form_paths * paths_;
|
||||||
///
|
///
|
||||||
FD_form_outputs_general * outputs_general_;
|
FD_form_outputs_general * outputs_general_;
|
||||||
/// Overcome a dumb xforms sizing bug
|
|
||||||
int minw_;
|
|
||||||
///
|
|
||||||
int minh_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,6 +54,10 @@ void FormPrint::build()
|
|||||||
{
|
{
|
||||||
dialog_ = build_print();
|
dialog_ = build_print();
|
||||||
|
|
||||||
|
// Workaround dumb xforms sizing bug
|
||||||
|
minw_ = form()->w;
|
||||||
|
minh_ = form()->h;
|
||||||
|
|
||||||
// manage the ok, apply and cancel/close buttons
|
// manage the ok, apply and cancel/close buttons
|
||||||
bc_.setOK(dialog_->button_ok);
|
bc_.setOK(dialog_->button_ok);
|
||||||
bc_.setApply(dialog_->button_apply);
|
bc_.setApply(dialog_->button_apply);
|
||||||
@ -107,15 +111,6 @@ void FormPrint::build()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormPrint::connect()
|
|
||||||
{
|
|
||||||
FormBaseBD::connect();
|
|
||||||
fl_set_form_minsize(dialog_->form,
|
|
||||||
dialog_->form->w,
|
|
||||||
dialog_->form->h);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FL_FORM * FormPrint::form() const
|
FL_FORM * FormPrint::form() const
|
||||||
{
|
{
|
||||||
if (dialog_) return dialog_->form;
|
if (dialog_) return dialog_->form;
|
||||||
|
@ -45,8 +45,6 @@ private:
|
|||||||
virtual void apply();
|
virtual void apply();
|
||||||
/// Filter the inputs
|
/// Filter the inputs
|
||||||
virtual bool input(FL_OBJECT *, long);
|
virtual bool input(FL_OBJECT *, long);
|
||||||
///
|
|
||||||
virtual void connect();
|
|
||||||
/// Pointer to the actual instantiation of the xform's form
|
/// Pointer to the actual instantiation of the xform's form
|
||||||
virtual FL_FORM * form() const;
|
virtual FL_FORM * form() const;
|
||||||
/// Build the dialog
|
/// Build the dialog
|
||||||
|
@ -30,9 +30,6 @@
|
|||||||
using std::sort;
|
using std::sort;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
static int formw;
|
|
||||||
static int formh;
|
|
||||||
|
|
||||||
FormRef::FormRef(LyXView * lv, Dialogs * d)
|
FormRef::FormRef(LyXView * lv, Dialogs * d)
|
||||||
: FormCommand(lv, d, _("Reference")), toggle(GOBACK), dialog_(0)
|
: FormCommand(lv, d, _("Reference")), toggle(GOBACK), dialog_(0)
|
||||||
{
|
{
|
||||||
@ -57,6 +54,13 @@ FL_FORM * FormRef::form() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormRef::connect()
|
||||||
|
{
|
||||||
|
fl_set_form_maxsize( form(), 2*minw_, minh_ );
|
||||||
|
FormCommand::connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormRef::disconnect()
|
void FormRef::disconnect()
|
||||||
{
|
{
|
||||||
refs.clear();
|
refs.clear();
|
||||||
@ -71,9 +75,9 @@ void FormRef::build()
|
|||||||
fl_addto_choice(dialog_->type,
|
fl_addto_choice(dialog_->type,
|
||||||
_(" Ref | Page | TextRef | TextPage | PrettyRef "));
|
_(" Ref | Page | TextRef | TextPage | PrettyRef "));
|
||||||
|
|
||||||
// XFORMS bug workaround
|
// Workaround dumb xforms sizing bug
|
||||||
// Define the min/max dimensions. Actually applied in update()
|
minw_ = form()->w;
|
||||||
formw = form()->w, formh = form()->h;
|
minh_ = form()->h;
|
||||||
|
|
||||||
// Name is irrelevant to LaTeX documents
|
// Name is irrelevant to LaTeX documents
|
||||||
if ( lv_->buffer()->isLatex() ) {
|
if ( lv_->buffer()->isLatex() ) {
|
||||||
@ -157,7 +161,7 @@ void FormRef::showBrowser() const
|
|||||||
fl_show_object( dialog_->button_update );
|
fl_show_object( dialog_->button_update );
|
||||||
fl_show_object( dialog_->sort );
|
fl_show_object( dialog_->sort );
|
||||||
|
|
||||||
setSize( formw, formh, 0 );
|
setSize( minw_, minh_, 0 );
|
||||||
|
|
||||||
fl_deactivate_object( dialog_->type );
|
fl_deactivate_object( dialog_->type );
|
||||||
fl_set_object_lcol( dialog_->type, FL_INACTIVE );
|
fl_set_object_lcol( dialog_->type, FL_INACTIVE );
|
||||||
@ -174,7 +178,7 @@ void FormRef::hideBrowser() const
|
|||||||
fl_hide_object( dialog_->button_update );
|
fl_hide_object( dialog_->button_update );
|
||||||
fl_hide_object( dialog_->sort );
|
fl_hide_object( dialog_->sort );
|
||||||
|
|
||||||
setSize( 250, formh, 280 );
|
setSize( 250, minh_, 280 );
|
||||||
|
|
||||||
fl_activate_object( dialog_->type );
|
fl_activate_object( dialog_->type );
|
||||||
fl_set_object_lcol( dialog_->type, FL_BLACK );
|
fl_set_object_lcol( dialog_->type, FL_BLACK );
|
||||||
@ -200,13 +204,12 @@ void FormRef::setSize( int w, int h, int dx ) const
|
|||||||
static int x6 = dialog_->button_cancel->x;
|
static int x6 = dialog_->button_cancel->x;
|
||||||
static int y6 = dialog_->button_cancel->y;
|
static int y6 = dialog_->button_cancel->y;
|
||||||
|
|
||||||
if ( form()->w != w )
|
if ( form()->w != w ) {
|
||||||
fl_set_form_size( form(), w, h );
|
minw_ = w;
|
||||||
|
minh_ = h;
|
||||||
fl_set_form_minsize( form(), w, h );
|
fl_set_form_size( form(), minw_, minh_ );
|
||||||
fl_set_form_maxsize( form(), 2*w, h );
|
} else
|
||||||
|
return;
|
||||||
if ( form()->w == w ) return;
|
|
||||||
|
|
||||||
fl_set_object_position( dialog_->name, x1-dx, y1 );
|
fl_set_object_position( dialog_->name, x1-dx, y1 );
|
||||||
fl_set_object_position( dialog_->ref, x2-dx, y2 );
|
fl_set_object_position( dialog_->ref, x2-dx, y2 );
|
||||||
|
@ -51,6 +51,8 @@ private:
|
|||||||
GOFIRST
|
GOFIRST
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Connect signals etc. Set form's max size.
|
||||||
|
virtual void connect();
|
||||||
/// Disconnect signals. Also perform any necessary housekeeping.
|
/// Disconnect signals. Also perform any necessary housekeeping.
|
||||||
virtual void disconnect();
|
virtual void disconnect();
|
||||||
|
|
||||||
|
@ -66,10 +66,15 @@ void FormToc::disconnect()
|
|||||||
void FormToc::build()
|
void FormToc::build()
|
||||||
{
|
{
|
||||||
dialog_ = build_toc();
|
dialog_ = build_toc();
|
||||||
|
|
||||||
fl_addto_choice(dialog_->type,
|
fl_addto_choice(dialog_->type,
|
||||||
_(" TOC | LOF | LOT | LOA "));
|
_(" TOC | LOF | LOT | LOA "));
|
||||||
|
|
||||||
// Don't need to limit size of this dialog
|
// 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include "lyxfunc.h"
|
#include "lyxfunc.h"
|
||||||
|
|
||||||
FormUrl::FormUrl(LyXView * lv, Dialogs * d)
|
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
|
// let the dialog be shown
|
||||||
// These are permanent connections so we won't bother
|
// These are permanent connections so we won't bother
|
||||||
@ -49,6 +49,13 @@ FL_FORM * FormUrl::form() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormUrl::connect()
|
||||||
|
{
|
||||||
|
fl_set_form_maxsize( form(), 2*minw_, minh_ );
|
||||||
|
FormCommand::connect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void FormUrl::build()
|
void FormUrl::build()
|
||||||
{
|
{
|
||||||
dialog_ = build_url();
|
dialog_ = build_url();
|
||||||
@ -56,10 +63,9 @@ void FormUrl::build()
|
|||||||
#ifdef WITH_WARNINGS
|
#ifdef WITH_WARNINGS
|
||||||
#warning use the buttoncontroller
|
#warning use the buttoncontroller
|
||||||
#endif
|
#endif
|
||||||
// XFORMS bug workaround
|
// Workaround dumb xforms sizing bug
|
||||||
// Define the min/max dimensions. Actually applied in update()
|
minw_ = form()->w;
|
||||||
minw = form()->w;
|
minh_ = form()->h;
|
||||||
minh = form()->h;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,9 +76,6 @@ void FormUrl::update(bool switched)
|
|||||||
return;
|
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_->url, params.getContents().c_str());
|
||||||
fl_set_input(dialog_->name, params.getOptions().c_str());
|
fl_set_input(dialog_->name, params.getOptions().c_str());
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ public:
|
|||||||
///
|
///
|
||||||
~FormUrl();
|
~FormUrl();
|
||||||
private:
|
private:
|
||||||
|
/// Connect signals etc. Set form's max size.
|
||||||
|
virtual void connect();
|
||||||
/// Build the dialog
|
/// Build the dialog
|
||||||
virtual void build();
|
virtual void build();
|
||||||
/// Update dialog before showing it
|
/// Update dialog before showing it
|
||||||
@ -38,10 +40,6 @@ private:
|
|||||||
virtual FL_FORM * form() const;
|
virtual FL_FORM * form() const;
|
||||||
///
|
///
|
||||||
FD_form_url * build_url();
|
FD_form_url * build_url();
|
||||||
///
|
|
||||||
int minh;
|
|
||||||
///
|
|
||||||
int minw;
|
|
||||||
/// Real GUI implementation.
|
/// Real GUI implementation.
|
||||||
FD_form_url * dialog_;
|
FD_form_url * dialog_;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user