示例#1
0
	void OnHotSpotClick(wxScintillaEvent &event) {
		AutoCompCancel();
		CallTipCancel();

		wxPoint clientPos = PointFromPosition(event.GetPosition());
		wxPoint screenPos = ClientToScreen(clientPos);
		int lineHeight = TextHeight(LineFromPosition(event.GetPosition()));

		CloseWatch();
		m_watch = new OneVariableWatchView(
			this, event.GetText(),
			wxPoint(screenPos.x - 50, screenPos.y + lineHeight), 
			wxSize(100, 400));
		m_watch->Show();
	}
示例#2
0
/* TextEditor::showCalltip
 * Shows the calltip window underneath [position] in the text
 *******************************************************************/
void TextEditor::showCalltip(int position)
{
	// Setup calltip colours
	StyleSet* ss_current = StyleSet::currentSet();
	call_tip->setBackgroundColour(ss_current->getStyle("calltip")->getBackground());
	call_tip->setTextColour(ss_current->getStyle("calltip")->getForeground());
	call_tip->setTextHighlightColour(ss_current->getStyle("calltip_hl")->getForeground());
	if (txed_calltips_colourise)
	{
		call_tip->setFunctionColour(ss_current->getStyle("function")->getForeground());
		call_tip->setTypeColour(ss_current->getStyle("keyword")->getForeground());
	}
	if (txed_calltips_use_font)
		call_tip->setFont(ss_current->getDefaultFontFace(), ss_current->getDefaultFontSize());
	else
		call_tip->setFont("", 0);

	// Determine position
	wxPoint pos = GetScreenPosition() + PointFromPosition(position);
	pos.y += TextHeight(GetCurrentLine()) + 2;
	call_tip->SetPosition(wxPoint(pos.x, pos.y));

	call_tip->Show();
}