Provide default implementation of caret. Form uses it. A control which shows the caret should assign feedback callback and call form repaint of corresponding area. Inversed mode could work slow for huge carets(it is recommended to disable this mode for such caret sizes). It also works only when caret is being rendered on render target. When there is no render target active(drawing directly onto a form) nothing will be drawn. Standard text input and text area always draw onto internal buffer and handle this properly
You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.
class CCaret :public virtual ICaret, public CFeedback
{
public:
CCaret(IFeedback::Callback callback, void *param); // Callback is called when repaint is required, param is passed to callback
~CCaret() override;
IRenderer *getRenderer() override;
bool isVisible() override;
PointF getSize() override;
float getIntervalVisible() override;
float getIntervalHidden() override;
// Since 3.0.0
bool isInversed() override; // True by default. See note above
bool setRenderer(IRenderer *value) override;
bool setVisible(const bool value) override;
bool setSize(const PointF &value) override;
bool setIntervalVisible(const float value) override;
bool setIntervalHidden(const float value) override;
// Since 3.0.0
bool setInversed(const bool value) override;
void Render(const Matrix &matrix) override;
void Release() override;
};
Namespace: | nitisa |
Include: | Nitisa/Core/Caret.h |