2#include <wx/combobox.h>
4#include <wx/filename.h>
5#include <wx/preferences.h>
6#include <wx/spinctrl.h>
7#include <wx/stdpaths.h>
22 void OnConfChange(wxCommandEvent &event) {
26 virtual bool TransferDataToWindow() {
28 row_size->SetValue(config->Read(
"editor/row_size", 50));
29 col_size->SetValue(config->Read(
"editor/col_size", 100));
30 show_move_icons->SetValue(config->Read(
"editor/show_move_icons",
true));
31 color_margin->SetColour(wxColour(config->Read(
"editor/color_margin",
"#F3F3F3")));
32 color_scrollbar->SetColour(wxColour(config->Read(
"editor/color_scrollbar",
"#838383")));
33 color_scrollbarbg->SetColour(wxColour(config->Read(
"editor/color_scrollbarbg",
"#FFFFFF")));
34 color_commentbg->SetColour(wxColour(config->Read(
"editor/color_commentbg",
"#ffffcc")));
39 void ApplyPreferences() {
41 config->Write(
"editor/row_size", row_size->GetValue());
42 config->Write(
"editor/col_size", col_size->GetValue());
43 config->Write(
"editor/show_move_icons", show_move_icons->GetValue());
44 config->Write(
"editor/color_margin", color_margin->GetColour().GetAsString());
45 config->Write(
"editor/color_scrollbar", color_scrollbar->GetColour().GetAsString());
46 config->Write(
"editor/color_scrollbarbg", color_scrollbarbg->GetColour().GetAsString());
47 config->Write(
"editor/color_commentbg", color_commentbg->GetColour().GetAsString());
51 virtual bool TransferDataFromWindow() {
53 MAINWIN->ApplyPreferences();
64 virtual wxString GetName()
const {
return "Editor"; }
65 virtual wxBitmap GetLargeIcon() {
66 return wxArtProvider::GetBitmap(wxART_HELP, wxART_TOOLBAR);
69 virtual wxBitmapBundle GetIcon() {
70 return wxBitmapBundle::FromBitmap(
LoadPNG(
"ui_text_alt"));
73 virtual wxWindow *CreateWindow(wxWindow *parent) {
Configuration page for the EditorCanvas.
Definition: EditorPrefs.hpp:15
Interface for wxWidgets to load EditorPrefsPanel into the preference window.
Definition: EditorPrefs.hpp:62
Class PrefsEditor.
Definition: gui.h:199
wxBitmap LoadPNG(std::string icon, wxSize size)
Load an icon from embedded binary resources and rescale it to a specified size.
Definition: binres.cpp:7