This commit is contained in:
Wiesław Šoltés 2018-04-02 12:27:21 +02:00
Коммит 28c8f275b7
38 изменённых файлов: 20148 добавлений и 0 удалений

20
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,20 @@
# Auto detect text files and perform LF normalization
* text eol=crlf
*.sh text eol=lf
*.png -text
*.ico -text
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

288
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,288 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs

3
.gitmodules поставляемый Normal file
Просмотреть файл

@ -0,0 +1,3 @@
[submodule "wx"]
path = wx
url = https://github.com/wxWidgets/wxWidgets.git

31
BatchEncoder.sln Normal file
Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2011
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BatchEncoder", "src\BatchEncoder.vcxproj", "{4BB519D0-F31A-461F-B69B-486ECA95DE90}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Debug|Win32.ActiveCfg = Debug|Win32
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Debug|Win32.Build.0 = Debug|Win32
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Debug|x64.ActiveCfg = Debug|x64
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Debug|x64.Build.0 = Debug|x64
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Release|Win32.ActiveCfg = Release|Win32
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Release|Win32.Build.0 = Release|Win32
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Release|x64.ActiveCfg = Release|x64
{4BB519D0-F31A-461F-B69B-486ECA95DE90}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9FEEEA5A-ED55-4343-96C8-EC2C2DC1E00A}
EndGlobalSection
EndGlobal

147
README.md Normal file
Просмотреть файл

@ -0,0 +1,147 @@
# BatchEncoder wxWidgets Demo
[![Build status](https://ci.appveyor.com/api/projects/status/94lrua2fmv0rlv51/branch/master?svg=true)](https://ci.appveyor.com/project/wieslawsoltes/batchencoderwx/branch/master)
## Screenshots
### File list
[![File List](screenshots/FileList.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/FileList.png)
### Conversion progress
[![File List Converting](screenshots/FileListConverting.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/FileListConverting.png)
### Configure presets
[![Configure Presets](screenshots/ConfigurePresets.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/ConfigurePresets.png)
### Configure formats
[![Configure Formats](screenshots/ConfigureFormats.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/ConfigureFormats.png)
### Configure tools
[![Configure Tools](screenshots/ConfigureTools.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/ConfigureTools.png)
### Edit paths
[![Edit paths](screenshots/EditPaths.png)](https://github.com/wieslawsoltes/BatchEncoderWx/blob/master/screenshots/EditPaths.png)
## UI
Download and install wxFormBuilder:
```
https://github.com/wxFormBuilder/wxFormBuilder/releases/download/v3.6.2/wxFormBuilder_v3.6.2.exe
```
Open and edit `src\ui\UI.fbp` project and then got to `File > Generate Code` and `Tools > Generated Inherited Class`.
## Build
### Sources
Clone the `BatchEncoder` source code repository.
```
git clone https://github.com/wieslawsoltes/BatchEncoderWx.git
```
Update `wxWidgets` submodule.
```
git submodule update --init --recursive
```
### RuntimeLibrary
Patch `RuntimeLibrary`:
```
.\build.ps1 -Target "Patch-RuntimeLibrary"
```
Restore `RuntimeLibrary`:
```
.\build.ps1 -Target "Restore-RuntimeLibrary"
```
### wxWidgets
Currently used `wxWidgets` version is `3.1.1`.
Open `wx\build\msw\wx_vc15.sln` solution.
Build the following projects:
```
core
net
xml
adv
html
gl
qa
xrc
aui
propgrid
ribbon
richtext
media
stc
webview
```
using the following configurations:
```
Debug|Win32
Debug|x64
Release|Win32
Release|x64
```
You can use `Build > Batch Build...` tool to batch build all projects and configurations.
### BatchEncoder
Use `Visual Studio 2017 Community Edition` to open `BatchEncoder.sln` solution and `Build`.
## Links
* https://github.com/wxWidgets/wxWidgets
* https://github.com/wxWidgets/wxWidgets/blob/master/docs/msw/install.txt
* https://www.wxwidgets.org/
* https://www.wxwidgets.org/docs/tutorials/
### Docs
* http://docs.wxwidgets.org/
* http://docs.wxwidgets.org/3.1.1/overview_helloworld.html
* http://docs.wxwidgets.org/3.1.1/page_libs.html
* http://docs.wxwidgets.org/3.1.1/overview_cmndlg.html
### Wiki
* https://wiki.wxwidgets.org/Main_Page
* https://wiki.wxwidgets.org/Guides_%26_Tutorials
* https://wiki.wxwidgets.org/WxWidgets_For_MFC_Programmers
* https://wiki.wxwidgets.org/Microsoft_Visual_C%2B%2B_Guide
* https://wiki.wxwidgets.org/Reducing_Executable_Size
* https://wiki.wxwidgets.org/Precompiled_Headers
* https://wiki.wxwidgets.org/WxListCtrl
* https://wiki.wxwidgets.org/Beech:Using_common_dialogs
### Forums
* https://forums.wxwidgets.org/index.php
### Tools
* https://github.com/wxFormBuilder/wxFormBuilder
### Books
* https://www.wxwidgets.org/docs/book/
* https://books.google.pl/books?id=CyMsvtgnq0QC&lpg=PA188&dq=wxWidgets%20xml%20layout&hl=pl&pg=PP1#v=onepage&q&f=false
### Articles
* https://www.codeproject.com/Articles/11515/Introduction-to-wxWidgets
* https://usingcpp.wordpress.com/2016/01/26/creating-wxwidgets-programs-with-visual-studio-2015/
* http://www.zytrax.com/tech/survival/wxwidgets.html

9
appveyor.yml Normal file
Просмотреть файл

@ -0,0 +1,9 @@
version: '{build}'
image: Visual Studio 2017
before_build:
- git submodule update --init --recursive
build_script:
- ps: .\build.ps1 -Target "Build"
test: off
artifacts:
- path: src\bin\Release\Win32\*.exe

205
build.cake Normal file
Просмотреть файл

@ -0,0 +1,205 @@
///////////////////////////////////////////////////////////////////////////////
// USINGS
///////////////////////////////////////////////////////////////////////////////
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading.Tasks;
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
///////////////////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
///////////////////////////////////////////////////////////////////////////////
// SETTINGS
///////////////////////////////////////////////////////////////////////////////
var platforms = new string[] { "Win32" }.ToList();
var configurations = new string[] { "Release" }.ToList();
var tests = new string[] { }.ToList();
var solution = "./BatchEncoder.sln";
var wx = "./wx/build/msw/wx_vc15.sln";
var patterns = new string[] {
"./src/*.vcxproj",
"./wx/build/msw/*.vcxproj"
}.ToList();
string MDd = "<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>";
string MTd = "<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>";
string MD = "<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>";
string MT = "<RuntimeLibrary>MultiThreaded</RuntimeLibrary>";
///////////////////////////////////////////////////////////////////////////////
// HELPERS
///////////////////////////////////////////////////////////////////////////////
class Patch
{
public string FromName { get; set; }
public string ToName { get; set; }
public string FromText { get; set; }
public string ToText { get; set; }
public Patch(string fromName, string toName, string fromText, string toText)
{
FromName = fromName;
ToName = toName;
FromText = fromText;
ToText = toText;
}
}
static class Helpers
{
public static string FileReadText(ICakeContext context, FilePath file)
{
var filename = file.MakeAbsolute(context.Environment).FullPath;
return System.IO.File.ReadAllText(filename);
}
public static void FileWriteText(ICakeContext context, FilePath file, string text, bool bom)
{
var filename = file.MakeAbsolute(context.Environment).FullPath;
System.IO.File.WriteAllText(filename, text, new System.Text.UTF8Encoding(bom));
}
public static FilePath[] ReplaceTextInFiles(ICakeContext context, string pattern, string findText, string replaceText, bool bom)
{
var files = context.Globber.GetFiles(pattern);
var results = new ConcurrentBag<FilePath>();
Parallel.ForEach(files, f => {
var contents = FileReadText(context, f);
if (contents.Contains(findText)) {
contents = contents.Replace(findText, replaceText);
FileWriteText(context, f, contents, bom);
results.Add(f);
}
});
return results.ToArray();
}
}
///////////////////////////////////////////////////////////////////////////////
// SETUP
///////////////////////////////////////////////////////////////////////////////
Setup(context =>
{
context.Log.Verbosity = Verbosity.Normal;
});
///////////////////////////////////////////////////////////////////////////////
// TEARDOWN
///////////////////////////////////////////////////////////////////////////////
Teardown(context =>
{
Information("Finished running tasks.");
});
///////////////////////////////////////////////////////////////////////////////
// ACTIONS
///////////////////////////////////////////////////////////////////////////////
var buildSolutionAction = new Action<string,string,string> ((solution, configuration, platform) =>
{
Information("Building: {0}, {1} / {2}", solution, configuration, platform);
MSBuild(solution, settings => {
settings.SetConfiguration(configuration);
settings.WithProperty("Platform", "\"" + platform + "\"");
settings.SetVerbosity(Verbosity.Minimal); });
});
///////////////////////////////////////////////////////////////////////////////
// TASKS
///////////////////////////////////////////////////////////////////////////////
Task("Clean")
.Does(() =>
{
CleanDirectories("./**/bin/**");
CleanDirectories("./**/obj/**");
});
Task("Build-Dependencies")
.IsDependentOn("Clean")
.IsDependentOn("Patch-RuntimeLibrary")
.Does(() =>
{
configurations.ForEach(c =>
{
platforms.ForEach(p =>
{
buildSolutionAction(wx, c, p);
});
});
});
Task("Build")
.IsDependentOn("Build-Dependencies")
.Does(() =>
{
configurations.ForEach(c =>
{
platforms.ForEach(p =>
{
buildSolutionAction(solution, c, p);
});
});
});
Task("Patch-RuntimeLibrary")
.Does(context =>
{
var patches = new Patch[] {
new Patch("MDd", "MTd", MDd, MTd),
new Patch("MD", "MT", MD, MT),
}.ToList();
Information("Patching runtime library:");
patterns.ForEach(pattern =>
{
patches.ForEach(patch =>
{
Information("Patching from: {0} to: {1}", patch.FromName, patch.ToName);
FilePath[] files = Helpers.ReplaceTextInFiles(context, pattern, patch.FromText, patch.ToText, false);
foreach (var file in files) {
Information("Project: {0}", file);
}
});
});
});
Task("Restore-RuntimeLibrary")
.Does(context =>
{
var patches = new Patch[] {
new Patch("MTd", "MDd", MTd, MDd),
new Patch("MT", "MD", MT, MD),
}.ToList();
Information("Restoring runtime library:");
patterns.ForEach(pattern =>
{
patches.ForEach(patch =>
{
Information("Restoring from: {0} to: {1}", patch.FromName, patch.ToName);
FilePath[] files = Helpers.ReplaceTextInFiles(context, pattern, patch.FromText, patch.ToText, false);
foreach (var file in files) {
Information("Project: {0}", file);
}
});
});
});
///////////////////////////////////////////////////////////////////////////////
// TARGETS
///////////////////////////////////////////////////////////////////////////////
Task("Default")
.IsDependentOn("Build");
///////////////////////////////////////////////////////////////////////////////
// EXECUTE
///////////////////////////////////////////////////////////////////////////////
RunTarget(target);

167
build.ps1 Normal file
Просмотреть файл

@ -0,0 +1,167 @@
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER Experimental
Tells Cake to use the latest Roslyn release.
.PARAMETER WhatIf
Performs a dry run of the build script.
No tasks will be executed.
.PARAMETER Mono
Tells Cake to use the Mono scripting engine.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
http://cakebuild.net
#>
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[switch]$Experimental,
[Alias("DryRun","Noop")]
[switch]$WhatIf,
[switch]$Mono,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}
[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}
Write-Host "Preparing to run build script..."
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$UseMono = "";
if($Mono.IsPresent) {
Write-Verbose -Message "Using the Mono based scripting engine."
$UseMono = "-mono"
}
$UseExperimental = "";
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
Write-Verbose -Message "Using experimental version of Roslyn."
$UseExperimental = "-experimental"
}
$UseDryRun = "";
if($WhatIf.IsPresent) {
$UseDryRun = "-dryrun"
}
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type directory | out-null
}
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
Throw "Could not download packages.config."
}
}
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}
$ENV:NUGET_EXE = $NUGET_EXE
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Remove-Item * -Recurse -Exclude packages.config,nuget.exe
}
Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occured while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | out-string)
Pop-Location
}
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}
Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE

