<commit_before>//
// Status bar implementation for Enviro
//
// Copyright (c) 2004 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtdata/vtLog.h"
#include "vtlib/vtlib.h"
#include "vtui/wxString2.h"

#include "StatusBar.h"

#include "EnviroGUI.h"


MyStatusBar::MyStatusBar(wxWindow *parent) :
	wxStatusBar(parent, -1)
{
	VTLOG(" Creating Status Bar.\n");
	static const int widths[Field_Max] =
	{
		-1,		// main message area
		60,		// Fps
		220,	// Coordinates of cursor
		160		// Value of thing under cursor, e.g. Elevation or Terrain
	};

	SetFieldsCount(Field_Max);
	SetStatusWidths(Field_Max, widths);
}

void MyStatusBar::UpdateText()
{
	vtString str;
	wxString2 ws;

	str = g_App.GetMessage();
	if (str != "")
	{
		ws = str;
		SetStatusText(ws, Field_Text);
	}

	str = g_App.GetStatusString(0);
	ws = str;
	SetStatusText(ws, Field_Fps);

	str = g_App.GetStatusString(1);
	ws = str;
	SetStatusText(ws, Field_Cursor);

	str = g_App.GetStatusString(2);
	ws.from_utf8(str);
	SetStatusText(ws, Field_CursorVal);
}

//
// Not sure why the event table must be down here, but it does - for WinZip
//
BEGIN_EVENT_TABLE(MyStatusBar, wxStatusBar)
//EVT_SIZE(MyStatusBar::OnSize)
END_EVENT_TABLE()

<commit_msg>fixed status bar to use UTF-8<commit_after>//
// Status bar implementation for Enviro
//
// Copyright (c) 2004 Virtual Terrain Project
// Free for all uses, see license.txt for details.
//

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

#include "vtdata/vtLog.h"
#include "vtlib/vtlib.h"
#include "vtui/wxString2.h"

#include "StatusBar.h"

#include "EnviroGUI.h"


MyStatusBar::MyStatusBar(wxWindow *parent) :
	wxStatusBar(parent, -1)
{
	VTLOG(" Creating Status Bar.\n");
	static const int widths[Field_Max] =
	{
		-1,		// main message area
		60,		// Fps
		220,	// Coordinates of cursor
		160		// Value of thing under cursor, e.g. Elevation or Terrain
	};

	SetFieldsCount(Field_Max);
	SetStatusWidths(Field_Max, widths);
}

void MyStatusBar::UpdateText()
{
	vtString str;
	wxString2 ws;

	str = g_App.GetMessage();
	if (str != "")
	{
		ws.from_utf8(str);
		SetStatusText(ws, Field_Text);
	}

	str = g_App.GetStatusString(0);
	ws = str;
	SetStatusText(ws, Field_Fps);

	str = g_App.GetStatusString(1);
	ws = str;
	SetStatusText(ws, Field_Cursor);

	str = g_App.GetStatusString(2);
	ws.from_utf8(str);
	SetStatusText(ws, Field_CursorVal);
}

//
// Not sure why the event table must be down here, but it does - for WinZip
//
BEGIN_EVENT_TABLE(MyStatusBar, wxStatusBar)
//EVT_SIZE(MyStatusBar::OnSize)
END_EVENT_TABLE()


{'fraction_non_alphanumeric': 0.13794338946614118, 'fraction_numerical': 0.015048369759942674, 'mean_word_length': 4.057971014492754, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4720525', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1069, 'n_words': 262}