From 5d353d4dec61eddb051a3a76551c49a231dc220b Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 15 May 2013 17:32:21 -0600 Subject: [PATCH] Introjucer: Character type setting for MSVC export --- .../Project Saving/jucer_ProjectExport_MSVC.h | 22 ++++++++++++++++++- .../Source/Utility/jucer_PresetIDs.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h index 970730f616..9b38b07758 100644 --- a/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h +++ b/extras/Introjucer/Source/Project Saving/jucer_ProjectExport_MSVC.h @@ -144,6 +144,18 @@ protected: String getIntermediatesPath() const { return config [Ids::intermediatesPath].toString(); } Value getIntermediatesPathValue() { return getValue (Ids::intermediatesPath); } + String getCharacterSet() const + { + String charSet (config [Ids::characterSet].toString()); + + if (charSet.isEmpty()) + charSet = "MultiByte"; + + return charSet; + } + + Value getCharacterSetValue() { return getValue (Ids::characterSet); } + String getOutputFilename (const String& suffix, bool forceSuffix) const { const String target (File::createLegalFileName (getTargetBinaryNameString().trim())); @@ -190,6 +202,14 @@ protected: props.add (new TextPropertyComponent (getPrebuildCommand(), "Pre-build Command", 2048, false)); props.add (new TextPropertyComponent (getPostbuildCommand(), "Post-build Command", 2048, false)); props.add (new BooleanPropertyComponent (shouldGenerateManifestValue(), "Manifest", "Generate Manifest")); + + { + const char* const characterSetNames[] = { "Default", "MultiByte", "Unicode", nullptr }; + const var charSets[] = { var::null, "MultiByte", "Unicode", }; + + props.add (new ChoicePropertyComponent (getCharacterSetValue(), "Character Set", + StringArray (characterSetNames), Array (charSets, numElementsInArray (charSets)))); + } } }; @@ -1065,7 +1085,7 @@ protected: e->setAttribute ("Label", "Configuration"); e->createNewChildElement ("ConfigurationType")->addTextElement (getProjectType()); e->createNewChildElement ("UseOfMfc")->addTextElement ("false"); - e->createNewChildElement ("CharacterSet")->addTextElement ("MultiByte"); + e->createNewChildElement ("CharacterSet")->addTextElement (config.getCharacterSet()); if (! (config.isDebug() || config.shouldDisableWholeProgramOpt())) e->createNewChildElement ("WholeProgramOptimization")->addTextElement ("true"); diff --git a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h index 0bf270383d..80f867c52b 100644 --- a/extras/Introjucer/Source/Utility/jucer_PresetIDs.h +++ b/extras/Introjucer/Source/Utility/jucer_PresetIDs.h @@ -135,6 +135,7 @@ namespace Ids DECLARE_ID (colour); DECLARE_ID (userNotes); DECLARE_ID (maxBinaryFileSize); + DECLARE_ID (characterSet); const Identifier ID ("id"); const Identifier class_ ("class");