83
build.sh Normal file
Просмотреть файл

@ -0,0 +1,83 @@
#!/usr/bin/env bash
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
NUGET_EXE=$TOOLS_DIR/nuget.exe
CAKE_EXE=$TOOLS_DIR/Cake/Cake.exe
PACKAGES_CONFIG=$TOOLS_DIR/packages.config
PACKAGES_CONFIG_MD5=$TOOLS_DIR/packages.config.md5sum
MD5_EXE=
if [[ "$(uname -s)" == "Darwin" ]]; then
MD5_EXE="md5 -r"
else
MD5_EXE="md5sum"
fi
SCRIPT="build.cake"
TARGET="Default"
VERBOSITY="verbose"
DRYRUN=
SHOW_VERSION=false
SCRIPT_ARGUMENTS=()
for i in "$@"; do
case $1 in
-s|--script) SCRIPT="$2"; shift ;;
-t|--target) TARGET="$2"; shift ;;
-v|--verbosity) VERBOSITY="$2"; shift ;;
-d|--dryrun) DRYRUN="-dryrun" ;;
--version) SHOW_VERSION=true ;;
--) shift; SCRIPT_ARGUMENTS+=("$@"); break ;;
*) SCRIPT_ARGUMENTS+=("$1") ;;
esac
shift
done
if [ ! -d "$TOOLS_DIR" ]; then
mkdir "$TOOLS_DIR"
fi
if [ ! -f "$TOOLS_DIR/packages.config" ]; then
echo "Downloading packages.config..."
curl -Lsfo "$TOOLS_DIR/packages.config" http://cakebuild.net/download/bootstrapper/packages
if [ $? -ne 0 ]; then
echo "An error occured while downloading packages.config."
exit 1
fi
fi
if [ ! -f "$NUGET_EXE" ]; then
echo "Downloading NuGet..."
curl -Lsfo "$NUGET_EXE" https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
if [ $? -ne 0 ]; then
echo "An error occured while downloading nuget.exe."
exit 1
fi
fi
pushd "$TOOLS_DIR" >/dev/null
if [ ! -f $PACKAGES_CONFIG_MD5 ] || [ "$( cat $PACKAGES_CONFIG_MD5 | sed 's/\r$//' )" != "$( $MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' )" ]; then
find . -type d ! -name . | xargs rm -rf
fi
mono "$NUGET_EXE" install -ExcludeVersion
if [ $? -ne 0 ]; then
echo "Could not restore NuGet packages."
exit 1
fi
$MD5_EXE $PACKAGES_CONFIG | awk '{ print $1 }' >| $PACKAGES_CONFIG_MD5
popd >/dev/null
if [ ! -f "$CAKE_EXE" ]; then
echo "Could not find Cake.exe at '$CAKE_EXE'."
exit 1
fi
if $SHOW_VERSION; then
exec mono "$CAKE_EXE" -version
else
exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}"
fi

Двоичные данные
screenshots/About.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 4.7 KiB

Двоичные данные
screenshots/ConfigureFormats.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 16 KiB

Двоичные данные
screenshots/ConfigurePresets.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 12 KiB

Двоичные данные
screenshots/ConfigureTools.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 14 KiB

Двоичные данные
screenshots/EditPaths.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 11 KiB

Двоичные данные
screenshots/FileList.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 24 KiB

Двоичные данные
screenshots/FileListConverting.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 21 KiB

199
src/BatchEncoder.vcxproj Normal file
Просмотреть файл

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{4BB519D0-F31A-461F-B69B-486ECA95DE90}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>BatchEncoder</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\$(Configuration)\$(Platform)\</OutDir>
<IntDir>obj\$(Configuration)\$(Platform)\</IntDir>
<LibraryPath>..\wx\lib\vc_lib;$(VC_LibraryPath_x86);$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
<IncludePath>..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\$(Configuration)\$(Platform)\</OutDir>
<IntDir>obj\$(Configuration)\$(Platform)\</IntDir>
<IncludePath>..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\wx\lib\vc_x64_lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>bin\$(Configuration)\$(Platform)\</OutDir>
<IntDir>obj\$(Configuration)\$(Platform)\</IntDir>
<LibraryPath>..\wx\lib\vc_lib;$(VC_LibraryPath_x86);$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
<IncludePath>..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>bin\$(Configuration)\$(Platform)\</OutDir>
<IntDir>obj\$(Configuration)\$(Platform)\</IntDir>
<IncludePath>..\wx\include\msvc;..\wx\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\wx\lib\vc_x64_lib;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WXMSW__;WX_PRECOMP;NOPCH;__WXDEBUG__;WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WXMSW__;WX_PRECOMP;NOPCH;__WXDEBUG__;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WXMSW__;WX_PRECOMP;NOPCH;WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>__WXMSW__;WX_PRECOMP;NOPCH;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>wx/wxprec.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="MainApp.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="ui\ItemsList.h" />
<ClInclude Include="ui\MainFrame.h" />
<ClInclude Include="ui\UIAboutDialog.h" />
<ClInclude Include="ui\UIFormatsDialog.h" />
<ClInclude Include="ui\UIMainFrame.h" />
<ClInclude Include="ui\UIPathsDialog.h" />
<ClInclude Include="ui\UIPresetsDialog.h" />
<ClInclude Include="ui\UIToolsDialog.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="MainApp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ui\MainFrame.cpp" />
<ClCompile Include="ui\UIAboutDialog.cpp" />
<ClCompile Include="ui\UIFormatsDialog.cpp" />
<ClCompile Include="ui\UIMainFrame.cpp" />
<ClCompile Include="ui\UIPathsDialog.cpp" />
<ClCompile Include="ui\UIPresetsDialog.cpp" />
<ClCompile Include="ui\UIToolsDialog.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

Просмотреть файл

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Header Files\UI">
<UniqueIdentifier>{b5bce955-ec36-40e2-af95-63f392d88997}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\UI">
<UniqueIdentifier>{90478976-0930-4740-b72e-0422be74e007}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="MainApp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ui\MainFrame.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIFormatsDialog.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIMainFrame.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIPathsDialog.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIPresetsDialog.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIToolsDialog.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\UIAboutDialog.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
<ClInclude Include="ui\ItemsList.h">
<Filter>Header Files\UI</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="MainApp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ui\MainFrame.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIFormatsDialog.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIMainFrame.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIPathsDialog.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIPresetsDialog.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIToolsDialog.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
<ClCompile Include="ui\UIAboutDialog.cpp">
<Filter>Source Files\UI</Filter>
</ClCompile>
</ItemGroup>
</Project>

