*/
///
-class InsetCommand : public InsetOld {
+class InsetCommand : public Inset {
public:
///
InsetCommand(InsetCommandParams const &, std::string const & mailer_name);
///
~InsetCommand();
///
- bool metrics(MetricsInfo &, Dimension &) const;
+ void metrics(MetricsInfo &, Dimension &) const;
+ ///
+ Dimension const dimension(BufferView const &) const { return button_.dimension(); }
///
void draw(PainterInfo & pi, int x, int y) const;
///
///
int docbook(Buffer const &, odocstream &, OutputParams const & runparams) const;
///
- InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; }
+ Inset::Code lyxCode() const { return Inset::NO_CODE; }
///
InsetCommandParams const & params() const { return p_; }
p_.setContents(c);
}
public:
+ /// tell that the button label should be recomputed.
+ void refresh() { updateButtonLabel_ = true; }
///
void setParam(std::string const & name, docstring const & value)
{
{
return p_[name];
}
+ ///
+ void edit(Cursor & cur, bool left);
/// FIXME remove
virtual void replaceContents(std::string const & from, std::string const & to);
///
private:
///
InsetCommandParams p_;
+ ///
std::string mailer_name_;
/// changes color when mouse enters/leaves this inset
bool mouse_hover_;
+ ///
mutable bool updateButtonLabel_;
+ ///
mutable RenderButton button_;
};
///
InsetCommandMailer(std::string const & name, InsetCommand & inset);
///
- virtual InsetBase & inset() const { return inset_; }
+ virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///