<commit_before>
#pragma once
#include "Control.h"
#include "Label.h"
#include "Shape.h"
#include "Font.h"
#include "RasterizedText.h"
#include "GameEvent.h"

class ComboBox : public Control {

	//True if the list of entries is being displayed
	//otherwise false
	bool opened;
	//Colors
	vec4 backColor; //Default color of the list
	vec4 hoverColor; //Color when user hovers cursor over entry or selected
	vec4 selectedColor;

	Label selected;
	vec2 lastMousePos;
	Shape hoverHighlight;
	Shape triangle;

	vector<string> entries;
	vector<RasterizedText> renderedEntries;
	string selectedEntry;
protected:
	virtual void Draw(GL2DProgram * shaders) override;
	virtual void OnMousePress(vec2 mousePos, int button, bool down) override;
	virtual void OnMouseMove(vec2 mousePos) override;
	virtual void OnMouseLeave() override;
	virtual void OnMouseEnter() override;
	//override to change height if opened
	virtual void recalculatePosition() override;

public:
	ComboBox(float x, float y, float width, float height);
	~ComboBox();

	GameEvent<void(ComboBox*,int)> EventSelectionChanged;

	void AddComboEntry(string entry);
	void RemoveComboEntry(string entry);
	void AddList(vector<string> list);
	void SetSelected(string entry);
	void SetSelected(int selectedId);
	//GET
	vector<string> GetList();
	string GetSelected();
	int GetSelectedId();
};<commit_msg>Corrected use of legacy texture2D on devices that expected texture<commit_after>
#pragma once
#include "Control.h"
#include "Label.h"
#include "Shape.h"
#include "Font.h"
#include "RasterizedText.h"
#include "GameEvent.h"

class ComboBox : public Control {
 
	//True if the list of entries is being displayed
	//otherwise false
	bool opened;
	//Colors
	vec4 backColor; //Default color of the list
	vec4 hoverColor; //Color when user hovers cursor over entry or selected
	vec4 selectedColor;

	Label selected;
	vec2 lastMousePos;
	Shape hoverHighlight;
	Shape triangle;

	vector<string> entries;
	vector<RasterizedText> renderedEntries;
	string selectedEntry;
protected:
	virtual void Draw(GL2DProgram * shaders) override;
	virtual void OnMousePress(vec2 mousePos, int button, bool down) override;
	virtual void OnMouseMove(vec2 mousePos) override;
	virtual void OnMouseLeave() override;
	virtual void OnMouseEnter() override;
	//override to change height if opened
	virtual void recalculatePosition() override;

public:
	ComboBox(float x, float y, float width, float height);
	~ComboBox();

	GameEvent<void(ComboBox*,int)> EventSelectionChanged;

	void AddComboEntry(string entry);
	void RemoveComboEntry(string entry);
	void AddList(vector<string> list);
	void SetSelected(string entry);
	void SetSelected(int selectedId);
	//GET
	vector<string> GetList();
	string GetSelected();
	int GetSelectedId();
};
{'fraction_non_alphanumeric': 0.09027291812456263, 'fraction_numerical': 0.005248425472358292, 'mean_word_length': 4.529980657640232, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6239768', 'n_tokens_mistral': 868, 'n_tokens_neox': 843, 'n_words': 287}