23
src/MainApp.cpp Normal file
Просмотреть файл

@ -0,0 +1,23 @@
#include "targetver.h"
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include "MainApp.h"
#include "ui\UIMainFrame.h"
bool MainApp::OnInit()
{
UIMainFrame *frame = new UIMainFrame(nullptr);
frame->Show(true);
return true;
}
int MainApp::OnExit()
{
return wxApp::OnExit();
}
wxIMPLEMENT_APP(MainApp);

8
src/MainApp.h Normal file
Просмотреть файл

@ -0,0 +1,8 @@
#pragma once
class MainApp : public wxApp
{
public:
virtual bool OnInit();
virtual int OnExit();
};

8
src/targetver.h Normal file
Просмотреть файл

@ -0,0 +1,8 @@
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>

87
src/ui/ItemsList.h Normal file
Просмотреть файл

@ -0,0 +1,87 @@
#ifndef __ItemsList__
#define __ItemsList__
#include <wx/listctrl.h>
#include <functional>
#include <string>
class ItemColumn
{
public:
long nIndex;
std::wstring szHeading;
int nWidth;
};
class ItemsList : public wxListCtrl
{
public:
std::function<std::wstring(int, int)> GetText = nullptr;
std::function<void(int, int, const wchar_t* text)> SetText = nullptr;
public:
ItemsList(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_ICON,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListCtrlNameStr) :
wxListCtrl(parent, id, pos, size, style, validator, name)
{
// Connect Events
this->Connect(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, wxListEventHandler(ItemsList::m_listCtrlItemsOnListBeginLabelEdit), NULL, this);
this->Connect(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEventHandler(ItemsList::m_listCtrlItemsOnListDeleteAllItems), NULL, this);
this->Connect(wxEVT_COMMAND_LIST_DELETE_ITEM, wxListEventHandler(ItemsList::m_listCtrlItemsOnListDeleteItem), NULL, this);
this->Connect(wxEVT_COMMAND_LIST_END_LABEL_EDIT, wxListEventHandler(ItemsList::m_listCtrlItemsOnListEndLabelEdit), NULL, this);
this->Connect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(ItemsList::m_listCtrlItemsOnListItemDeselected), NULL, this);
this->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ItemsList::m_listCtrlItemsOnListItemSelected), NULL, this);
}
~ItemsList()
{
// Disconnect Events
this->Disconnect(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, wxListEventHandler(ItemsList::m_listCtrlItemsOnListBeginLabelEdit), NULL, this);
this->Disconnect(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEventHandler(ItemsList::m_listCtrlItemsOnListDeleteAllItems), NULL, this);
this->Disconnect(wxEVT_COMMAND_LIST_DELETE_ITEM, wxListEventHandler(ItemsList::m_listCtrlItemsOnListDeleteItem), NULL, this);
this->Disconnect(wxEVT_COMMAND_LIST_END_LABEL_EDIT, wxListEventHandler(ItemsList::m_listCtrlItemsOnListEndLabelEdit), NULL, this);
this->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(ItemsList::m_listCtrlItemsOnListItemDeselected), NULL, this);
this->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ItemsList::m_listCtrlItemsOnListItemSelected), NULL, this);
}
wxString OnGetItemText(long item, long column) const
{
if (GetText != nullptr)
{
return GetText(item, column);
}
return L"??";
}
void m_listCtrlItemsOnListBeginLabelEdit(wxListEvent& event)
{
}
void m_listCtrlItemsOnListDeleteAllItems(wxListEvent& event)
{
}
void m_listCtrlItemsOnListDeleteItem(wxListEvent& event)
{
}
void m_listCtrlItemsOnListEndLabelEdit(wxListEvent& event)
{
if (!event.IsEditCancelled())
{
if (SetText != nullptr)
{
auto id = event.m_item.m_itemId;
auto col = event.m_item.m_col;
auto text = event.m_item.m_text;
SetText(id, col, text);
}
}
}
void m_listCtrlItemsOnListItemDeselected(wxListEvent& event)
{
}
void m_listCtrlItemsOnListItemSelected(wxListEvent& event)
{
}
};
#endif // __ItemsList__

1850
src/ui/MainFrame.cpp Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

456
src/ui/MainFrame.h Normal file
Просмотреть файл

