- //lyxerr << "\nInsetCollapsable::priv_dispatch (begin): cmd: " << cmd
- // << " button y: " << button_dim.y2 << endl;
- switch (cmd.action) {
- case LFUN_MOUSE_PRESS:
- if (status_ == Inlined)
- inset.dispatch(cur, cmd);
- else if (status_ == Open && cmd.y > button_dim.y2)
- inset.dispatch(cur, adjustCommand(cmd));
- return DispatchResult(true, true);
-
- case LFUN_MOUSE_MOTION:
- if (status_ == Inlined)
- inset.dispatch(cur, cmd);
- else if (status_ == Open && cmd.y > button_dim.y2)
- inset.dispatch(cur, adjustCommand(cmd));
- return DispatchResult(true, true);
-
- case LFUN_MOUSE_RELEASE:
- return lfunMouseRelease(cur, cmd);
-
- case LFUN_INSET_TOGGLE:
- if (inset.text_.toggleInset())
- return DispatchResult(true, true);
- if (status_ == Open) {
- setStatus(Inlined);
- return DispatchResult(true, true);
- } else {
- setStatus(Collapsed);
- return DispatchResult(false, FINISHED_RIGHT);
- }
-
- default:
- return inset.dispatch(cur, adjustCommand(cmd));
- }
-}
-
-
-void InsetCollapsable::validate(LaTeXFeatures & features) const
-{
- inset.validate(features);
-}
-
-
-void InsetCollapsable::getCursorPos(int cell, int & x, int & y) const
-{
- inset.getCursorPos(cell, x, y);
- if (status_ != Inlined)
- y += - ascent() + height_collapsed() + inset.ascent();
-}
-
-
-void InsetCollapsable::getLabelList(Buffer const & buffer,
- std::vector<string> & list) const
-{
- inset.getLabelList(buffer, list);
-}