<commit_before>#include "optionspanel.h"
#include "gphotogrid.h"

OptionsPanel::OptionsPanel(MainFrame* parent) : wxPanel(parent), main(parent) {
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	sizer->Add(btn = new wxButton(this, wxID_ANY, "foo"),
			0, wxEXPAND);
	btn->Bind(wxEVT_BUTTON, &OptionsPanel::onButton, this, wxID_ANY);

	sliders.resize(3);

	int id = 0;
	for (auto& slider: sliders) {
		sizer->Add(slider = new wxSlider(this, id++, 0, 0, 1,
						wxDefaultPosition, wxDefaultSize, wxSL_LABELS),
				0, wxEXPAND);
		slider->Bind(wxEVT_SLIDER, &OptionsPanel::onSlider, this);
	}

	//sizer->SetSizeHints(this);
	SetSizer(sizer);
}

void OptionsPanel::setSliderRange(int id, int min, int max) {
	sliders.at(id)->SetRange(min, max);
}

void OptionsPanel::onSlider(wxCommandEvent& evt) {
	wxSlider& slid = *static_cast<wxSlider*>(evt.GetEventObject());
	main->slider(slid.GetId(), slid.GetValue());
}

void OptionsPanel::onButton(wxCommandEvent&) {
	main->reloadGphoto();
}
<commit_msg>gpgrid: optionspanel hifi; text and padding<commit_after>#include "optionspanel.h"
#include "gphotogrid.h"

OptionsPanel::OptionsPanel(MainFrame* parent) : wxPanel(parent), main(parent) {
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	sizer->Add(btn = new wxButton(this, wxID_ANY, "rescan cameras"),
			0, wxEXPAND);
	btn->Bind(wxEVT_BUTTON, &OptionsPanel::onButton, this, wxID_ANY);

	sliders.resize(3);
	static const char* labels[] = { "aperture", "shutter speed", "iso speed" };
	for (int i = 0; i < sliders.size(); i++) {
		sizer->Add(new wxStaticText(this, wxID_ANY, labels[i]));
		sizer->Add(sliders[i] = new wxSlider(this, i, 0, 0, 0, // val min max
						wxDefaultPosition, wxDefaultSize, wxSL_LABELS),
				0, wxEXPAND | wxALL, 3); // no proportion, small border (padding)
		sliders[i]->Bind(wxEVT_SLIDER, &OptionsPanel::onSlider, this);
	}

	//sizer->SetSizeHints(this);
	SetSizer(sizer);
}

void OptionsPanel::setSliderRange(int id, int min, int max) {
	sliders.at(id)->SetRange(min, max);
}

void OptionsPanel::onSlider(wxCommandEvent& evt) {
	wxSlider& slid = *static_cast<wxSlider*>(evt.GetEventObject());
	main->slider(slid.GetId(), slid.GetValue());
}

void OptionsPanel::onButton(wxCommandEvent&) {
	main->reloadGphoto();
}

{'fraction_non_alphanumeric': 0.1671134941912422, 'fraction_numerical': 0.006702412868632708, 'mean_word_length': 5.996875, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 22, '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': '512557', 'n_tokens_mistral': 875, 'n_tokens_neox': 851, 'n_words': 165}