@ -0,0 +1,456 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jan 23 2018)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __MAINFRAME_H__
#define __MAINFRAME_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/stattext.h>
#include <wx/combobox.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
#include <wx/gauge.h>
#include <wx/button.h>
#include <wx/spinctrl.h>
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/textctrl.h>
#include <wx/dialog.h>
#include <wx/radiobut.h>
#include <wx/checkbox.h>
#include <wx/hyperlink.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class MainFrame
///////////////////////////////////////////////////////////////////////////////
class MainFrame : public wxFrame
{
private:
protected:
wxMenuBar* m_menubarMain;
wxMenu* m_menuFile;
wxMenu* m_menuEdit;
wxMenu* m_menuAction;
wxMenu* m_menuOptions;
wxMenu* m_menuLanguage;
wxMenuItem* m_menuItemLanguageDefault;
wxMenu* m_menuHelp;
wxPanel* m_panelContent;
wxPanel* m_panTop;
wxStaticText* m_staticTextFormat;
wxComboBox* m_comboBoxFormats;
wxStaticText* m_staticTextPreset;
wxComboBox* m_comboPresets;
wxPanel* m_panelList;
wxBoxSizer* bSizerList;
wxPanel* m_panelProgress;
wxGauge* m_gaugeProgress;
wxButton* m_buttonStop;
wxPanel* m_panelBottom;
wxStaticText* m_staticTextOutput;
wxComboBox* m_comboBoxOutput;
wxButton* m_buttonBrowse;
wxStaticText* m_staticTextThreads;
wxSpinCtrl* m_spinCtrlThreads;
wxButton* m_buttonConvert;
wxStatusBar* m_statusBarMain;
// Virtual event handlers, overide them in your derived class
virtual void m_menuItemFileLoadListOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemFileSaveListOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemFileClearListOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemFileExitOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditAddFileOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditAddDirOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditRenameOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditEditPathsOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditResetTimeOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditResetOutputOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditRemoveOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditCropOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditRemoveCheckedOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditRemoveUncheckedOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditCheckSelectedOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditUncheckSelectedOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditSelectAllOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditSelectNoneOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditInvertSelectionOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditOpenFileOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemEditOpenDirOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemActionConvertOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsConfigurePresetsOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsConfigureFormatsOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsConfigureToolsOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsDeleteSourceOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsShutownFinishedOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsDoNotSaveOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsDeleteOnErrorOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsStopOnErrorOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsHideConsoleOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsEnsureVisibleOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsFindDecoderOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsValidateFilesOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsOverwriteFilesOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsRenameFilesOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemOptionsDownloadToolsOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemLanguageDefaultOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemHelpWebsiteOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_menuItemHelpAboutOnMenuSelection( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxFormatsOnCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxFormatsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboPresetsOnCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboPresetsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonStopOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxOutputOnCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxOutputOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonBrowseOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_spinCtrlThreadsOnSpinCtrl( wxSpinEvent& event ) { event.Skip(); }
virtual void m_spinCtrlThreadsOnSpinCtrlText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonConvertOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("BatchEncoder"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 756,580 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~MainFrame();
};
///////////////////////////////////////////////////////////////////////////////
/// Class PresetsDialog
///////////////////////////////////////////////////////////////////////////////
class PresetsDialog : public wxDialog
{
private:
protected:
wxPanel* m_panelContent;
wxPanel* m_panelTop;
wxComboBox* m_comboBoxFormats;
wxPanel* m_panelList;
wxBoxSizer* bSizerList;
wxButton* m_buttonDuplicate;
wxButton* m_buttonMoveUp;
wxButton* m_buttonMoveDown;
wxButton* m_buttonDeleteAll;
wxButton* m_buttonDelete;
wxButton* m_buttonAdd;
wxPanel* m_panelProperties;
wxStaticText* m_staticTextPropertyName;
wxTextCtrl* m_textCtrlPropertyName;
wxStaticText* m_staticTextPropertyOptions;
wxTextCtrl* m_textCtrlPropertyOptions;
wxPanel* m_panelBottom;
wxButton* m_buttonImport;
wxButton* m_buttonExport;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void PresetsDialogOnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void m_comboBoxFormatsOnCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxFormatsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDuplicateOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveUpOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveDownOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteAllOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonAddOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyNameOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyOptionsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonImportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonExportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonOKOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonCancelOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
PresetsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure Presets"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 756,580 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~PresetsDialog();
};
///////////////////////////////////////////////////////////////////////////////
/// Class FormatsDialog
///////////////////////////////////////////////////////////////////////////////
class FormatsDialog : public wxDialog
{
private:
protected:
wxPanel* m_panelContent;
wxPanel* m_panelTop;
wxPanel* m_panelList;
wxBoxSizer* bSizerList;
wxButton* m_buttonDuplicate;
wxButton* m_buttonMoveUp;
wxButton* m_buttonMoveDown;
wxButton* m_buttonDeleteAll;
wxButton* m_buttonDelete;
wxButton* m_buttonAdd;
wxPanel* m_panelProperties;
wxStaticText* m_staticTextPropertyName;
wxTextCtrl* m_textCtrlPropertyName;
wxStaticText* m_staticTextPropertyId;
wxTextCtrl* m_textCtrlPropertyId;
wxStaticText* m_staticTextPropertyPriority;
wxSpinCtrl* m_spinCtrlPropertyPriority;
wxStaticText* m_staticTextPropertyInputExtensions;
wxTextCtrl* m_textCtrlPropertyInputExtensions;
wxStaticText* m_staticTextPropertyOutputExtension;
wxTextCtrl* m_textCtrlPropertyOutputExtension;
wxStaticText* m_staticTextPropertyType;
wxRadioButton* m_radioBtnTypeEncoder;
wxRadioButton* m_radioBtnTypeDecoder;
wxStaticText* m_staticTextPropertyExitCodeSuccess;
wxTextCtrl* m_textCtrlPropertyExitCodeSuccess;
wxStaticText* m_staticTextPropertyDefaultPreset;
wxComboBox* m_comboBoxDefaultPreset;
wxButton* m_buttonPropertyDefaultPresetEdit;
wxStaticText* m_staticTextPropertyPipes;
wxCheckBox* m_checkBoxPropertyPipeInput;
wxCheckBox* m_checkBoxPropertyPipeOutput;
wxStaticText* m_staticTextPropertyFunction;
wxTextCtrl* m_textCtrlPropertyFunction;
wxButton* m_buttonPropertyFunctionBrowse;
wxStaticText* m_staticTextPropertyTemplate;
wxTextCtrl* m_textCtrlPropertyTemplate;
wxStaticText* m_staticTextPropertyPath;
wxTextCtrl* m_textCtrlPropertyPath;
wxButton* m_buttonPropertyPathBrowse;
wxPanel* m_panelBottom;
wxButton* m_buttonImport;
wxButton* m_buttonExport;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void FormatsDialogOnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void m_buttonDuplicateOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveUpOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveDownOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteAllOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonAddOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyNameOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyIdOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_spinCtrlPropertyPriorityOnSpinCtrl( wxSpinEvent& event ) { event.Skip(); }
virtual void m_spinCtrlPropertyPriorityOnSpinCtrlText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyInputExtensionsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyOutputExtensionOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_radioBtnTypeEncoderOnRadioButton( wxCommandEvent& event ) { event.Skip(); }
virtual void m_radioBtnTypeDecoderOnRadioButton( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyExitCodeSuccessOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxDefaultPresetOnCombobox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_comboBoxDefaultPresetOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonPropertyDefaultPresetEditOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_checkBoxPropertyPipeInputOnCheckBox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_checkBoxPropertyPipeOutputOnCheckBox( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyFunctionOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonPropertyFunctionBrowseOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyTemplateOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyPathOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonPropertyPathBrowseOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonImportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonExportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonOKOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonCancelOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
FormatsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure Formats"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 756,580 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~FormatsDialog();
};
///////////////////////////////////////////////////////////////////////////////
/// Class ToolsDialog
///////////////////////////////////////////////////////////////////////////////
class ToolsDialog : public wxDialog
{
private:
protected:
wxPanel* m_panelContent;
wxPanel* m_panelTop;
wxButton* m_buttonDownloadSelected;
wxButton* m_buttonSetSelectedPaths;
wxButton* m_buttonSetX86Paths;
wxButton* m_buttonSetX64Paths;
wxPanel* m_panelList;
wxBoxSizer* bSizerList;
wxButton* m_buttonDuplicate;
wxButton* m_buttonMoveUp;
wxButton* m_buttonMoveDown;
wxButton* m_buttonDeleteAll;
wxButton* m_buttonDelete;
wxButton* m_buttonAdd;
wxPanel* m_panelProperties;
wxStaticText* m_staticTextPropertyName;
wxTextCtrl* m_textCtrlPropertyName;
wxStaticText* m_staticTextPropertyPlatform;
wxTextCtrl* m_textCtrlPropertyPlatform;
wxStaticText* m_staticTextPropertyPriority;
wxSpinCtrl* m_spinCtrlPropertyPriority;
wxStaticText* m_staticTextPropertyFormats;
wxTextCtrl* m_textCtrlPropertyFormats;
wxButton* m_buttonPropertyFormatsEdit;
wxStaticText* m_staticTextPropertyUrl;
wxTextCtrl* m_textCtrlPropertyUrl;
wxStaticText* m_staticTextPropertyFile;
wxTextCtrl* m_textCtrlPropertyFile;
wxStaticText* m_staticTextPropertyExtract;
wxTextCtrl* m_textCtrlPropertyExtract;
wxStaticText* m_staticTextPropertyPath;
wxTextCtrl* m_textCtrlPropertyPath;
wxPanel* m_panelBottom;
wxButton* m_buttonImport;
wxButton* m_buttonExport;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void ToolsDialogOnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void m_buttonDownloadSelectedOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonSetSelectedPathsOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonSetX86PathsOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonSetX64PathsOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDuplicateOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveUpOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveDownOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteAllOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonAddOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyNameOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyPlatformOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_spinCtrlPropertyPriorityOnSpinCtrl( wxSpinEvent& event ) { event.Skip(); }
virtual void m_spinCtrlPropertyPriorityOnSpinCtrlText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyFormatsOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonPropertyFormatsEditOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyUrlOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyFileOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyExtractOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyPathOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonImportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonExportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonOKOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonCancelOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
ToolsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure Tools"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 756,580 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~ToolsDialog();
};
///////////////////////////////////////////////////////////////////////////////
/// Class PathsDialog
///////////////////////////////////////////////////////////////////////////////
class PathsDialog : public wxDialog
{
private:
protected:
wxPanel* m_panelContent;
wxPanel* m_panelTop;
wxPanel* m_panelList;
wxBoxSizer* bSizerList;
wxButton* m_buttonDuplicate;
wxButton* m_buttonMoveUp;
wxButton* m_buttonMoveDown;
wxButton* m_buttonDeleteAll;
wxButton* m_buttonDelete;
wxButton* m_buttonAdd;
wxPanel* m_panelProperties;
wxStaticText* m_staticTextPropertyPath;
wxTextCtrl* m_textCtrlPropertyPath;
wxStaticText* m_staticTextPropertySize;
wxTextCtrl* m_textCtrlPropertySize;
wxButton* m_buttonPropertySizeBrowse;
wxPanel* m_panelBottom;
wxButton* m_buttonImport;
wxButton* m_buttonExport;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void PathsDialogOnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void m_buttonDuplicateOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveUpOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonMoveDownOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteAllOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonDeleteOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonAddOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertyPathOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_textCtrlPropertySizeOnText( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonPropertySizeBrowseOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonImportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonExportOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonOKOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
virtual void m_buttonCancelOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
PathsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Edit Paths"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 756,580 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER|wxSYSTEM_MENU );
~PathsDialog();
};
///////////////////////////////////////////////////////////////////////////////
/// Class AboutDialog
///////////////////////////////////////////////////////////////////////////////
class AboutDialog : public wxDialog
{
private:
protected:
wxPanel* m_panelContent;
wxPanel* m_panelTop;
wxPanel* m_panelAbout;
wxStaticText* m_staticApplicationName;
wxHyperlinkCtrl* m_hyperlinkApplicationWebsite;
wxHyperlinkCtrl* m_hyperlinkApplicationEmail;
wxStaticText* m_staticApplicationLicense;
wxPanel* m_panelBottom;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void AboutDialogOnInitDialog( wxInitDialogEvent& event ) { event.Skip(); }
virtual void m_hyperlinkApplicationWebsiteOnHyperlink( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void m_hyperlinkApplicationEmailOnHyperlink( wxHyperlinkEvent& event ) { event.Skip(); }
virtual void m_buttonOKOnButtonClick( wxCommandEvent& event ) { event.Skip(); }
public:
AboutDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 640,200 ), long style = wxDEFAULT_DIALOG_STYLE|wxMINIMIZE_BOX );
~AboutDialog();
};
#endif //__MAINFRAME_H__

14969
src/ui/UI.fbp Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

34
src/ui/UIAboutDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,34 @@
#include <wx/wxprec.h>
#include "UIAboutDialog.h"
UIAboutDialog::UIAboutDialog(wxWindow* parent)
:
AboutDialog(parent)
{
m_buttonOK->SetFocus();
}
void UIAboutDialog::AboutDialogOnInitDialog(wxInitDialogEvent& event)
{
m_hyperlinkApplicationWebsite->SetLabel(L"https://github.com/wieslawsoltes/BatchEncoder");
m_hyperlinkApplicationWebsite->SetURL(L"https://github.com/wieslawsoltes/BatchEncoder");
m_hyperlinkApplicationEmail->SetLabel(L"wieslaw.soltes@gmail.com");
m_hyperlinkApplicationEmail->SetURL(L"mailto:wieslaw.soltes@gmail.com");
}
void UIAboutDialog::m_hyperlinkApplicationWebsiteOnHyperlink(wxHyperlinkEvent& event)
{
wxLaunchDefaultBrowser(m_hyperlinkApplicationWebsite->GetURL());
}
void UIAboutDialog::m_hyperlinkApplicationEmailOnHyperlink(wxHyperlinkEvent& event)
{
wxLaunchDefaultApplication(m_hyperlinkApplicationEmail->GetURL());
}
void UIAboutDialog::m_buttonOKOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_OK);
this->Close();
}

28
src/ui/UIAboutDialog.h Normal file
Просмотреть файл

@ -0,0 +1,28 @@
#ifndef __UIAboutDialog__
#define __UIAboutDialog__
/**
@file
Subclass of AboutDialog, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
/** Implementing AboutDialog */
class UIAboutDialog : public AboutDialog
{
protected:
// Handlers for AboutDialog events.
void AboutDialogOnInitDialog(wxInitDialogEvent& event);
void m_hyperlinkApplicationWebsiteOnHyperlink(wxHyperlinkEvent& event);
void m_hyperlinkApplicationEmailOnHyperlink(wxHyperlinkEvent& event);
void m_buttonOKOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIAboutDialog(wxWindow* parent);
//// end generated class members
};
#endif // __UIAboutDialog__

247
src/ui/UIFormatsDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,247 @@
#include <wx/wxprec.h>
#include "UIFormatsDialog.h"
UIFormatsDialog::UIFormatsDialog(wxWindow* parent)
:
FormatsDialog(parent)
{
for (int i = 0; i < 100; i++)
{
CFormat item;
m_Items.emplace_back(std::move(item));
}
m_Columns =
{
{ 0, L"Name", 200 },
{ 1, L"Id", 100 },
{ 2, L"Priority", 50 },
{ 3, L"Template", 250 }
};
m_listCtrlItems = new ItemsList(m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_EDIT_LABELS | wxLC_HRULES | wxLC_REPORT | wxLC_VIRTUAL | wxLC_VRULES);
for (auto& column : m_Columns)
{
m_listCtrlItems->InsertColumn(column.nIndex, column.szHeading, wxLIST_FORMAT_LEFT, column.nWidth);
}
m_listCtrlItems->GetText = [&](int nItem, int nColumn) -> std::wstring
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: return L"TEST0";
case 1: return L"TEST1";
case 2: return L"TEST2";
case 3: return L"TEST3";
}
return L"??";
};
m_listCtrlItems->SetText = [&](int nItem, int nColumn, const wchar_t* value)->void
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: break;
case 1: break;
case 2: break;
case 3: break;
}
};
m_listCtrlItems->SetItemCount(m_Items.size());
bSizerList->Insert(0, m_listCtrlItems, 1, wxALL | wxEXPAND, 2);
m_listCtrlItems->SetFocus();
}
void UIFormatsDialog::FormatsDialogOnInitDialog(wxInitDialogEvent& event)
{
// TODO: Implement FormatsDialogOnInitDialog
}
void UIFormatsDialog::m_buttonDuplicateOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDuplicateOnButtonClick
}
void UIFormatsDialog::m_buttonMoveUpOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveUpOnButtonClick
}
void UIFormatsDialog::m_buttonMoveDownOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveDownOnButtonClick
}
void UIFormatsDialog::m_buttonDeleteAllOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteAllOnButtonClick
}
void UIFormatsDialog::m_buttonDeleteOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteOnButtonClick
}
void UIFormatsDialog::m_buttonAddOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonAddOnButtonClick
}
void UIFormatsDialog::m_textCtrlPropertyNameOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyNameOnText
}
void UIFormatsDialog::m_textCtrlPropertyIdOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyIdOnText
}
void UIFormatsDialog::m_spinCtrlPropertyPriorityOnSpinCtrl(wxSpinEvent& event)
{
// TODO: Implement m_spinCtrlPropertyPriorityOnSpinCtrl
}
void UIFormatsDialog::m_spinCtrlPropertyPriorityOnSpinCtrlText(wxCommandEvent& event)
{
// TODO: Implement m_spinCtrlPropertyPriorityOnSpinCtrlText
}
void UIFormatsDialog::m_textCtrlPropertyInputExtensionsOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyInputExtensionsOnText
}
void UIFormatsDialog::m_textCtrlPropertyOutputExtensionOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyOutputExtensionOnText
}
void UIFormatsDialog::m_radioBtnTypeEncoderOnRadioButton(wxCommandEvent& event)
{
// TODO: Implement m_radioBtnTypeEncoderOnRadioButton
}
void UIFormatsDialog::m_radioBtnTypeDecoderOnRadioButton(wxCommandEvent& event)
{
// TODO: Implement m_radioBtnTypeDecoderOnRadioButton
}
void UIFormatsDialog::m_textCtrlPropertyExitCodeSuccessOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyExitCodeSuccessOnText
}
void UIFormatsDialog::m_comboBoxDefaultPresetOnCombobox(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxDefaultPresetOnCombobox
}
void UIFormatsDialog::m_comboBoxDefaultPresetOnText(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxDefaultPresetOnText
}
void UIFormatsDialog::m_buttonPropertyDefaultPresetEditOnButtonClick(wxCommandEvent& event)
{
UIPresetsDialog dlg(this);
dlg.ShowModal();
}
void UIFormatsDialog::m_checkBoxPropertyPipeInputOnCheckBox(wxCommandEvent& event)
{
// TODO: Implement m_checkBoxPropertyPipeInputOnCheckBox
}
void UIFormatsDialog::m_checkBoxPropertyPipeOutputOnCheckBox(wxCommandEvent& event)
{
// TODO: Implement m_checkBoxPropertyPipeOutputOnCheckBox
}
void UIFormatsDialog::m_textCtrlPropertyFunctionOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyFunctionOnText
}
void UIFormatsDialog::m_buttonPropertyFunctionBrowseOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Function script"),
wxEmptyString, wxEmptyString,
_("Lua Files (*.lua)|*.lua|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIFormatsDialog::m_textCtrlPropertyTemplateOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyTemplateOnText
}
void UIFormatsDialog::m_textCtrlPropertyPathOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyPathOnText
}
void UIFormatsDialog::m_buttonPropertyPathBrowseOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Executable path"),
wxEmptyString, wxEmptyString,
_("Exe Files (*.exe)|*.exe|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIFormatsDialog::m_buttonImportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Import formats"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPaths();
}
}
void UIFormatsDialog::m_buttonExportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Export formats"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIFormatsDialog::m_buttonOKOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_OK);
this->Close();
}
void UIFormatsDialog::m_buttonCancelOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_CANCEL);
this->Close();
}

