2002-07-08 11:29:51 +00:00
|
|
|
#ifndef MATH_PARBOXINSET_H
|
|
|
|
#define MATH_PARBOXINSET_H
|
|
|
|
|
|
|
|
#include "math_nestinset.h"
|
|
|
|
|
|
|
|
class MathParboxInset : public MathNestInset {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
MathParboxInset();
|
|
|
|
///
|
|
|
|
MathParboxInset * asParboxInset() { return this; }
|
|
|
|
///
|
|
|
|
MathInset * clone() const;
|
2002-07-18 11:02:33 +00:00
|
|
|
///
|
|
|
|
mode_type currentMode() const { return TEXT_MODE; }
|
2002-07-16 18:22:45 +00:00
|
|
|
/// get cursor position
|
|
|
|
void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
|
2002-07-08 11:29:51 +00:00
|
|
|
///
|
|
|
|
void metrics(MathMetricsInfo & mi) const;
|
|
|
|
///
|
|
|
|
void draw(MathPainterInfo &, int x, int y) const;
|
2002-07-26 17:23:44 +00:00
|
|
|
/// draw selection background
|
|
|
|
void drawSelection(MathPainterInfo & pi,
|
|
|
|
idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
|
2002-07-08 11:29:51 +00:00
|
|
|
///
|
|
|
|
void infoize(std::ostream & os) const;
|
|
|
|
///
|
|
|
|
void write(WriteStream & os) const;
|
|
|
|
///
|
|
|
|
void setWidth(string const & width);
|
|
|
|
///
|
|
|
|
void setPosition(string const & pos);
|
2002-07-26 13:13:20 +00:00
|
|
|
/// moves cursor up or down
|
|
|
|
bool idxUpDown(idx_type &, pos_type & pos, bool up) const;
|
2002-07-08 11:29:51 +00:00
|
|
|
private:
|
2002-07-26 13:13:20 +00:00
|
|
|
/// number of rows on screen
|
|
|
|
int screenrows() const;
|
2002-07-17 10:25:33 +00:00
|
|
|
/// row corresponding to given position
|
|
|
|
int pos2row(pos_type pos) const;
|
2002-07-08 11:29:51 +00:00
|
|
|
/// width on screen
|
|
|
|
int lyx_width_;
|
|
|
|
/// width for TeX
|
|
|
|
string tex_width_;
|
2002-07-09 08:24:33 +00:00
|
|
|
/// htb
|
2002-07-08 11:29:51 +00:00
|
|
|
char position_;
|
2002-07-09 08:24:33 +00:00
|
|
|
/// cached metrics
|
|
|
|
mutable std::vector<MathXArray::Row> rows_;
|
2002-07-08 11:29:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|