Martin Vermeer <[EMAIL PROTECTED]> writes: | Index: box.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/box.C,v | retrieving revision 1.8 | diff -u -p -r1.8 box.C | --- box.C 23 Aug 2003 00:16:06 -0000 1.8 | +++ box.C 2 Sep 2003 14:05:45 -0000 | @@ -23,6 +23,9 @@ Box::Box(int x1_, int x2_, int y1_, int | x1(x1_), x2(x2_), y1(y1_), y2(y2_) | {} | | +Box::Box() : | + x1(0), x2(0), y1(0), y2(0) | +{}
Box::Box() : x1(0), x2(0), y1(0), y2(0) {} | bool Box::contained(int x, int y) Hmm... didn't you agree on "contains"? | @@ -57,7 +57,14 @@ std::auto_ptr<InsetBase> InsetBibtex::cl | void InsetBibtex::metrics(MetricsInfo & mi, Dimension & dim) const | { | InsetCommand::metrics(mi, dim); | - center_indent_ = (mi.base.textwidth - dim.wid) / 2; | + int center_indent_ = (mi.base.textwidth - dim.wid) / 2; | + Box b( | + center_indent_, | + center_indent_ + dim.wid, | + -dim.asc, | + dim.des | + ); Hmmm... Box b(center_indent_, center_indent_ + dim.wid, -dim.asc, dim.des); unless all can go on one line. | Index: insets/insetfloatlist.C | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetfloatlist.C,v | retrieving revision 1.39 | diff -u -p -r1.39 insetfloatlist.C | --- insets/insetfloatlist.C 28 Aug 2003 07:41:29 -0000 1.39 | +++ insets/insetfloatlist.C 2 Sep 2003 14:05:45 -0000 | @@ -101,7 +101,15 @@ void InsetFloatList::read(Buffer const & | void InsetFloatList::metrics(MetricsInfo & mi, Dimension & dim) const | { | InsetCommand::metrics(mi, dim); | - center_indent_ = (mi.base.textwidth - dim.wid) / 2; | + int center_indent_ = (mi.base.textwidth - dim.wid) / 2; | + Box b( | + center_indent_, | + center_indent_ + dim.wid, | + -dim.asc, | + dim.des | + ); same as above | dispatch_result InsetFloatList::localDispatch(FuncRequest const & cmd) | { | switch (cmd.action) { | - case LFUN_INSET_EDIT: | - InsetCommandMailer("toc", *this).showDialog(cmd.view()); | + case LFUN_MOUSE_RELEASE: | + if (buttonBox().contained(cmd.x, cmd.y)) | + InsetCommandMailer("toc", | *this).showDialog(cmd.view()); I am not sure I agree with these changes... how can I know do stuff from lyxserver or from cmdline? | @@ -535,10 +536,19 @@ void InsetInclude::metrics(MetricsInfo & | } | button_.metrics(mi, dim); | } | + int center_indent_; | if (params_.flag == INPUT) | center_indent_ = 0; | else | center_indent_ = (mi.base.textwidth - dim.wid) / 2; I wonder... int center_indent_ = (params_.flag == INPUT ? 0 : (mi.base.textwidth - dim.wid) / 2); alt: int center_indent_ = 0; if (params_.flag != INPUT) center_indent_ = (mi.base.textwidth - dim.wid) / 2; but why all these variables ending with '_'? IMHO that should be reserved for private class variables, or at least for class variables in general. | Index: insets/insetinclude.h | =================================================================== | RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetinclude.h,v | retrieving revision 1.79 | diff -u -p -r1.79 insetinclude.h | --- insets/insetinclude.h 28 Aug 2003 07:41:29 -0000 1.79 | +++ insets/insetinclude.h 2 Sep 2003 14:05:45 -0000 | @@ -14,6 +14,7 @@ | | #include "insetcommand.h" | #include "dimension.h" | +#include "box.h" don't you get this from insetcommand.h? -- Lgb