67
src/ui/UIFormatsDialog.h Normal file
Просмотреть файл

@ -0,0 +1,67 @@
#ifndef __UIFormatsDialog__
#define __UIFormatsDialog__
/**
@file
Subclass of FormatsDialog, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include "UIPresetsDialog.h"
#include "ItemsList.h"
class CFormat
{
};
/** Implementing FormatsDialog */
class UIFormatsDialog : public FormatsDialog
{
protected:
// Handlers for FormatsDialog events.
void FormatsDialogOnInitDialog(wxInitDialogEvent& event);
void m_buttonDuplicateOnButtonClick(wxCommandEvent& event);
void m_buttonMoveUpOnButtonClick(wxCommandEvent& event);
void m_buttonMoveDownOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteAllOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteOnButtonClick(wxCommandEvent& event);
void m_buttonAddOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyNameOnText(wxCommandEvent& event);
void m_textCtrlPropertyIdOnText(wxCommandEvent& event);
void m_spinCtrlPropertyPriorityOnSpinCtrl(wxSpinEvent& event);
void m_spinCtrlPropertyPriorityOnSpinCtrlText(wxCommandEvent& event);
void m_textCtrlPropertyInputExtensionsOnText(wxCommandEvent& event);
void m_textCtrlPropertyOutputExtensionOnText(wxCommandEvent& event);
void m_radioBtnTypeEncoderOnRadioButton(wxCommandEvent& event);
void m_radioBtnTypeDecoderOnRadioButton(wxCommandEvent& event);
void m_textCtrlPropertyExitCodeSuccessOnText(wxCommandEvent& event);
void m_comboBoxDefaultPresetOnCombobox(wxCommandEvent& event);
void m_comboBoxDefaultPresetOnText(wxCommandEvent& event);
void m_buttonPropertyDefaultPresetEditOnButtonClick(wxCommandEvent& event);
void m_checkBoxPropertyPipeInputOnCheckBox(wxCommandEvent& event);
void m_checkBoxPropertyPipeOutputOnCheckBox(wxCommandEvent& event);
void m_textCtrlPropertyFunctionOnText(wxCommandEvent& event);
void m_buttonPropertyFunctionBrowseOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyTemplateOnText(wxCommandEvent& event);
void m_textCtrlPropertyPathOnText(wxCommandEvent& event);
void m_buttonPropertyPathBrowseOnButtonClick(wxCommandEvent& event);
void m_buttonImportOnButtonClick(wxCommandEvent& event);
void m_buttonExportOnButtonClick(wxCommandEvent& event);
void m_buttonOKOnButtonClick(wxCommandEvent& event);
void m_buttonCancelOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIFormatsDialog(wxWindow* parent);
//// end generated class members
protected:
std::vector<CFormat> m_Items;
std::vector<ItemColumn> m_Columns;
ItemsList* m_listCtrlItems;
};
#endif // __UIFormatsDialog__

386
src/ui/UIMainFrame.cpp Normal file
Просмотреть файл

