Exemplo n.º 1
0
void Edit::OnKeyDown (wxKeyEvent &event)
{
    if (CallTipActive())
        CallTipCancel();
    if (event.GetKeyCode() == WXK_SPACE && event.ControlDown() && event.ShiftDown())
    {
        int pos = GetCurrentPos();
        CallTipSetBackground(*wxYELLOW);
        CallTipShow(pos,
                    "This is a CallTip with multiple lines.\n"
                    "It is meant to be a context sensitive popup helper for the user.");
        return;
    }
    event.Skip();
}
Exemplo n.º 2
0
/* TextEditor::setup
 * Sets up text editor properties depending on cvars and the current
 * text styleset/style
 *******************************************************************/
void TextEditor::setup()
{
	// General settings
	SetBufferedDraw(true);
	SetUseAntiAliasing(true);
	SetMouseDwellTime(500);
	AutoCompSetIgnoreCase(true);
	SetIndentationGuides(txed_indent_guides);
	StyleSetBackground(wxSTC_STYLE_INDENTGUIDE, WXCOL(col_edge_line));

	// Right margin line
	SetEdgeColour(WXCOL(col_edge_line));
	SetEdgeColumn(txed_edge_column);
	if (txed_edge_column == 0)
		SetEdgeMode(wxSTC_EDGE_NONE);
	else
		SetEdgeMode(wxSTC_EDGE_LINE);

	// Apply default style
	StyleSet::applyCurrent(this);
	CallTipUseStyle(10);
	StyleSetChangeable(wxSTC_STYLE_CALLTIP, true);
	wxFont font_ct(10, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
	StyleSetFont(wxSTC_STYLE_CALLTIP, font_ct);
	CallTipSetBackground(wxColour(255, 255, 180));
	CallTipSetForeground(wxColour(0, 0, 0));
	CallTipSetForegroundHighlight(wxColour(0, 0, 200));

	// Set lexer
	if (txed_syntax_hilight)
		SetLexer(wxSTC_LEX_CPPNOCASE);
	else
		SetLexer(wxSTC_LEX_NULL);

	// Re-colour text
	Colourise(0, GetTextLength());
}