mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-09 20:47:00 -04:00
Update CMakeLists.txt to allow for static compilation | Update Readme.md | Update package.ps1 (#74)
* Fix CMakeLists, Update Readme and package.ps1 Fixed CMakeLists to allow for static complilation/workaround for broken Hunspell Upped version number to 2.5.0 Updated Readme to include corrected compilation instructions for Visual Studio and Workarounds. Updated package.ps1 to include the cli executable in the dist zips and upped the version number to 2.5.0 * Update README.md * Update package.ps1 * Update package.ps1 * Update CHANGES.md * Update preferences_window.cpp * Update README.md
This commit is contained in:
+2
-1
@@ -2,7 +2,7 @@ Magic Set Editor changelog, for the details see `git log`
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
HEAD: new items added as changes are made
|
version 2.5.0 (Unofficial), 2024-04-28
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
@@ -13,6 +13,7 @@ Bug fixes:
|
|||||||
* Fixed crash when 0 keywords match filter string in keyword panel (@llemoi, haganbmj#57)
|
* Fixed crash when 0 keywords match filter string in keyword panel (@llemoi, haganbmj#57)
|
||||||
* Correct "all images" filter when selecting files. (haganbmj#70)
|
* Correct "all images" filter when selecting files. (haganbmj#70)
|
||||||
* Correct localization of strings on Print window.
|
* Correct localization of strings on Print window.
|
||||||
|
* Fixed issue where "All Images" filter on the art picker was not showing .jpeg files (BaconCatBug)
|
||||||
|
|
||||||
Internal:
|
Internal:
|
||||||
* Add Mac OS build resources (@halian, haganbmj#67, haganbmj#68)
|
* Add Mac OS build resources (@halian, haganbmj#67, haganbmj#68)
|
||||||
|
|||||||
+9
-1
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
project(magicseteditor VERSION 2.4.0)
|
project(magicseteditor VERSION 2.5.0)
|
||||||
add_definitions(-DUNOFFICIAL_BUILD)
|
add_definitions(-DUNOFFICIAL_BUILD)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
@@ -26,6 +26,11 @@ if( NOT HUNSPELL_FOUND )
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to
|
||||||
|
# HUNSPELL_LIBRARIES. If so, uncomment the below line and point it to the correct vcpkg root folder/library.
|
||||||
|
#set(HUNSPELL_LIBRARIES "C:\\PATH\\TO\\ROOT\\vcpkg\\installed\\${VCPKG_TARGET_TRIPLET}\\lib\\hunspell-1.7.lib")
|
||||||
|
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
||||||
|
|
||||||
include_directories("${PROJECT_BINARY_DIR}/src")
|
include_directories("${PROJECT_BINARY_DIR}/src")
|
||||||
include_directories("${PROJECT_SOURCE_DIR}/src")
|
include_directories("${PROJECT_SOURCE_DIR}/src")
|
||||||
include(${wxWidgets_USE_FILE})
|
include(${wxWidgets_USE_FILE})
|
||||||
@@ -142,3 +147,6 @@ endif()
|
|||||||
|
|
||||||
# Test suite
|
# Test suite
|
||||||
include(test/tests.cmake)
|
include(test/tests.cmake)
|
||||||
|
|
||||||
|
# Debug Message
|
||||||
|
message("-- Does this have a full path? If not, and it's just a file name, it's broken: Found Hunspell at ${HUNSPELL_LIBRARIES}")
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ Magic Set Editor, or MSE for short, is a program with which you can design your
|
|||||||
|
|
||||||
More information on https://magicseteditor.boards.net/
|
More information on https://magicseteditor.boards.net/
|
||||||
|
|
||||||
|
## Main Features in the Unofficial Branch
|
||||||
|
* Fixes the "All Image" art selector list to include .jpeg images.
|
||||||
|
* Allows for the option to remove aliasing on selected art by increasing the size of the stored images in the set file.
|
||||||
|
* Adds a text filter on the style tab for Stylesheet.
|
||||||
|
* Decouples the zoom and export scales.
|
||||||
|
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
The code depends on
|
The code depends on
|
||||||
@@ -14,29 +21,31 @@ The code depends on
|
|||||||
## Building on windows with Visual Studio
|
## Building on windows with Visual Studio
|
||||||
|
|
||||||
On windows, the program can be compiled with Visual Studio (recommended) or with mingw-gcc.
|
On windows, the program can be compiled with Visual Studio (recommended) or with mingw-gcc.
|
||||||
|
* VS instructions up-to-date as of April 2024
|
||||||
* Download and install [Visual Studio Community edition](https://visualstudio.microsoft.com/vs/community/)
|
* Download and install [Visual Studio Community Edition](https://visualstudio.microsoft.com/vs/community/)
|
||||||
* Download and install [vcpkg](https://github.com/microsoft/vcpkg)
|
* Download and install [vcpkg](https://github.com/microsoft/vcpkg)
|
||||||
* Use vcpkg to install wxwidgets, boost, hunspell
|
* Use vcpkg to install pkgconf, wxwidgets, boost, hunspell
|
||||||
|
|
||||||
````
|
````
|
||||||
vcpkg install wxwidgets
|
.\vcpkg install pkgconf wxwidgets boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator hunspell --triplet=x64-windows-static
|
||||||
vcpkg install boost-smart-ptr
|
````
|
||||||
vcpkg install boost-regex
|
and/or
|
||||||
vcpkg install boost-logic
|
````
|
||||||
vcpkg install boost-pool
|
.\vcpkg install pkgconf wxwidgets boost-smart-ptr boost-regex boost-logic boost-pool boost-iterator hunspell --triplet=x86-windows-static
|
||||||
vcpkg install boost-iterator
|
````
|
||||||
vcpkg install hunspell
|
````
|
||||||
vcpkg integrate install
|
.\vcpkg integrate install
|
||||||
````
|
````
|
||||||
|
|
||||||
* Then just use "Open Folder" from inside visual studio to open the Magic Set Editor source code root folder.
|
* Then just use "Open Folder" from inside visual studio to open the Magic Set Editor source code root folder.
|
||||||
* Select the configuration that you want to build, and hit F7.
|
* Select the configuration that you want to build (release x64-windows-static), and hit F7.
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
* You will most likely get a message about being unable to open hunspell-1.7.lib because pkgconf forgets to add the actual path to HUNSPELL_LIBRARIES. If so, uncomment the noted line in CMakeLists.txt (line 31) and point it to the root vcpkg installation to find the correct hunspell-1.7.lib file.
|
||||||
|
|
||||||
* You may need to work around [this bug](https://github.com/microsoft/vcpkg/issues/4756) by replacing `$VCPATH\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-3.16\Modules\FindwxWidgets.cmake` with the file from https://github.com/CaeruleusAqua/vcpkg-wx-find (`$VCPATH` is usually `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7`)
|
* You may need to work around [this bug](https://github.com/microsoft/vcpkg/issues/4756) by replacing `$VCPATH\IDE\CommonExtensions\Microsoft\CMake\CMake\share\cmake-3.16\Modules\FindwxWidgets.cmake` with the file from https://github.com/CaeruleusAqua/vcpkg-wx-find (`$VCPATH` is usually `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7`)
|
||||||
* vcpkg by default installs 32 bit versions of libraries, use `vcpkg install PACKAGENAME:x64-windows` if you want to enable a 64 bit build.
|
* vcpkg by default installs 32 bit versions of libraries, use `vcpkg install PACKAGENAME --triplet=x64-windows` if you want to enable a 64 bit build.
|
||||||
* Similarly, to use a static build, use `vcpkg install PACKAGENAME:x32-windows-static`.
|
* Similarly, to use a static build, use `vcpkg install PACKAGENAME --triplet=x32-windows` or `vcpkg install PACKAGENAME -triplet=x64-windows-static`.
|
||||||
|
|
||||||
For running tests you will also need to
|
For running tests you will also need to
|
||||||
* Download and install perl (For example [Strawberry perl](http://strawberryperl.com/) or using [MSYS2](https://www.msys2.org/))
|
* Download and install perl (For example [Strawberry perl](http://strawberryperl.com/) or using [MSYS2](https://www.msys2.org/))
|
||||||
|
|||||||
+13
-2
@@ -1,6 +1,15 @@
|
|||||||
# Super basic build script for release versions.
|
# Super basic build script for release versions.
|
||||||
# Note the hardcoded version numbers which don't read from CMakeLists at all.
|
# Note the hardcoded version numbers which don't read from CMakeLists at all.
|
||||||
|
|
||||||
|
# Set alias for 7zip
|
||||||
|
$7zipPath = "$env:ProgramFiles\7-Zip\7z.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $7zipPath -PathType Leaf)) {
|
||||||
|
throw "7 zip file '$7zipPath' not found"
|
||||||
|
}
|
||||||
|
|
||||||
|
Set-Alias 7z $7zipPath
|
||||||
|
|
||||||
# Cleanup and Recreate the working directories.
|
# Cleanup and Recreate the working directories.
|
||||||
Remove-Item .\out\temp -Recurse
|
Remove-Item .\out\temp -Recurse
|
||||||
Remove-Item .\out\dist -Recurse
|
Remove-Item .\out\dist -Recurse
|
||||||
@@ -40,16 +49,18 @@ Copy-Item ./data/ko.mse-locale/ ./out/temp/data/ko.mse-locale/ -Force -Recurse
|
|||||||
Copy-Item ./BUNDLED_README.txt ./out/temp/x64/README.txt -Force -Recurse
|
Copy-Item ./BUNDLED_README.txt ./out/temp/x64/README.txt -Force -Recurse
|
||||||
Copy-Item ./out/build/x64-Release-static/magicseteditor.com ./out/temp/x64/ -Force -Recurse
|
Copy-Item ./out/build/x64-Release-static/magicseteditor.com ./out/temp/x64/ -Force -Recurse
|
||||||
Copy-Item ./out/build/x64-Release-static/magicseteditor.exe ./out/temp/x64/ -Force -Recurse
|
Copy-Item ./out/build/x64-Release-static/magicseteditor.exe ./out/temp/x64/ -Force -Recurse
|
||||||
|
Copy-Item ./out/build/x64-Release-static/magicseteditor-cli.exe ./out/temp/x64/ -Force -Recurse
|
||||||
#Copy-Item ./data/en.mse-locale/ ./out/temp/x64/data/en.mse-locale/ -Force -Recurse
|
#Copy-Item ./data/en.mse-locale/ ./out/temp/x64/data/en.mse-locale/ -Force -Recurse
|
||||||
Copy-Item ./out/temp/data/ ./out/temp/x64/data/ -Force -Recurse
|
Copy-Item ./out/temp/data/ ./out/temp/x64/data/ -Force -Recurse
|
||||||
|
|
||||||
7z a -tzip ./out/dist/MagicSetEditor-2.4.0-win64.zip ./out/temp/x64/**
|
7z a -tzip ./out/dist/MagicSetEditor-2.5.0-unofficial-win64.zip ./out/temp/x64/**
|
||||||
|
|
||||||
# Gather the relevant x86 files and Zip them.
|
# Gather the relevant x86 files and Zip them.
|
||||||
Copy-Item ./BUNDLED_README.txt ./out/temp/x86/README.txt -Force -Recurse
|
Copy-Item ./BUNDLED_README.txt ./out/temp/x86/README.txt -Force -Recurse
|
||||||
Copy-Item ./out/build/x86-Release-static/magicseteditor.com ./out/temp/x86/ -Force -Recurse
|
Copy-Item ./out/build/x86-Release-static/magicseteditor.com ./out/temp/x86/ -Force -Recurse
|
||||||
Copy-Item ./out/build/x86-Release-static/magicseteditor.exe ./out/temp/x86/ -Force -Recurse
|
Copy-Item ./out/build/x86-Release-static/magicseteditor.exe ./out/temp/x86/ -Force -Recurse
|
||||||
|
Copy-Item ./out/build/x86-Release-static/magicseteditor-cli.exe ./out/temp/x86/ -Force -Recurse
|
||||||
#Copy-Item ./data/en.mse-locale/ ./out/temp/x86/data/en.mse-locale/ -Force -Recurse
|
#Copy-Item ./data/en.mse-locale/ ./out/temp/x86/data/en.mse-locale/ -Force -Recurse
|
||||||
Copy-Item ./out/temp/data/ ./out/temp/x86/data/ -Force -Recurse
|
Copy-Item ./out/temp/data/ ./out/temp/x86/data/ -Force -Recurse
|
||||||
|
|
||||||
7z a -tzip ./out/dist/MagicSetEditor-2.4.0-win32.zip ./out/temp/x86/**
|
7z a -tzip ./out/dist/MagicSetEditor-2.5.0-unofficial-win32.zip ./out/temp/x86/**
|
||||||
|
|||||||
@@ -65,22 +65,22 @@ private:
|
|||||||
void updateZoom();
|
void updateZoom();
|
||||||
void onExportZoomChange(wxCommandEvent&);
|
void onExportZoomChange(wxCommandEvent&);
|
||||||
void updateExportZoom();
|
void updateExportZoom();
|
||||||
};
|
};
|
||||||
|
|
||||||
class InternalPreferencesPage : public PreferencesPage {
|
class InternalPreferencesPage : public PreferencesPage {
|
||||||
public:
|
public:
|
||||||
InternalPreferencesPage(Window* parent);
|
InternalPreferencesPage(Window* parent);
|
||||||
void store() override;
|
void store() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE();
|
DECLARE_EVENT_TABLE();
|
||||||
|
|
||||||
wxCheckBox* internal_image_extension;
|
wxCheckBox* internal_image_extension;
|
||||||
|
|
||||||
wxComboBox* internal_scale;
|
wxComboBox* internal_scale;
|
||||||
int internal_scale_int;
|
int internal_scale_int;
|
||||||
|
|
||||||
void onInternalScaleChange(wxCommandEvent&);
|
void onInternalScaleChange(wxCommandEvent&);
|
||||||
void updateInternalScale();
|
void updateInternalScale();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ PreferencesWindow::PreferencesWindow(Window* parent)
|
|||||||
// init notebook
|
// init notebook
|
||||||
wxNotebook* nb = new wxNotebook(this, ID_NOTEBOOK);
|
wxNotebook* nb = new wxNotebook(this, ID_NOTEBOOK);
|
||||||
nb->AddPage(new GlobalPreferencesPage (nb), _TITLE_("global"));
|
nb->AddPage(new GlobalPreferencesPage (nb), _TITLE_("global"));
|
||||||
nb->AddPage(new DisplayPreferencesPage(nb), _TITLE_("display"));
|
nb->AddPage(new DisplayPreferencesPage(nb), _TITLE_("display"));
|
||||||
nb->AddPage(new InternalPreferencesPage(nb), _TITLE_("internal"));
|
nb->AddPage(new InternalPreferencesPage(nb), _TITLE_("internal"));
|
||||||
nb->AddPage(new DirsPreferencesPage (nb), _TITLE_("directories"));
|
nb->AddPage(new DirsPreferencesPage (nb), _TITLE_("directories"));
|
||||||
nb->AddPage(new UpdatePreferencesPage (nb), _TITLE_("updates"));
|
nb->AddPage(new UpdatePreferencesPage (nb), _TITLE_("updates"));
|
||||||
@@ -202,7 +202,7 @@ void GlobalPreferencesPage::store() {
|
|||||||
// set the_locale?
|
// set the_locale?
|
||||||
// open_sets_in_new_window
|
// open_sets_in_new_window
|
||||||
settings.open_sets_in_new_window = open_sets_in_new_window->GetValue();
|
settings.open_sets_in_new_window = open_sets_in_new_window->GetValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Preferences page : display
|
// ----------------------------------------------------------------------------- : Preferences page : display
|
||||||
|
|
||||||
@@ -213,17 +213,17 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
high_quality = new wxCheckBox(this, wxID_ANY, _BUTTON_("high quality"));
|
high_quality = new wxCheckBox(this, wxID_ANY, _BUTTON_("high quality"));
|
||||||
borders = new wxCheckBox(this, wxID_ANY, _BUTTON_("show lines"));
|
borders = new wxCheckBox(this, wxID_ANY, _BUTTON_("show lines"));
|
||||||
draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints"));
|
draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints"));
|
||||||
spellcheck_enabled = new wxCheckBox(this, wxID_ANY, _BUTTON_("spellcheck enabled"));
|
spellcheck_enabled = new wxCheckBox(this, wxID_ANY, _BUTTON_("spellcheck enabled"));
|
||||||
non_normal_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("zoom export"));
|
non_normal_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("zoom export"));
|
||||||
zoom = new wxComboBox(this, ID_ZOOM);
|
zoom = new wxComboBox(this, ID_ZOOM);
|
||||||
export_zoom = new wxComboBox(this, ID_EXPORT_ZOOM);
|
export_zoom = new wxComboBox(this, ID_EXPORT_ZOOM);
|
||||||
|
|
||||||
//wxButton* columns = new wxButton(this, ID_SELECT_COLUMNS, _BUTTON_("select"));
|
//wxButton* columns = new wxButton(this, ID_SELECT_COLUMNS, _BUTTON_("select"));
|
||||||
// set values
|
// set values
|
||||||
high_quality-> SetValue( settings.default_stylesheet_settings.card_anti_alias());
|
high_quality-> SetValue( settings.default_stylesheet_settings.card_anti_alias());
|
||||||
borders-> SetValue( settings.default_stylesheet_settings.card_borders());
|
borders-> SetValue( settings.default_stylesheet_settings.card_borders());
|
||||||
draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing());
|
draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing());
|
||||||
spellcheck_enabled->SetValue( settings.default_stylesheet_settings.card_spellcheck_enabled());
|
spellcheck_enabled->SetValue( settings.default_stylesheet_settings.card_spellcheck_enabled());
|
||||||
non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export());
|
||||||
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
zoom_int = static_cast<int>(settings.default_stylesheet_settings.card_zoom() * 100);
|
||||||
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
zoom->SetValue(String::Format(_("%d%%"),zoom_int));
|
||||||
@@ -258,7 +258,7 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent)
|
|||||||
s4->Add(new wxStaticText(this, wxID_ANY, _LABEL_("percent of normal")), 1, wxALL & ~wxRIGHT, 4);
|
s4->Add(new wxStaticText(this, wxID_ANY, _LABEL_("percent of normal")), 1, wxALL & ~wxRIGHT, 4);
|
||||||
|
|
||||||
s2->Add(s3, 0, wxEXPAND | wxALL, 4);
|
s2->Add(s3, 0, wxEXPAND | wxALL, 4);
|
||||||
s2->Add(s4, 0, wxEXPAND | wxALL, 4);
|
s2->Add(s4, 0, wxEXPAND | wxALL, 4);
|
||||||
s2->Add(non_normal_export, 0, wxEXPAND | wxALL, 4);
|
s2->Add(non_normal_export, 0, wxEXPAND | wxALL, 4);
|
||||||
|
|
||||||
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
||||||
@@ -271,7 +271,7 @@ void DisplayPreferencesPage::store() {
|
|||||||
settings.default_stylesheet_settings.card_anti_alias = high_quality->GetValue();
|
settings.default_stylesheet_settings.card_anti_alias = high_quality->GetValue();
|
||||||
settings.default_stylesheet_settings.card_borders = borders->GetValue();
|
settings.default_stylesheet_settings.card_borders = borders->GetValue();
|
||||||
settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue();
|
settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue();
|
||||||
settings.default_stylesheet_settings.card_spellcheck_enabled = spellcheck_enabled->GetValue();
|
settings.default_stylesheet_settings.card_spellcheck_enabled = spellcheck_enabled->GetValue();
|
||||||
settings.default_stylesheet_settings.card_normal_export = !non_normal_export->GetValue();
|
settings.default_stylesheet_settings.card_normal_export = !non_normal_export->GetValue();
|
||||||
|
|
||||||
updateZoom();
|
updateZoom();
|
||||||
@@ -316,45 +316,45 @@ BEGIN_EVENT_TABLE(DisplayPreferencesPage, wxPanel)
|
|||||||
EVT_COMBOBOX(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
EVT_COMBOBOX(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
||||||
EVT_TEXT_ENTER(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
EVT_TEXT_ENTER(ID_EXPORT_ZOOM, DisplayPreferencesPage::onExportZoomChange)
|
||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Preferences page : internal
|
// ----------------------------------------------------------------------------- : Preferences page : internal
|
||||||
|
|
||||||
InternalPreferencesPage::InternalPreferencesPage(Window* parent) : PreferencesPage(parent) {
|
InternalPreferencesPage::InternalPreferencesPage(Window* parent) : PreferencesPage(parent) {
|
||||||
internal_image_extension = new wxCheckBox(this, wxID_ANY, _BUTTON_("internal image extension"));
|
internal_image_extension = new wxCheckBox(this, wxID_ANY, _BUTTON_("internal image extension"));
|
||||||
internal_scale = new wxComboBox(this, ID_INTERNAL_SCALE);
|
internal_scale = new wxComboBox(this, ID_INTERNAL_SCALE);
|
||||||
|
|
||||||
internal_image_extension->SetValue(settings.internal_image_extension);
|
internal_image_extension->SetValue(settings.internal_image_extension);
|
||||||
|
|
||||||
internal_scale_int = static_cast<int>(settings.internal_scale * 100);
|
internal_scale_int = static_cast<int>(settings.internal_scale * 100);
|
||||||
internal_scale->SetValue(String::Format(_("%d%%"), internal_scale_int));
|
internal_scale->SetValue(String::Format(_("%d%%"), internal_scale_int));
|
||||||
|
|
||||||
int choices[] = { 100,200 };
|
int choices[] = { 100,200,300,400 };
|
||||||
for (unsigned int i = 0; i < sizeof(choices) / sizeof(choices[0]); ++i) {
|
for (unsigned int i = 0; i < sizeof(choices) / sizeof(choices[0]); ++i) {
|
||||||
internal_scale->Append(String::Format(_("%d%%"), choices[i]));
|
internal_scale->Append(String::Format(_("%d%%"), choices[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSizer* s = new wxBoxSizer(wxVERTICAL);
|
wxSizer* s = new wxBoxSizer(wxVERTICAL);
|
||||||
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("storage"));
|
wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("storage"));
|
||||||
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("scale")), 0, wxALL & ~wxLEFT, 4);
|
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("scale")), 0, wxALL & ~wxLEFT, 4);
|
||||||
s3->AddSpacer(2);
|
s3->AddSpacer(2);
|
||||||
s3->Add(internal_scale);
|
s3->Add(internal_scale);
|
||||||
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("percent of normal")), 1, wxALL & ~wxRIGHT, 4);
|
s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("percent of normal")), 1, wxALL & ~wxRIGHT, 4);
|
||||||
s2->Add(s3);
|
s2->Add(s3);
|
||||||
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("internal scale desc")), 0, wxALL & ~wxLEFT, 4);
|
s2->Add(new wxStaticText(this, wxID_ANY, _LABEL_("internal scale desc")), 0, wxALL & ~wxLEFT, 4);
|
||||||
s2->Add(internal_image_extension, 0, wxEXPAND | wxALL, 4);
|
s2->Add(internal_image_extension, 0, wxEXPAND | wxALL, 4);
|
||||||
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
s->Add(s2, 0, wxEXPAND | wxALL, 8);
|
||||||
s->SetSizeHints(this);
|
s->SetSizeHints(this);
|
||||||
SetSizer(s);
|
SetSizer(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InternalPreferencesPage::store() {
|
void InternalPreferencesPage::store() {
|
||||||
settings.internal_image_extension = internal_image_extension->GetValue();
|
settings.internal_image_extension = internal_image_extension->GetValue();
|
||||||
|
|
||||||
updateInternalScale();
|
updateInternalScale();
|
||||||
settings.internal_scale = internal_scale_int / 100.0;
|
settings.internal_scale = internal_scale_int / 100.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InternalPreferencesPage::onInternalScaleChange(wxCommandEvent&) {
|
void InternalPreferencesPage::onInternalScaleChange(wxCommandEvent&) {
|
||||||
updateInternalScale();
|
updateInternalScale();
|
||||||
}
|
}
|
||||||
@@ -366,8 +366,8 @@ void InternalPreferencesPage::updateInternalScale() {
|
|||||||
internal_scale_int = min(max(i, 1), 1000);
|
internal_scale_int = min(max(i, 1), 1000);
|
||||||
}
|
}
|
||||||
internal_scale->SetValue(String::Format(_("%d%%"), (int)internal_scale_int));
|
internal_scale->SetValue(String::Format(_("%d%%"), (int)internal_scale_int));
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(InternalPreferencesPage, wxPanel)
|
BEGIN_EVENT_TABLE(InternalPreferencesPage, wxPanel)
|
||||||
EVT_COMBOBOX(ID_INTERNAL_SCALE, InternalPreferencesPage::onInternalScaleChange)
|
EVT_COMBOBOX(ID_INTERNAL_SCALE, InternalPreferencesPage::onInternalScaleChange)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|||||||
Reference in New Issue
Block a user