@ -0,0 +1,386 @@
#include <wx/wxprec.h>
#include "UIMainFrame.h"
UIMainFrame::UIMainFrame(wxWindow* parent)
:
MainFrame(parent)
{
for (int i = 0; i < 100; i++)
{
CItem item;
item.nId = i;
item.szName = L"Name" + std::to_wstring(item.nId);
m_Items.emplace_back(std::move(item));
}
m_Columns =
{
{ 0, L"Name", 200 },
{ 1, L"Input", 50 },
{ 2, L"Size (bytes)", 80 },
{ 3, L"Output", 70 },
{ 4, L"Preset#", 55 },
{ 5, L"Options", 65 },
{ 6, L"Time", 90 },
{ 7, L"Status", 80 },
};
m_listCtrlItems = new ItemsList(m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_EDIT_LABELS | wxLC_HRULES | wxLC_REPORT | wxLC_VIRTUAL | wxLC_VRULES);
for (auto& column : m_Columns)
{
m_listCtrlItems->InsertColumn(column.nIndex, column.szHeading, wxLIST_FORMAT_LEFT, column.nWidth);
}
m_listCtrlItems->GetText = [&](int nItem, int nColumn) -> std::wstring
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: return std::to_wstring(item.nId);
case 1: return item.szName;
case 2: return L"TEST2";
case 3: return L"TEST3";
case 4: return L"TEST4";
case 5: return L"TEST5";
case 6: return L"TEST6";
case 7: return L"TEST7";
}
return L"??";
};
m_listCtrlItems->SetText = [&](int nItem, int nColumn, const wchar_t* value)->void
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: item.nId = std::stoi(value); break;
case 1: item.szName = value; break;
case 2: break;
case 3: break;
case 4: break;
case 5: break;
case 6: break;
case 7: break;
}
};
m_listCtrlItems->SetItemCount(m_Items.size());
bSizerList->Add(m_listCtrlItems, 1, wxLEFT | wxRIGHT | wxEXPAND, 2);
m_panelProgress->Hide();
m_panelBottom->Show();
m_listCtrlItems->SetFocus();
}
void UIMainFrame::m_menuItemFileLoadListOnMenuSelection(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Open list"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIMainFrame::m_menuItemFileSaveListOnMenuSelection(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Save list"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIMainFrame::m_menuItemFileClearListOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemFileClearListOnMenuSelection
}
void UIMainFrame::m_menuItemFileExitOnMenuSelection(wxCommandEvent& event)
{
this->Close();
}
void UIMainFrame::m_menuItemEditAddFileOnMenuSelection(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Add files"),
wxEmptyString, wxEmptyString,
_("All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPaths();
}
}
void UIMainFrame::m_menuItemEditAddDirOnMenuSelection(wxCommandEvent& event)
{
wxDirDialog *dlg = new wxDirDialog(
this,
_("Add directory"),
wxEmptyString,
wxDD_DEFAULT_STYLE, wxDefaultPosition, wxDefaultSize,
_("Browse"));
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath()
}
}
void UIMainFrame::m_menuItemEditRenameOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditRenameOnMenuSelection
}
void UIMainFrame::m_menuItemEditEditPathsOnMenuSelection(wxCommandEvent& event)
{
UIPathsDialog dlg(this);
dlg.ShowModal();
}
void UIMainFrame::m_menuItemEditResetTimeOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditResetTimeOnMenuSelection
}
void UIMainFrame::m_menuItemEditResetOutputOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditResetOutputOnMenuSelection
}
void UIMainFrame::m_menuItemEditRemoveOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditRemoveOnMenuSelection
}
void UIMainFrame::m_menuItemEditCropOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditCropOnMenuSelection
}
void UIMainFrame::m_menuItemEditRemoveCheckedOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditRemoveCheckedOnMenuSelection
}
void UIMainFrame::m_menuItemEditRemoveUncheckedOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditRemoveUncheckedOnMenuSelection
}
void UIMainFrame::m_menuItemEditCheckSelectedOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditCheckSelectedOnMenuSelection
}
void UIMainFrame::m_menuItemEditUncheckSelectedOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditUncheckSelectedOnMenuSelection
}
void UIMainFrame::m_menuItemEditSelectAllOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditSelectAllOnMenuSelection
}
void UIMainFrame::m_menuItemEditSelectNoneOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditSelectNoneOnMenuSelection
}
void UIMainFrame::m_menuItemEditInvertSelectionOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditInvertSelectionOnMenuSelection
}
void UIMainFrame::m_menuItemEditOpenFileOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditOpenFileOnMenuSelection
}
void UIMainFrame::m_menuItemEditOpenDirOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemEditOpenDirOnMenuSelection
}
void UIMainFrame::m_menuItemActionConvertOnMenuSelection(wxCommandEvent& event)
{
m_panelBottom->Hide();
m_panelProgress->Show();
this->GetSizer()->Layout();
}
void UIMainFrame::m_menuItemOptionsConfigurePresetsOnMenuSelection(wxCommandEvent& event)
{
UIPresetsDialog dlg(this);
dlg.ShowModal();
}
void UIMainFrame::m_menuItemOptionsConfigureFormatsOnMenuSelection(wxCommandEvent& event)
{
UIFormatsDialog dlg(this);
dlg.ShowModal();
}
void UIMainFrame::m_menuItemOptionsConfigureToolsOnMenuSelection(wxCommandEvent& event)
{
UIToolsDialog dlg(this);
dlg.ShowModal();
}
void UIMainFrame::m_menuItemOptionsDeleteSourceOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsDeleteSourceOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsShutownFinishedOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsShutownFinishedOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsDoNotSaveOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsDoNotSaveOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsDeleteOnErrorOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsDeleteOnErrorOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsStopOnErrorOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsStopOnErrorOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsHideConsoleOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsHideConsoleOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsEnsureVisibleOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsEnsureVisibleOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsFindDecoderOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsFindDecoderOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsValidateFilesOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsValidateFilesOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsOverwriteFilesOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsOverwriteFilesOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsRenameFilesOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsRenameFilesOnMenuSelection
}
void UIMainFrame::m_menuItemOptionsDownloadToolsOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemOptionsDownloadToolsOnMenuSelection
}
void UIMainFrame::m_menuItemLanguageDefaultOnMenuSelection(wxCommandEvent& event)
{
// TODO: Implement m_menuItemLanguageDefaultOnMenuSelection
}
void UIMainFrame::m_menuItemHelpWebsiteOnMenuSelection(wxCommandEvent& event)
{
wxLaunchDefaultBrowser(L"https://github.com/wieslawsoltes/BatchEncoder");
}
void UIMainFrame::m_menuItemHelpAboutOnMenuSelection(wxCommandEvent& event)
{
UIAboutDialog dlg(this);
dlg.ShowModal();
}
void UIMainFrame::m_comboBoxFormatsOnCombobox(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxFormatsOnCombobox
}
void UIMainFrame::m_comboBoxFormatsOnText(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxFormatsOnText
}
void UIMainFrame::m_comboPresetsOnCombobox(wxCommandEvent& event)
{
// TODO: Implement m_comboPresetsOnCombobox
}
void UIMainFrame::m_comboPresetsOnText(wxCommandEvent& event)
{
// TODO: Implement m_comboPresetsOnText
}
void UIMainFrame::m_buttonStopOnButtonClick(wxCommandEvent& event)
{
m_panelProgress->Hide();
m_panelBottom->Show();
this->GetSizer()->Layout();
}
void UIMainFrame::m_comboBoxOutputOnCombobox(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxOutputOnCombobox
}
void UIMainFrame::m_comboBoxOutputOnText(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxOutputOnText
}
void UIMainFrame::m_buttonBrowseOnButtonClick(wxCommandEvent& event)
{
wxDirDialog *dlg = new wxDirDialog(
this,
_("Output path"),
wxEmptyString,
wxDD_DEFAULT_STYLE, wxDefaultPosition, wxDefaultSize,
_("Browse"));
if (dlg->ShowModal() == wxID_OK)
{
m_comboBoxOutput->SetLabelText(dlg->GetPath());
}
}
void UIMainFrame::m_spinCtrlThreadsOnSpinCtrl(wxSpinEvent& event)
{
// TODO: Implement m_spinCtrlThreadsOnSpinCtrl
}
void UIMainFrame::m_spinCtrlThreadsOnSpinCtrlText(wxCommandEvent& event)
{
// TODO: Implement m_spinCtrlThreadsOnSpinCtrlText
}
void UIMainFrame::m_buttonConvertOnButtonClick(wxCommandEvent& event)
{
m_panelBottom->Hide();
m_panelProgress->Show();
this->GetSizer()->Layout();
}

95
src/ui/UIMainFrame.h Normal file
Просмотреть файл

