<commit_before>// OutputCanvas.cpp
/*
 * Copyright (c) 2009, <NAME>
 * This program is released under the BSD license. See the file COPYING for
 * details.
 */

#include "stdafx.h"
#include "OutputCanvas.h"
#include "Program.h"
#include "NCCode.h"

BEGIN_EVENT_TABLE(COutputTextCtrl, wxTextCtrl)
    EVT_MOUSE_EVENTS(COutputTextCtrl::OnMouse)
	EVT_PAINT(COutputTextCtrl::OnPaint)
END_EVENT_TABLE()

void COutputTextCtrl::OnMouse( wxMouseEvent& event )
{
	if(event.LeftUp())
	{
		wxTextPos pos = GetInsertionPoint();
		if(theApp.m_program && theApp.m_program->m_nc_code)
		{
			theApp.m_program->m_nc_code->HighlightBlock(pos);
			heeksCAD->Repaint();
		}
	}

	event.Skip();
}

bool painting = false;
void COutputTextCtrl::OnPaint(wxPaintEvent& event)
{
	// this is here to Format the text ( which seems to be slow in Windows, if all done at once in CNCCode::SetTextCtrl )
	// OnPaint doesn't seem to get called from Linux, though
	wxPaintDC dc(this);

	if (!painting && theApp.m_program && theApp.m_program->m_nc_code)
	{
		painting = true;

		wxSize size = GetClientSize();
		int scrollpos = GetScrollPos(wxVERTICAL);
		wxLogDebug("%i", scrollpos);

		wxTextCoord col0, row0, col1, row1;
		HitTest(wxPoint(0,0),      &col0, &row0);
		HitTest(wxPoint(0,0)+size, &col1, &row1);
<commit_msg>added _T() around a string to make it build for MSVC2005<commit_after>// OutputCanvas.cpp
/*
 * Copyright (c) 2009, <NAME>
 * This program is released under the BSD license. See the file COPYING for
 * details.
 */

#include "stdafx.h"
#include "OutputCanvas.h"
#include "Program.h"
#include "NCCode.h"

BEGIN_EVENT_TABLE(COutputTextCtrl, wxTextCtrl)
    EVT_MOUSE_EVENTS(COutputTextCtrl::OnMouse)
	EVT_PAINT(COutputTextCtrl::OnPaint)
END_EVENT_TABLE()

void COutputTextCtrl::OnMouse( wxMouseEvent& event )
{
	if(event.LeftUp())
	{
		wxTextPos pos = GetInsertionPoint();
		if(theApp.m_program && theApp.m_program->m_nc_code)
		{
			theApp.m_program->m_nc_code->HighlightBlock(pos);
			heeksCAD->Repaint();
		}
	}

	event.Skip();
}

bool painting = false;
void COutputTextCtrl::OnPaint(wxPaintEvent& event)
{
	// this is here to Format the text ( which seems to be slow in Windows, if all done at once in CNCCode::SetTextCtrl )
	// OnPaint doesn't seem to get called from Linux, though
	wxPaintDC dc(this);

	if (!painting && theApp.m_program && theApp.m_program->m_nc_code)
	{
		painting = true;

		wxSize size = GetClientSize();
		int scrollpos = GetScrollPos(wxVERTICAL);
		wxLogDebug(_T("%i"), scrollpos);

		wxTextCoord col0, row0, col1, row1;
		HitTest(wxPoint(0,0),      &col0, &row0);
		HitTest(wxPoint(0,0)+size, &col1, &row1);

{'fraction_non_alphanumeric': 0.13104761904761905, 'fraction_numerical': 0.013714285714285714, 'mean_word_length': 4.7969094922737305, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4186397', 'n_tokens_mistral': 1030, 'n_tokens_neox': 966, 'n_words': 228}