mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
Implement basic context menu for include insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24525 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
fa568e12f0
commit
878b3ce315
@ -181,8 +181,17 @@ Menuset
|
||||
Item "Settings...|S" "next-inset-toggle"
|
||||
End
|
||||
|
||||
Menu "edit_vspacetype"
|
||||
|
||||
#
|
||||
# InsetInclude context menu
|
||||
#
|
||||
Menu "context-include"
|
||||
Item "Include|c" "next-inset-modify changetype include"
|
||||
Item "Input|p" "next-inset-modify changetype input"
|
||||
Item "Verbatim|V" "next-inset-modify changetype verbatiminput"
|
||||
Item "Verbatim (marked blanks)|b" "next-inset-modify changetype verbatiminput*"
|
||||
Item "Listing|L" "next-inset-modify changetype lstinputlisting"
|
||||
Separator
|
||||
Item "Settings...|S" "next-inset-toggle"
|
||||
End
|
||||
|
||||
#
|
||||
|
@ -243,6 +243,10 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
|
||||
|
||||
case LFUN_INSET_MODIFY: {
|
||||
InsetCommandParams p(INCLUDE_CODE);
|
||||
if (cmd.getArg(0) == "changetype") {
|
||||
InsetCommand::doDispatch(cur, cmd);
|
||||
p = params();
|
||||
} else
|
||||
InsetCommand::string2params("include", to_utf8(cmd.argument()), p);
|
||||
if (!p.getCmdName().empty()) {
|
||||
if (isListings(p)){
|
||||
@ -761,6 +765,12 @@ void InsetInclude::draw(PainterInfo & pi, int x, int y) const
|
||||
}
|
||||
|
||||
|
||||
docstring InsetInclude::contextMenu(BufferView const &, int, int) const
|
||||
{
|
||||
return from_ascii("context-include");
|
||||
}
|
||||
|
||||
|
||||
Inset::DisplayType InsetInclude::display() const
|
||||
{
|
||||
return type(params()) == INPUT ? Inline : AlignCenter;
|
||||
|
@ -93,6 +93,8 @@ public:
|
||||
static std::string defaultCommand() { return "include"; }
|
||||
///
|
||||
static bool isCompatibleCommand(std::string const & s);
|
||||
///
|
||||
docstring contextMenu(BufferView const & bv, int x, int y) const;
|
||||
protected:
|
||||
InsetInclude(InsetInclude const &);
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user