@ -0,0 +1,95 @@
#ifndef __UIMainFrame__
#define __UIMainFrame__
/**
@file
Subclass of MainFrame, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include "UIPresetsDialog.h"
#include "UIFormatsDialog.h"
#include "UIToolsDialog.h"
#include "UIPathsDialog.h"
#include "UIAboutDialog.h"
#include "ItemsList.h"
class CItem
{
public:
int nId;
std::wstring szName;
};
/** Implementing MainFrame */
class UIMainFrame : public MainFrame
{
protected:
// Handlers for MainFrame events.
void m_menuItemFileLoadListOnMenuSelection(wxCommandEvent& event);
void m_menuItemFileSaveListOnMenuSelection(wxCommandEvent& event);
void m_menuItemFileClearListOnMenuSelection(wxCommandEvent& event);
void m_menuItemFileExitOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditAddFileOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditAddDirOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditRenameOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditEditPathsOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditResetTimeOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditResetOutputOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditRemoveOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditCropOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditRemoveCheckedOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditRemoveUncheckedOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditCheckSelectedOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditUncheckSelectedOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditSelectAllOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditSelectNoneOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditInvertSelectionOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditOpenFileOnMenuSelection(wxCommandEvent& event);
void m_menuItemEditOpenDirOnMenuSelection(wxCommandEvent& event);
void m_menuItemActionConvertOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsConfigurePresetsOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsConfigureFormatsOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsConfigureToolsOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsDeleteSourceOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsShutownFinishedOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsDoNotSaveOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsDeleteOnErrorOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsStopOnErrorOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsHideConsoleOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsEnsureVisibleOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsFindDecoderOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsValidateFilesOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsOverwriteFilesOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsRenameFilesOnMenuSelection(wxCommandEvent& event);
void m_menuItemOptionsDownloadToolsOnMenuSelection(wxCommandEvent& event);
void m_menuItemLanguageDefaultOnMenuSelection(wxCommandEvent& event);
void m_menuItemHelpWebsiteOnMenuSelection(wxCommandEvent& event);
void m_menuItemHelpAboutOnMenuSelection(wxCommandEvent& event);
void m_comboBoxFormatsOnCombobox(wxCommandEvent& event);
void m_comboBoxFormatsOnText(wxCommandEvent& event);
void m_comboPresetsOnCombobox(wxCommandEvent& event);
void m_comboPresetsOnText(wxCommandEvent& event);
void m_buttonStopOnButtonClick(wxCommandEvent& event);
void m_comboBoxOutputOnCombobox(wxCommandEvent& event);
void m_comboBoxOutputOnText(wxCommandEvent& event);
void m_buttonBrowseOnButtonClick(wxCommandEvent& event);
void m_spinCtrlThreadsOnSpinCtrl(wxSpinEvent& event);
void m_spinCtrlThreadsOnSpinCtrlText(wxCommandEvent& event);
void m_buttonConvertOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIMainFrame(wxWindow* parent);
//// end generated class members
protected:
std::vector<CItem> m_Items;
std::vector<ItemColumn> m_Columns;
ItemsList* m_listCtrlItems;
};
#endif // __UIMainFrame__

142
src/ui/UIPathsDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,142 @@
#include <wx/wxprec.h>
#include "UIPathsDialog.h"
UIPathsDialog::UIPathsDialog(wxWindow* parent)
:
PathsDialog(parent)
{
for (int i = 0; i < 100; i++)
{
CPath item;
m_Items.emplace_back(std::move(item));
}
m_Columns =
{
{ 0, L"Name", 450 },
{ 1, L"Size (bytes)", 150 }
};
m_listCtrlItems = new ItemsList(m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_EDIT_LABELS | wxLC_HRULES | wxLC_REPORT | wxLC_VIRTUAL | wxLC_VRULES);
for (auto& column : m_Columns)
{
m_listCtrlItems->InsertColumn(column.nIndex, column.szHeading, wxLIST_FORMAT_LEFT, column.nWidth);
}
m_listCtrlItems->GetText = [&](int nItem, int nColumn) -> std::wstring
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: return L"TEST0";
case 1: return L"TEST1";
}
return L"??";
};
m_listCtrlItems->SetText = [&](int nItem, int nColumn, const wchar_t* value)->void
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: break;
case 1: break;
}
};
m_listCtrlItems->SetItemCount(m_Items.size());
bSizerList->Insert(0, m_listCtrlItems, 1, wxALL | wxEXPAND, 2);
m_listCtrlItems->SetFocus();
}
void UIPathsDialog::PathsDialogOnInitDialog(wxInitDialogEvent& event)
{
// TODO: Implement PathsDialogOnInitDialog
}
void UIPathsDialog::m_buttonDuplicateOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDuplicateOnButtonClick
}
void UIPathsDialog::m_buttonMoveUpOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveUpOnButtonClick
}
void UIPathsDialog::m_buttonMoveDownOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveDownOnButtonClick
}
void UIPathsDialog::m_buttonDeleteAllOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteAllOnButtonClick
}
void UIPathsDialog::m_buttonDeleteOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteOnButtonClick
}
void UIPathsDialog::m_buttonAddOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonAddOnButtonClick
}
void UIPathsDialog::m_textCtrlPropertyPathOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyPathOnText
}
void UIPathsDialog::m_textCtrlPropertySizeOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertySizeOnText
}
void UIPathsDialog::m_buttonPropertySizeBrowseOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonPropertySizeBrowseOnButtonClick
}
void UIPathsDialog::m_buttonImportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Import paths"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPaths();
}
}
void UIPathsDialog::m_buttonExportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Export paths"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIPathsDialog::m_buttonOKOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_OK);
this->Close();
}
void UIPathsDialog::m_buttonCancelOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_CANCEL);
this->Close();
}

50
src/ui/UIPathsDialog.h Normal file
Просмотреть файл

@ -0,0 +1,50 @@
#ifndef __UIPathsDialog__
#define __UIPathsDialog__
/**
@file
Subclass of PathsDialog, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include "ItemsList.h"
class CPath
{
};
/** Implementing PathsDialog */
class UIPathsDialog : public PathsDialog
{
protected:
// Handlers for PathsDialog events.
void PathsDialogOnInitDialog(wxInitDialogEvent& event);
void m_buttonDuplicateOnButtonClick(wxCommandEvent& event);
void m_buttonMoveUpOnButtonClick(wxCommandEvent& event);
void m_buttonMoveDownOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteAllOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteOnButtonClick(wxCommandEvent& event);
void m_buttonAddOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyPathOnText(wxCommandEvent& event);
void m_textCtrlPropertySizeOnText(wxCommandEvent& event);
void m_buttonPropertySizeBrowseOnButtonClick(wxCommandEvent& event);
void m_buttonImportOnButtonClick(wxCommandEvent& event);
void m_buttonExportOnButtonClick(wxCommandEvent& event);
void m_buttonOKOnButtonClick(wxCommandEvent& event);
void m_buttonCancelOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIPathsDialog(wxWindow* parent);
//// end generated class members
protected:
std::vector<CPath> m_Items;
std::vector<ItemColumn> m_Columns;
ItemsList* m_listCtrlItems;
};
#endif // __UIPathsDialog__

147
src/ui/UIPresetsDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,147 @@
#include <wx/wxprec.h>
#include "UIPresetsDialog.h"
UIPresetsDialog::UIPresetsDialog(wxWindow* parent)
:
PresetsDialog(parent)
{
for (int i = 0; i < 100; i++)
{
CPreset item;
m_Items.emplace_back(std::move(item));
}
m_Columns =
{
{ 0, L"Name", 200 },
{ 1, L"Options", 400 }
};
m_listCtrlItems = new ItemsList(m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_EDIT_LABELS | wxLC_HRULES | wxLC_REPORT | wxLC_VIRTUAL | wxLC_VRULES);
for (auto& column : m_Columns)
{
m_listCtrlItems->InsertColumn(column.nIndex, column.szHeading, wxLIST_FORMAT_LEFT, column.nWidth);
}
m_listCtrlItems->GetText = [&](int nItem, int nColumn) -> std::wstring
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: return L"TEST0";
case 1: return L"TEST1";
}
return L"??";
};
m_listCtrlItems->SetText = [&](int nItem, int nColumn, const wchar_t* value)->void
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: break;
case 1: break;
}
};
m_listCtrlItems->SetItemCount(m_Items.size());
bSizerList->Insert(0, m_listCtrlItems, 1, wxALL | wxEXPAND, 2);
m_listCtrlItems->SetFocus();
}
void UIPresetsDialog::PresetsDialogOnInitDialog(wxInitDialogEvent& event)
{
// TODO: Implement PresetsDialogOnInitDialog
}
void UIPresetsDialog::m_comboBoxFormatsOnCombobox(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxFormatsOnCombobox
}
void UIPresetsDialog::m_comboBoxFormatsOnText(wxCommandEvent& event)
{
// TODO: Implement m_comboBoxFormatsOnText
}
void UIPresetsDialog::m_buttonDuplicateOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDuplicateOnButtonClick
}
void UIPresetsDialog::m_buttonMoveUpOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveUpOnButtonClick
}
void UIPresetsDialog::m_buttonMoveDownOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveDownOnButtonClick
}
void UIPresetsDialog::m_buttonDeleteAllOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteAllOnButtonClick
}
void UIPresetsDialog::m_buttonDeleteOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteOnButtonClick
}
void UIPresetsDialog::m_buttonAddOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonAddOnButtonClick
}
void UIPresetsDialog::m_textCtrlPropertyNameOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyNameOnText
}
void UIPresetsDialog::m_textCtrlPropertyOptionsOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyOptionsOnText
}
void UIPresetsDialog::m_buttonImportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Import presets"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPaths();
}
}
void UIPresetsDialog::m_buttonExportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Export presets"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIPresetsDialog::m_buttonOKOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_OK);
this->Close();
}
void UIPresetsDialog::m_buttonCancelOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_CANCEL);
this->Close();
}

51
src/ui/UIPresetsDialog.h Normal file
Просмотреть файл

@ -0,0 +1,51 @@
#ifndef __UIPresetsDialog__
#define __UIPresetsDialog__
/**
@file
Subclass of PresetsDialog, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include "ItemsList.h"
class CPreset
{
};
/** Implementing PresetsDialog */
class UIPresetsDialog : public PresetsDialog
{
protected:
// Handlers for PresetsDialog events.
void PresetsDialogOnInitDialog(wxInitDialogEvent& event);
void m_comboBoxFormatsOnCombobox(wxCommandEvent& event);
void m_comboBoxFormatsOnText(wxCommandEvent& event);
void m_buttonDuplicateOnButtonClick(wxCommandEvent& event);
void m_buttonMoveUpOnButtonClick(wxCommandEvent& event);
void m_buttonMoveDownOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteAllOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteOnButtonClick(wxCommandEvent& event);
void m_buttonAddOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyNameOnText(wxCommandEvent& event);
void m_textCtrlPropertyOptionsOnText(wxCommandEvent& event);
void m_buttonImportOnButtonClick(wxCommandEvent& event);
void m_buttonExportOnButtonClick(wxCommandEvent& event);
void m_buttonOKOnButtonClick(wxCommandEvent& event);
void m_buttonCancelOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIPresetsDialog(wxWindow* parent);
//// end generated class members
protected:
std::vector<CPreset> m_Items;
std::vector<ItemColumn> m_Columns;
ItemsList* m_listCtrlItems;
};
#endif // __UIPresetsDialog__

204
src/ui/UIToolsDialog.cpp Normal file
Просмотреть файл

@ -0,0 +1,204 @@
#include <wx/wxprec.h>
#include "UIToolsDialog.h"
UIToolsDialog::UIToolsDialog(wxWindow* parent)
:
ToolsDialog(parent)
{
for (int i = 0; i < 100; i++)
{
CTool item;
m_Items.emplace_back(std::move(item));
}
m_Columns =
{
{ 0, L"Name", 200 },
{ 1, L"Priority", 50 },
{ 2, L"Url", 200 },
{ 3, L"Status", 150 }
};
m_listCtrlItems = new ItemsList(m_panelList, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_EDIT_LABELS | wxLC_HRULES | wxLC_REPORT | wxLC_VIRTUAL | wxLC_VRULES);
for (auto& column : m_Columns)
{
m_listCtrlItems->InsertColumn(column.nIndex, column.szHeading, wxLIST_FORMAT_LEFT, column.nWidth);
}
m_listCtrlItems->GetText = [&](int nItem, int nColumn) -> std::wstring
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: return L"TEST0";
case 1: return L"TEST1";
case 2: return L"TEST2";
case 3: return L"TEST3";
}
return L"??";
};
m_listCtrlItems->SetText = [&](int nItem, int nColumn, const wchar_t* value)->void
{
auto& item = m_Items[nItem];
switch (nColumn)
{
case 0: break;
case 1: break;
case 2: break;
case 3: break;
}
};
m_listCtrlItems->SetItemCount(m_Items.size());
bSizerList->Insert(0, m_listCtrlItems, 1, wxALL | wxEXPAND, 2);
m_listCtrlItems->SetFocus();
}
void UIToolsDialog::ToolsDialogOnInitDialog(wxInitDialogEvent& event)
{
// TODO: Implement ToolsDialogOnInitDialog
}
void UIToolsDialog::m_buttonDownloadSelectedOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDownloadSelectedOnButtonClick
}
void UIToolsDialog::m_buttonSetSelectedPathsOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonSetSelectedPathsOnButtonClick
}
void UIToolsDialog::m_buttonSetX86PathsOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonSetX86PathsOnButtonClick
}
void UIToolsDialog::m_buttonSetX64PathsOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonSetX64PathsOnButtonClick
}
void UIToolsDialog::m_buttonDuplicateOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDuplicateOnButtonClick
}
void UIToolsDialog::m_buttonMoveUpOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveUpOnButtonClick
}
void UIToolsDialog::m_buttonMoveDownOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonMoveDownOnButtonClick
}
void UIToolsDialog::m_buttonDeleteAllOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteAllOnButtonClick
}
void UIToolsDialog::m_buttonDeleteOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonDeleteOnButtonClick
}
void UIToolsDialog::m_buttonAddOnButtonClick(wxCommandEvent& event)
{
// TODO: Implement m_buttonAddOnButtonClick
}
void UIToolsDialog::m_textCtrlPropertyNameOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyNameOnText
}
void UIToolsDialog::m_textCtrlPropertyPlatformOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyPlatformOnText
}
void UIToolsDialog::m_spinCtrlPropertyPriorityOnSpinCtrl(wxSpinEvent& event)
{
// TODO: Implement m_spinCtrlPropertyPriorityOnSpinCtrl
}
void UIToolsDialog::m_spinCtrlPropertyPriorityOnSpinCtrlText(wxCommandEvent& event)
{
// TODO: Implement m_spinCtrlPropertyPriorityOnSpinCtrlText
}
void UIToolsDialog::m_textCtrlPropertyFormatsOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyFormatsOnText
}
void UIToolsDialog::m_buttonPropertyFormatsEditOnButtonClick(wxCommandEvent& event)
{
UIFormatsDialog dlg(this);
dlg.ShowModal();
}
void UIToolsDialog::m_textCtrlPropertyUrlOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyUrlOnText
}
void UIToolsDialog::m_textCtrlPropertyFileOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyFileOnText
}
void UIToolsDialog::m_textCtrlPropertyExtractOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyExtractOnText
}
void UIToolsDialog::m_textCtrlPropertyPathOnText(wxCommandEvent& event)
{
// TODO: Implement m_textCtrlPropertyPathOnText
}
void UIToolsDialog::m_buttonImportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Import tools"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPaths();
}
}
void UIToolsDialog::m_buttonExportOnButtonClick(wxCommandEvent& event)
{
wxFileDialog *dlg = new wxFileDialog(
this,
_("Export tools"),
wxEmptyString, wxEmptyString,
_("Xml Files (*.xml)|*.xml|All Files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, wxDefaultPosition);
if (dlg->ShowModal() == wxID_OK)
{
// dlg->GetPath();
}
}
void UIToolsDialog::m_buttonOKOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_OK);
this->Close();
}
void UIToolsDialog::m_buttonCancelOnButtonClick(wxCommandEvent& event)
{
this->SetReturnCode(wxID_CANCEL);
this->Close();
}

62
src/ui/UIToolsDialog.h Normal file
Просмотреть файл

@ -0,0 +1,62 @@
#ifndef __UIToolsDialog__
#define __UIToolsDialog__
/**
@file
Subclass of ToolsDialog, which is generated by wxFormBuilder.
*/
#include "MainFrame.h"
//// end generated include
#include <wx/filedlg.h>
#include <wx/dirdlg.h>
#include "UIFormatsDialog.h"
#include "ItemsList.h"
class CTool
{
};
/** Implementing ToolsDialog */
class UIToolsDialog : public ToolsDialog
{
protected:
// Handlers for ToolsDialog events.
void ToolsDialogOnInitDialog(wxInitDialogEvent& event);
void m_buttonDownloadSelectedOnButtonClick(wxCommandEvent& event);
void m_buttonSetSelectedPathsOnButtonClick(wxCommandEvent& event);
void m_buttonSetX86PathsOnButtonClick(wxCommandEvent& event);
void m_buttonSetX64PathsOnButtonClick(wxCommandEvent& event);
void m_buttonDuplicateOnButtonClick(wxCommandEvent& event);
void m_buttonMoveUpOnButtonClick(wxCommandEvent& event);
void m_buttonMoveDownOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteAllOnButtonClick(wxCommandEvent& event);
void m_buttonDeleteOnButtonClick(wxCommandEvent& event);
void m_buttonAddOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyNameOnText(wxCommandEvent& event);
void m_textCtrlPropertyPlatformOnText(wxCommandEvent& event);
void m_spinCtrlPropertyPriorityOnSpinCtrl(wxSpinEvent& event);
void m_spinCtrlPropertyPriorityOnSpinCtrlText(wxCommandEvent& event);
void m_textCtrlPropertyFormatsOnText(wxCommandEvent& event);
void m_buttonPropertyFormatsEditOnButtonClick(wxCommandEvent& event);
void m_textCtrlPropertyUrlOnText(wxCommandEvent& event);
void m_textCtrlPropertyFileOnText(wxCommandEvent& event);
void m_textCtrlPropertyExtractOnText(wxCommandEvent& event);
void m_textCtrlPropertyPathOnText(wxCommandEvent& event);
void m_buttonImportOnButtonClick(wxCommandEvent& event);
void m_buttonExportOnButtonClick(wxCommandEvent& event);
void m_buttonOKOnButtonClick(wxCommandEvent& event);
void m_buttonCancelOnButtonClick(wxCommandEvent& event);
public:
/** Constructor */
UIToolsDialog(wxWindow* parent);
//// end generated class members
protected:
std::vector<CTool> m_Items;
std::vector<ItemColumn> m_Columns;
ItemsList* m_listCtrlItems;
};
#endif // __UIToolsDialog__

1
wx Submodule

@ -0,0 +1 @@
Subproject commit 379a404f9804ac044df44f18907e192917fec8aa