示例#1
0
void wxExVCSCommandOnSTC(
    const wxExVCSCommand& command,
    const wxExLexer& lexer,
    wxExSTC* stc)
{
    if (command.IsBlame())
    {
        // Do not show an edge for blamed documents, they are too wide.
        stc->SetEdgeMode(wxSTC_EDGE_NONE);
    }

    if (command.IsDiff())
    {
        stc->SetLexer("diff");
    }
    else if (command.IsHistory())
    {
        stc->SetLexer("");
    }
    else if (command.IsOpen())
    {
        stc->SetLexer(lexer.GetScintillaLexer());
    }
    else
    {
        stc->SetLexer(wxEmptyString);
    }
}
示例#2
0
{
  const wxExVCSCommand add("a&dd");
  const wxExVCSCommand blame("blame");
  const wxExVCSCommand co("checkou&t");
  const wxExVCSCommand commit("commit", "main");
  const wxExVCSCommand diff("diff", "popup", "submenu");
  const wxExVCSCommand log("log", "main");
  const wxExVCSCommand help("h&elp", "error", "", "m&e");
  const wxExVCSCommand update("update");
  const wxExVCSCommand none;

  REQUIRE(add.GetCommand() == "add");
  REQUIRE(add.GetCommand(true, true) == "a&dd");
  
  REQUIRE(add.IsAdd());
  REQUIRE(blame.IsBlame());
  REQUIRE(co.IsCheckout());
  REQUIRE(commit.IsCommit());
  REQUIRE(diff.IsDiff());
  REQUIRE(help.IsHelp());
  REQUIRE(log.IsHistory());
  REQUIRE(blame.IsOpen());
  REQUIRE(update.IsUpdate());
  REQUIRE(!help.UseFlags());
  REQUIRE(help.UseSubcommand());

  REQUIRE(add.GetSubMenu().empty());
  REQUIRE(diff.GetSubMenu() == "submenu");
  REQUIRE(help.GetSubMenu() == "m&e");
}