From 2c74604b263d6bfb4c79436f68b82ed6e9c2a9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wies=C5=82aw=20=C5=A0olt=C3=A9s?= Date: Tue, 3 Apr 2018 19:09:21 +0200 Subject: [PATCH] Added resources --- src/BatchEncoder.vcxproj | 19 +- src/BatchEncoder.vcxproj.filters | 21 ++ src/MainApp.cpp | 2 +- src/res/icon.ico | Bin 0 -> 1406 bytes src/res/icon.rc | 1 + src/res/icon.xpm | 24 ++ src/res/version.h | 45 +++ src/res/version.rc | 32 ++ src/ui/MainFrame.cpp | 23 +- src/ui/MainFrame.h | 2 + src/ui/UI.fbp | 620 ++++++++++++++++++------------- src/ui/UIAboutDialog.cpp | 2 + src/ui/UIAboutDialog.h | 2 + src/ui/UIMainFrame.cpp | 2 + src/ui/UIMainFrame.h | 4 + 15 files changed, 524 insertions(+), 275 deletions(-) create mode 100644 src/res/icon.ico create mode 100644 src/res/icon.rc create mode 100644 src/res/icon.xpm create mode 100644 src/res/version.h create mode 100644 src/res/version.rc diff --git a/src/BatchEncoder.vcxproj b/src/BatchEncoder.vcxproj index 4846a05..60fa5d5 100644 --- a/src/BatchEncoder.vcxproj +++ b/src/BatchEncoder.vcxproj @@ -75,13 +75,13 @@ bin\$(Configuration)\$(Platform)\ obj\$(Configuration)\$(Platform)\ ..\wx\lib\vc_lib;$(VC_LibraryPath_x86);$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86 - ..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); + .\;..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); true bin\$(Configuration)\$(Platform)\ obj\$(Configuration)\$(Platform)\ - ..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); + .\;..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); ..\wx\lib\vc_x64_lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 @@ -89,13 +89,13 @@ bin\$(Configuration)\$(Platform)\ obj\$(Configuration)\$(Platform)\ ..\wx\lib\vc_lib;$(VC_LibraryPath_x86);$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86 - ..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); + .\;..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); false bin\$(Configuration)\$(Platform)\ obj\$(Configuration)\$(Platform)\ - ..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); + .\;..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath); ..\wx\lib\vc_x64_lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64 @@ -168,6 +168,7 @@ + @@ -193,6 +194,16 @@ + + + + + + + + + + diff --git a/src/BatchEncoder.vcxproj.filters b/src/BatchEncoder.vcxproj.filters index ff33e9c..d732bce 100644 --- a/src/BatchEncoder.vcxproj.filters +++ b/src/BatchEncoder.vcxproj.filters @@ -51,6 +51,9 @@ Header Files\UI + + Resource Files + @@ -78,4 +81,22 @@ Source Files\UI + + + Resource Files + + + + + Resource Files + + + Resource Files + + + + + Resource Files + + \ No newline at end of file diff --git a/src/MainApp.cpp b/src/MainApp.cpp index f5813d5..0c1b133 100644 --- a/src/MainApp.cpp +++ b/src/MainApp.cpp @@ -6,7 +6,7 @@ #endif #include "MainApp.h" -#include "ui\UIMainFrame.h" +#include "ui/UIMainFrame.h" bool MainApp::OnInit() { diff --git a/src/res/icon.ico b/src/res/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5fd0457d1501ecb3bb436a56ff92cbc6db772c05 GIT binary patch literal 1406 zcmZQzU<5(|0R|x8V8~!)U=RbcG=LZ+qyWT>Kyff&givrcl<(x^#1Ih?!O+&$#xQH< zOolmg<}jo_+QM+*{CS3FPo6S-eE)&r+qZ8>nn#(VAut*OLp=ok|Nl><7ucWxrW}(G zl3`Lu^16MK={B2Lce45VNrH!HRGapdbL@Kg>}4nStQ|6rTsu RU<{Ny55o39IVgtd0{{UAF*pDK literal 0 HcmV?d00001 diff --git a/src/res/icon.rc b/src/res/icon.rc new file mode 100644 index 0000000..5f2053e --- /dev/null +++ b/src/res/icon.rc @@ -0,0 +1 @@ +101 ICON "icon.ico" diff --git a/src/res/icon.xpm b/src/res/icon.xpm new file mode 100644 index 0000000..e0a8680 --- /dev/null +++ b/src/res/icon.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char *icon_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 2 1 ", +" c #B4E265", +". c None", +/* pixels */ +"................", +"................", +".. ......", +".. ......", +".. .... ......", +".. .... ..", +".. .... ..", +".. ........ ..", +".. ........ ..", +".. .... ..", +".. .... ..", +"...... .... ..", +"...... ..", +"...... ..", +"................", +"................" +}; diff --git a/src/res/version.h b/src/res/version.h new file mode 100644 index 0000000..6d018a8 --- /dev/null +++ b/src/res/version.h @@ -0,0 +1,45 @@ +#define VERSION_MAJOR 5 +#define VERSION_MINOR 0 +#define VERSION_REVISION 0 +#define VERSION_BUILD 0 + +#define STRINGIZE2(s) #s +#define STRINGIZE(s) STRINGIZE2(s) + +#define VER_FILE_COMPANY_NAME_STR "Wieslaw Soltes" +#define VER_FILE_DESCRIPTION_STR "BatchEncoder (Audio Conversion GUI)" +#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD +#define VER_FILE_VERSION_LONG_STR STRINGIZE(VERSION_MAJOR) \ + "." STRINGIZE(VERSION_MINOR) \ + "." STRINGIZE(VERSION_REVISION) \ + "." STRINGIZE(VERSION_BUILD) +#define VER_FILE_VERSION_SHORT_STR STRINGIZE(VERSION_MAJOR) \ + "." STRINGIZE(VERSION_MINOR) + +#define VER_PRODUCTNAME_STR "BatchEncoder" +#define VER_PRODUCT_VERSION VER_FILE_VERSION +#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_LONG_STR + +#if LIBRARY_EXPORTS +#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".dll" +#else +#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".exe" +#endif +#define VER_INTERNAL_NAME_STR VER_ORIGINAL_FILENAME_STR + +#define VER_COPYRIGHT_STR "Copyright (c) Wieslaw Soltes. All rights reserved." + +#ifdef _DEBUG +#define VER_VER_DEBUG VS_FF_DEBUG +#else +#define VER_VER_DEBUG 0 +#endif + +#define VER_FILEOS VOS_NT_WINDOWS32 +#define VER_FILEFLAGS VER_VER_DEBUG + +#if LIBRARY_EXPORTS +#define VER_FILETYPE VFT_DLL +#else +#define VER_FILETYPE VFT_APP +#endif diff --git a/src/res/version.rc b/src/res/version.rc new file mode 100644 index 0000000..f2865ec --- /dev/null +++ b/src/res/version.rc @@ -0,0 +1,32 @@ +#include "verrsrc.h" +#include "version.h" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILE_VERSION +PRODUCTVERSION VER_PRODUCT_VERSION + FILEFLAGSMASK 0x3fL + FILEFLAGSMASK 0x3fL + FILEFLAGS VER_FILEFLAGS + FILEOS VOS_NT_WINDOWS32 + FILETYPE VER_FILETYPE + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", VER_FILE_COMPANY_NAME_STR "\0" + VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0" + VALUE "FileVersion", VER_FILE_VERSION_LONG_STR "\0" + VALUE "InternalName", VER_INTERNAL_NAME_STR "\0" + VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0" + VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0" + VALUE "ProductName", VER_PRODUCTNAME_STR "\0" + VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/src/ui/MainFrame.cpp b/src/ui/MainFrame.cpp index 66de27b..b153213 100644 --- a/src/ui/MainFrame.cpp +++ b/src/ui/MainFrame.cpp @@ -9,6 +9,8 @@ #include "MainFrame.h" +#include "res/icon.xpm" + /////////////////////////////////////////////////////////////////////////// MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) @@ -2052,23 +2054,32 @@ AboutDialog::AboutDialog( wxWindow* parent, wxWindowID id, const wxString& title m_panelAbout = new wxPanel( m_panelContent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizerAbout; - bSizerAbout = new wxBoxSizer( wxVERTICAL ); + bSizerAbout = new wxBoxSizer( wxHORIZONTAL ); - m_staticApplicationName = new wxStaticText( m_panelAbout, wxID_ANY, _("BatchEncoder (Audio Conversion GUI)"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); + m_bitmapIcon = new wxStaticBitmap( m_panelAbout, wxID_ANY, wxBitmap( icon_xpm ), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerAbout->Add( m_bitmapIcon, 0, wxALL, 5 ); + + wxBoxSizer* bSizerInfo; + bSizerInfo = new wxBoxSizer( wxVERTICAL ); + + m_staticApplicationName = new wxStaticText( m_panelAbout, wxID_ANY, _("BatchEncoder"), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); m_staticApplicationName->Wrap( -1 ); m_staticApplicationName->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); - bSizerAbout->Add( m_staticApplicationName, 0, wxALL|wxEXPAND, 5 ); + bSizerInfo->Add( m_staticApplicationName, 0, wxALL|wxEXPAND, 5 ); m_hyperlinkApplicationWebsite = new wxHyperlinkCtrl( m_panelAbout, wxID_ANY, _("Website"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE ); - bSizerAbout->Add( m_hyperlinkApplicationWebsite, 0, wxALIGN_CENTER|wxALL, 5 ); + bSizerInfo->Add( m_hyperlinkApplicationWebsite, 0, wxALIGN_CENTER|wxALL, 5 ); m_hyperlinkApplicationEmail = new wxHyperlinkCtrl( m_panelAbout, wxID_ANY, _("E-mail"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE ); - bSizerAbout->Add( m_hyperlinkApplicationEmail, 0, wxALIGN_CENTER|wxALL, 5 ); + bSizerInfo->Add( m_hyperlinkApplicationEmail, 0, wxALIGN_CENTER|wxALL, 5 ); m_staticApplicationLicense = new wxStaticText( m_panelAbout, wxID_ANY, _("Licensed under the MIT license. See LICENSE file in the application root for full license information."), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE ); m_staticApplicationLicense->Wrap( 1000 ); - bSizerAbout->Add( m_staticApplicationLicense, 0, wxALL|wxEXPAND, 5 ); + bSizerInfo->Add( m_staticApplicationLicense, 0, wxALL|wxEXPAND, 5 ); + + + bSizerAbout->Add( bSizerInfo, 1, wxEXPAND, 5 ); m_panelAbout->SetSizer( bSizerAbout ); diff --git a/src/ui/MainFrame.h b/src/ui/MainFrame.h index 3757347..a7bfcfe 100644 --- a/src/ui/MainFrame.h +++ b/src/ui/MainFrame.h @@ -38,6 +38,7 @@ #include #include #include +#include #include /////////////////////////////////////////////////////////////////////////// @@ -521,6 +522,7 @@ class AboutDialog : public wxDialog wxPanel* m_panelContent; wxPanel* m_panelTop; wxPanel* m_panelAbout; + wxStaticBitmap* m_bitmapIcon; wxStaticText* m_staticApplicationName; wxHyperlinkCtrl* m_hyperlinkApplicationWebsite; wxHyperlinkCtrl* m_hyperlinkApplicationEmail; diff --git a/src/ui/UI.fbp b/src/ui/UI.fbp index 0268567..56eef3b 100644 --- a/src/ui/UI.fbp +++ b/src/ui/UI.fbp @@ -15047,7 +15047,7 @@ 5 wxEXPAND | wxALL 1 - + 1 1 1 @@ -15121,16 +15121,16 @@ - + bSizerAbout - wxVERTICAL + wxHORIZONTAL none - + 5 - wxALL|wxEXPAND + wxALL 0 - + 1 1 1 @@ -15141,6 +15141,7 @@ + Load From File; res\icon.xpm 1 0 @@ -15154,11 +15155,10 @@ 1 1 - ,90,92,-1,70,0 + 0 0 wxID_ANY - BatchEncoder (Audio Conversion GUI) 0 @@ -15166,7 +15166,7 @@ 0 1 - m_staticApplicationName + m_bitmapIcon 1 @@ -15176,14 +15176,12 @@ Resizable 1 - wxALIGN_CENTRE ; forward_declare 0 - -1 @@ -15209,261 +15207,355 @@ - + 5 - wxALIGN_CENTER|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - - wxID_ANY - Website - - 0 - - - 0 + wxEXPAND + 1 + - 1 - m_hyperlinkApplicationWebsite - - 1 - - - protected - 1 - - Resizable - 1 - - wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE - ; forward_declare - 0 - - - - - - - - - - m_hyperlinkApplicationWebsiteOnHyperlink - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_CENTER|wxALL - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - - wxID_ANY - E-mail - - 0 - - - 0 - - 1 - m_hyperlinkApplicationEmail - - 1 - - - protected - 1 - - Resizable - 1 - - wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE - ; forward_declare - 0 - - - - - - - - - - m_hyperlinkApplicationEmailOnHyperlink - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALL|wxEXPAND - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Licensed under the MIT license. See LICENSE file in the application root for full license information. - - 0 - - - 0 - - 1 - m_staticApplicationLicense - 1 - - - protected - 1 - - Resizable - 1 - - wxALIGN_CENTRE - ; forward_declare - 0 - - - - - 1000 - - - - - - - - - - - - - - - - - - - - - - - + bSizerInfo + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,92,-1,70,0 + 0 + 0 + wxID_ANY + BatchEncoder + + 0 + + + 0 + + 1 + m_staticApplicationName + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTRE + ; forward_declare + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + + wxID_ANY + Website + + 0 + + + 0 + + 1 + m_hyperlinkApplicationWebsite + + 1 + + + protected + 1 + + Resizable + 1 + + wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE + ; forward_declare + 0 + + + + + + + + + + m_hyperlinkApplicationWebsiteOnHyperlink + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_CENTER|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + + wxID_ANY + E-mail + + 0 + + + 0 + + 1 + m_hyperlinkApplicationEmail + + 1 + + + protected + 1 + + Resizable + 1 + + wxHL_ALIGN_CENTRE|wxHL_DEFAULT_STYLE + ; forward_declare + 0 + + + + + + + + + + m_hyperlinkApplicationEmailOnHyperlink + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALL|wxEXPAND + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Licensed under the MIT license. See LICENSE file in the application root for full license information. + + 0 + + + 0 + + 1 + m_staticApplicationLicense + 1 + + + protected + 1 + + Resizable + 1 + + wxALIGN_CENTRE + ; forward_declare + 0 + + + + + 1000 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ui/UIAboutDialog.cpp b/src/ui/UIAboutDialog.cpp index ec5ba89..61938a5 100644 --- a/src/ui/UIAboutDialog.cpp +++ b/src/ui/UIAboutDialog.cpp @@ -11,6 +11,8 @@ void UIAboutDialog::AboutDialogOnInitDialog(wxInitDialogEvent& event) { this->Bind(wxEVT_CHAR_HOOK, &UIAboutDialog::OnCharHook, this); + m_staticApplicationName->SetLabel(_(VER_PRODUCTNAME_STR " v" VER_FILE_VERSION_SHORT_STR " " VER_COPYRIGHT_STR)); + m_hyperlinkApplicationWebsite->SetLabel(L"https://github.com/wieslawsoltes/BatchEncoder"); m_hyperlinkApplicationWebsite->SetURL(L"https://github.com/wieslawsoltes/BatchEncoder"); diff --git a/src/ui/UIAboutDialog.h b/src/ui/UIAboutDialog.h index 3391401..2ae86bc 100644 --- a/src/ui/UIAboutDialog.h +++ b/src/ui/UIAboutDialog.h @@ -10,6 +10,8 @@ Subclass of AboutDialog, which is generated by wxFormBuilder. //// end generated include +#include "res/version.h" + /** Implementing AboutDialog */ class UIAboutDialog : public AboutDialog { diff --git a/src/ui/UIMainFrame.cpp b/src/ui/UIMainFrame.cpp index 83bdead..f36c624 100644 --- a/src/ui/UIMainFrame.cpp +++ b/src/ui/UIMainFrame.cpp @@ -5,6 +5,8 @@ UIMainFrame::UIMainFrame(wxWindow* parent) : MainFrame(parent) { + this->SetIcon(wxIcon(icon_xpm)); + this->DragAcceptFiles(true); this->Connect(wxEVT_DROP_FILES, wxDropFilesEventHandler(UIMainFrame::MainFrameOnDropFiles), NULL, this); diff --git a/src/ui/UIMainFrame.h b/src/ui/UIMainFrame.h index 81171fb..98f1f67 100644 --- a/src/ui/UIMainFrame.h +++ b/src/ui/UIMainFrame.h @@ -20,6 +20,10 @@ Subclass of MainFrame, which is generated by wxFormBuilder. #include "UIToolsDialog.h" #include "UIPathsDialog.h" #include "UIAboutDialog.h" + +#include "res/version.h" +#include "res/icon.xpm" + class CItem { public: