mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
improved cursor handling in text editor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@121 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -130,7 +130,7 @@ class FontTextElement : public SimpleTextElement {
|
||||
: SimpleTextElement(text, start, end)
|
||||
, font(font)
|
||||
{}
|
||||
|
||||
|
||||
virtual void draw (RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const;
|
||||
virtual void getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const;
|
||||
virtual double minScale() const;
|
||||
@@ -146,7 +146,7 @@ class SymbolTextElement : public SimpleTextElement {
|
||||
: SimpleTextElement(text, start, end)
|
||||
, font(font), ctx(*ctx)
|
||||
{}
|
||||
|
||||
|
||||
virtual void draw (RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const;
|
||||
virtual void getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const;
|
||||
virtual double minScale() const;
|
||||
@@ -162,9 +162,22 @@ class CompoundTextElement : public TextElement {
|
||||
public:
|
||||
CompoundTextElement(const String& text, size_t start ,size_t end) : TextElement(text, start, end) {}
|
||||
|
||||
virtual void draw (RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const;
|
||||
virtual void getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const;
|
||||
virtual double minScale() const;
|
||||
|
||||
TextElements elements; ///< the elements
|
||||
};
|
||||
|
||||
/// A TextElement drawn using a grey background
|
||||
class AtomTextElement : public CompoundTextElement {
|
||||
public:
|
||||
AtomTextElement(const String& text, size_t start ,size_t end) : CompoundTextElement(text, start, end) {}
|
||||
|
||||
virtual void draw(RotatedDC& dc, double scale, const RealRect& rect, const double* xs, DrawWhat what, size_t start, size_t end) const;
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : Other text elements
|
||||
|
||||
/// A text element that displays a horizontal separator line
|
||||
|
||||
@@ -81,7 +81,7 @@ class TextViewer {
|
||||
/// Is the character at the given index visible?
|
||||
bool isVisible(size_t index) const;
|
||||
/// Find the first character index that is at/before/after the given index, and which has a nonzero width
|
||||
/** More precisely: it returns a position so that no character after it has zero width
|
||||
/** More precisely: it returns a position so that the character after it in the direction delta has nonzero width
|
||||
*/
|
||||
size_t firstVisibleChar(size_t index, int delta) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user