+
+2002-01-03 André Pönitz <poenitz@gmx.net>
+
+ * formulabase.[Ch]: implement simple search
+
+ * math_sizeinset.[Ch]: support for \displaystyle etc
+
+
2001-12-18 Dekel Tsur <dekelts@tau.ac.il>
* math_macrotable.C (builtinMacros): Adjust kern values.
return;
}
- //lyxerr << "insetButtonPress: " << x + xo_ << " " << y + yo_
- // << " but: " << button << "\n";
+ lyxerr << "insetButtonPress: " << x + xo_ << " " << y + yo_
+ << " but: " << button << "\n";
switch (button) {
default:
case 1:
#endif
#include "math_boxinset.h"
-#include "support/LOstream.h"
-#include "debug.h"
-#include "Painter.h"
-#include "math_cursor.h"
+#include "math_support.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+
MathBoxInset::MathBoxInset(string const & name)
: MathGridInset(1, 1), name_(name)
{}
void MathBoxInset::draw(Painter & pain, int x, int y) const
{
MathGridInset::draw(pain, x, y);
- if (mathcursor && mathcursor->isInside(this)) {
- pain.rectangle(x - 1, y - ascent() - 1, width(), height(),
- LColor::mathframe);
- }
+ mathed_draw_framebox(pain, x, y, this);
}
return true;
}
+
bool MathCursor::script(bool up)
{
macroModeClose();
#include "math_macroarg.h"
#include "math_notinset.h"
#include "math_rootinset.h"
+#include "math_sizeinset.h"
#include "math_spaceinset.h"
#include "math_specialcharinset.h"
#include "math_sqrtinset.h"
return MathAtom(new MathBoxInset(l->name));
case LM_TK_FUNC:
return MathAtom(new MathFuncInset(l->name));
+ case LM_TK_STY:
+ return MathAtom(new MathSizeInset(l));
}
return MathAtom(new MathUnknownInset(l->name));
}
#include <config.h>
#include "math_parser.h"
+#include "math_metricsinfo.h"
#include "lyxlex.h"
#include "debug.h"
#include "support/filetools.h" // LibFileSearch
{"deg", LM_TK_FUNC, 0},
{"det", LM_TK_FUNCLIM, 0},
{"dim", LM_TK_FUNC, 0},
- //{"displaystyle", LM_TK_STY, LM_ST_DISPLAY},
+ {"displaystyle", LM_TK_STY, LM_ST_DISPLAY},
{"dot", LM_TK_DECORATION, 0},
{"end", LM_TK_END, 0},
{"exp", LM_TK_FUNC, 0},
#endif
#include "math_lefteqninset.h"
-#include "LColor.h"
-#include "Painter.h"
-#include "math_cursor.h"
#include "math_mathmlstream.h"
+#include "math_support.h"
MathLefteqnInset::MathLefteqnInset()
void MathLefteqnInset::draw(Painter & pain, int x, int y) const
{
xcell(0).draw(pain, x + 2, y);
- if (mathcursor && mathcursor->isInside(this)) {
- pain.rectangle(x, y - ascent(), xcell(0).width(), height(),
- LColor::mathframe);
- }
+ //mathed_draw_framebox(pain, x, y, this);
}
#include "math_macrotemplate.h"
#include "math_hullinset.h"
#include "math_rootinset.h"
+#include "math_sizeinset.h"
#include "math_sqrtinset.h"
#include "math_scriptinset.h"
#include "math_specialcharinset.h"
return;
}
-/*
- case LM_TK_STY:
- {
- lyxerr[Debug::MATHED] << "LM_TK_STY not implemented\n";
- //MathArray tmp = array;
- //MathSizeInset * p = new MathSizeInset(MathStyles(lval_->id));
- //array.push_back(p);
- //parse_into(p->cell(0), FLAG_BRACE_FONT);
- break;
- }
-
-*/
-
else if (t.cs() == "begin") {
string const name = getArg('{', '}');
if (name == "array") {
array.push_back(p);
}
+ else if (l->token == LM_TK_STY) {
+ MathAtom p = createMathInset(t.cs());
+ parse_into(p->cell(0), flags, code);
+ array.push_back(p);
+ return;
+ }
+
else {
MathAtom p = createMathInset(t.cs());
for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
#include "math_parser.h"
#include "math_mathmlstream.h"
#include "math_streamstr.h"
+#include "math_support.h"
MathSizeInset::MathSizeInset(latexkeys const * l)
void MathSizeInset::draw(Painter & pain, int x, int y) const
{
- xcell(0).draw(pain, x, y);
+ xcell(0).draw(pain, x + 1, y);
+ mathed_draw_framebox(pain, x, y, this);
}
MathMetricsInfo m = mi;
m.style = MathStyles(key_->id);
xcell(0).metrics(m);
- ascent_ = xcell(0).ascent_;
- descent_ = xcell(0).descent_;
- width_ = xcell(0).width_;
+ ascent_ = xcell(0).ascent_ + 1;
+ descent_ = xcell(0).descent_ + 1;
+ width_ = xcell(0).width_ + 2;
}
#include "lyxfont.h"
#include "FontLoader.h"
#include "font.h"
+#include "math_cursor.h"
#include "math_defs.h"
#include "math_inset.h"
#include "math_parser.h"
}
+void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const * p)
+{
+ if (mathcursor && mathcursor->isInside(p))
+ pain.rectangle(x, y - p->ascent(), p->width(), p->height(),
+ LColor::mathframe);
+}
+
+
// In the future maybe we use a better fonts renderer
void drawStr(Painter & pain, MathTextCodes type, MathMetricsInfo const & siz,
int x, int y, string const & s)
class Painter;
class latexkeys;
class MathMetricsInfo;
+class MathInset;
extern char const * latex_mathspace[];
void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
string const & name);
+void mathed_draw_framebox(Painter & pain, int x, int y, MathInset const *);
+
void mathed_string_dim(MathTextCodes type, MathMetricsInfo const & size,
string const & s, int & asc, int & des, int & wid);
int mathed_string_height(MathTextCodes type, MathMetricsInfo const & size,