-void InsetERT::updateStatus(bool swap) const
-{
- if (status_ != Inlined) {
- if (isOpen())
- status_ = swap ? Collapsed : Open;
- else
- status_ = swap ? Open : Collapsed;
- setButtonLabel();
- }
-}
-
-
-void InsetERT::lfunMousePress(FuncRequest const & cmd)
-{
- if (status_ == Inlined)
- inset.dispatch(cmd);
- else {
- idx_type idx = 0;
- pos_type pos = 0;
- InsetCollapsable::priv_dispatch(cmd, idx, pos);
- }
-}
-
-
-bool InsetERT::lfunMouseRelease(FuncRequest const & cmd)
-{
- BufferView * bv = cmd.view();
-
- if (cmd.button() == mouse_button::button3) {
- showInsetDialog(bv);
- return true;
- }
-
- if (status_ != Inlined && hitButton(cmd)) {
- updateStatus(true);
- } else {
- FuncRequest cmd1 = cmd;
-#warning metrics?
- cmd1.y = ascent() + cmd.y - inset.ascent();
-
- // inlined is special - the text appears above
- if (status_ == Inlined)
- inset.dispatch(cmd1);
- else if (isOpen() && cmd.y > buttonDim().y2) {
- cmd1.y -= height_collapsed();
- inset.dispatch(cmd1);
- }
- }
- return false;
-}
-
-
-void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
-{
- if (status_ == Inlined)
- inset.dispatch(cmd);
- else {
- idx_type idx = 0;
- pos_type pos = 0;
- InsetCollapsable::priv_dispatch(cmd, idx, pos);
- }
-}
-
-