[commit] r1242 - in trunk: GME GME/Annotator GME/MgaDecorators Paradigms/MetaGME Paradigms/MetaGME/MetaDecorator SDK/DecoratorLib
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Fri Apr 1 10:08:25 CDT 2011
Author: ksmyth
Date: Fri Apr 1 10:08:25 2011
New Revision: 1242
Log:
More UNICODE
Modified:
trunk/GME/Annotator/AnnotationDefs.h
trunk/GME/Annotator/Annotator.vcxproj
trunk/GME/GMEDecorators.sln
trunk/GME/MgaDecorators/BoxDecorator.cpp
trunk/GME/MgaDecorators/MgaDecorators.vcxproj
trunk/Paradigms/MetaGME/MetaDecorator/DecoratorStd.h
trunk/Paradigms/MetaGME/MetaDecorator/MetaClassPart.cpp
trunk/Paradigms/MetaGME/MetaDecorator/MetaCompositePart.cpp
trunk/Paradigms/MetaGME/MetaDecorator/MetaDecorator.vcxproj
trunk/Paradigms/MetaGME/MetaGME.sln
trunk/SDK/DecoratorLib/BitmapUtil.cpp
trunk/SDK/DecoratorLib/DecoratorDefs.cpp
trunk/SDK/DecoratorLib/DecoratorDefs.h
trunk/SDK/DecoratorLib/DecoratorLib.vcxproj
trunk/SDK/DecoratorLib/DecoratorMfc.cpp
trunk/SDK/DecoratorLib/DecoratorMfc.h
trunk/SDK/DecoratorLib/DecoratorUtil.cpp
trunk/SDK/DecoratorLib/DecoratorUtil.h
trunk/SDK/DecoratorLib/DialogTemplate.cpp
trunk/SDK/DecoratorLib/DialogTemplate.h
trunk/SDK/DecoratorLib/InPlaceEditDialog.cpp
trunk/SDK/DecoratorLib/ModelComplexPart.cpp
trunk/SDK/DecoratorLib/ModelSwitchPart.cpp
trunk/SDK/DecoratorLib/ResizablePart.cpp
trunk/SDK/DecoratorLib/SetSizeDialog.cpp
trunk/SDK/DecoratorLib/SizeTrackerDialog.cpp
trunk/SDK/DecoratorLib/Stdafx.h
trunk/SDK/DecoratorLib/TextPart.cpp
trunk/SDK/DecoratorLib/TypeableLabelPart.cpp
Modified: trunk/GME/Annotator/AnnotationDefs.h
==============================================================================
--- trunk/GME/Annotator/AnnotationDefs.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/GME/Annotator/AnnotationDefs.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -5,30 +5,30 @@
#define AN_DECORATOR_PROGID "MGA.Decorator.Annotator"
-#define AN_PARAM_ROOTNODE "rootnode"
+#define AN_PARAM_ROOTNODE _T("rootnode")
-#define AN_ROOT "annotations"
-#define AN_INHERITABLE "inheritable"
-#define AN_HIDDEN "hidden"
-#define AN_BROKEN_DERIV "brokenDeriv"
-#define AN_COLOR_PREF "color"
-#define AN_BGCOLOR_PREF "bgcolor"
-#define AN_GRADIENTCOLOR_PREF "gradientcolor"
-#define AN_SHADOWCOLOR_PREF "shadowcolor"
-#define AN_FONT_PREF "logfont"
-#define AN_ASPECTS "aspects"
-#define AN_DEFASPECT "*"
-#define AN_GRADIENTFILL_PREF "gradientfill"
-#define AN_GRADIENTDIRECTION_PREF "gradientdirection"
-#define AN_CASTSHADOW_PREF "castshadow"
-#define AN_SHADOWDEPTH_PREF "shadowdepth"
-#define AN_SHADOWDIRECTION_PREF "shadowdirection"
-#define AN_ROUNDCORNERRECT_PREF "roundrectcorner"
-#define AN_ROUNDCORNERRADIUS_PREF "roundrectcornerradius"
-
-#define AN_VISIBLE_DEFAULT "DefaultVisibility"
-#define AN_DEFANNOTATION_NAME "Annotation"
-#define AN_DEFAULTANNOTATION_TXT "Enter your annotation here"
+#define AN_ROOT _T("annotations")
+#define AN_INHERITABLE _T("inheritable")
+#define AN_HIDDEN _T("hidden")
+#define AN_BROKEN_DERIV _T("brokenDeriv")
+#define AN_COLOR_PREF _T("color")
+#define AN_BGCOLOR_PREF _T("bgcolor")
+#define AN_GRADIENTCOLOR_PREF _T("gradientcolor")
+#define AN_SHADOWCOLOR_PREF _T("shadowcolor")
+#define AN_FONT_PREF _T("logfont")
+#define AN_ASPECTS _T("aspects")
+#define AN_DEFASPECT _T("*")
+#define AN_GRADIENTFILL_PREF _T("gradientfill")
+#define AN_GRADIENTDIRECTION_PREF _T("gradientdirection")
+#define AN_CASTSHADOW_PREF _T("castshadow")
+#define AN_SHADOWDEPTH_PREF _T("shadowdepth")
+#define AN_SHADOWDIRECTION_PREF _T("shadowdirection")
+#define AN_ROUNDCORNERRECT_PREF _T("roundrectcorner")
+#define AN_ROUNDCORNERRADIUS_PREF _T("roundrectcornerradius")
+
+#define AN_VISIBLE_DEFAULT _T("DefaultVisibility")
+#define AN_DEFANNOTATION_NAME _T("Annotation")
+#define AN_DEFAULTANNOTATION_TXT _T("Enter your annotation here")
#define AN_DEFAULT_FONT_HEIGHT 12
#define AN_DEFAULT_FONT_FACE _T("Arial")
Modified: trunk/GME/Annotator/Annotator.vcxproj
==============================================================================
--- trunk/GME/Annotator/Annotator.vcxproj Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/GME/Annotator/Annotator.vcxproj Fri Apr 1 10:08:25 2011 (r1242)
@@ -23,13 +23,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -174,4 +174,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
Modified: trunk/GME/GMEDecorators.sln
==============================================================================
--- trunk/GME/GMEDecorators.sln Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/GME/GMEDecorators.sln Fri Apr 1 10:08:25 2011 (r1242)
@@ -1,10 +1,10 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-Project("{0FBD8771-734B-419E-B80C-1651AF4059FF}") = "Annotator", "Annotator\Annotator.vcxproj", "{835438ED-280C-4863-9C03-A62F3D504005}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Annotator", "Annotator\Annotator.vcxproj", "{835438ED-280C-4863-9C03-A62F3D504005}"
EndProject
-Project("{0FBD8771-734B-419E-B80C-1651AF4059FF}") = "MgaDecorators", "MgaDecorators\MgaDecorators.vcxproj", "{66D5FEC3-17C7-4B20-9A3A-07A1B585314F}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MgaDecorators", "MgaDecorators\MgaDecorators.vcxproj", "{66D5FEC3-17C7-4B20-9A3A-07A1B585314F}"
EndProject
-Project("{0FBD8771-734B-419E-B80C-1651AF4059FF}") = "DecoratorLib", "..\SDK\DecoratorLib\DecoratorLib.vcxproj", "{77FEBD41-CD6C-4D55-B561-3957F7151CC2}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DecoratorLib", "..\SDK\DecoratorLib\DecoratorLib.vcxproj", "{77FEBD41-CD6C-4D55-B561-3957F7151CC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,10 +20,10 @@
{66D5FEC3-17C7-4B20-9A3A-07A1B585314F}.Debug|Win32.Build.0 = Debug|Win32
{66D5FEC3-17C7-4B20-9A3A-07A1B585314F}.Release|Win32.ActiveCfg = Release|Win32
{66D5FEC3-17C7-4B20-9A3A-07A1B585314F}.Release|Win32.Build.0 = Release|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.ActiveCfg = Debug|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.Build.0 = Debug|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.ActiveCfg = Release|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.Build.0 = Release|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.ActiveCfg = DebugUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.Build.0 = DebugUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.ActiveCfg = ReleaseUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.Build.0 = ReleaseUnicode|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/GME/MgaDecorators/BoxDecorator.cpp
==============================================================================
--- trunk/GME/MgaDecorators/BoxDecorator.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/GME/MgaDecorators/BoxDecorator.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -241,7 +241,7 @@
is_dir = (fstatus.st_mode & _S_IFDIR) == _S_IFDIR;
CString conn(szFileName);
- if (!is_dir && conn.Right(4).CompareNoCase(".txt") == 0) {
+ if (!is_dir && conn.Right(4).CompareNoCase(_T(".txt")) == 0) {
CFile txtFile(conn, CFile::modeRead);
char pbufRead[100];
UINT readLen = txtFile.Read(pbufRead, sizeof(pbufRead) - 1);
@@ -252,7 +252,7 @@
AfxMessageBox("Decorator drop: '.txt' files may be dropped only. Can't open file: " + conn + "!");
}
} else {
- AfxMessageBox("Decorator drop: Can't inquire file information!");
+ AfxMessageBox(_T("Decorator drop: Can't inquire file information!"));
}
}
#endif
Modified: trunk/GME/MgaDecorators/MgaDecorators.vcxproj
==============================================================================
--- trunk/GME/MgaDecorators/MgaDecorators.vcxproj Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/GME/MgaDecorators/MgaDecorators.vcxproj Fri Apr 1 10:08:25 2011 (r1242)
@@ -23,13 +23,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -182,4 +182,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project>
\ No newline at end of file
Modified: trunk/Paradigms/MetaGME/MetaDecorator/DecoratorStd.h
==============================================================================
--- trunk/Paradigms/MetaGME/MetaDecorator/DecoratorStd.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/Paradigms/MetaGME/MetaDecorator/DecoratorStd.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -24,21 +24,21 @@
#define GME_MODEL_HEIGHT 70
//#define GME_3D_BORDER_SIZE 3
-#define HELP_PREF "help"
-#define COLOR_PREF "color"
-#define CONN_LINE_TYPE_PREF "lineType"
-#define MODEL_BACKGROUND_COLOR_PREF "backgroundColor"
-#define MODEL_BORDER_COLOR_PREF "borderColor"
-#define PORT_NAME_COLOR_PREF "portColor"
-#define NAME_COLOR_PREF "nameColor"
-#define NAME_POS_PREF "namePosition"
-#define ICON_PREF "icon"
-#define PORTICON_PREF "porticon"
+#define HELP_PREF _T("help")
+#define COLOR_PREF _T("color")
+#define CONN_LINE_TYPE_PREF _T("lineType")
+#define MODEL_BACKGROUND_COLOR_PREF _T("backgroundColor")
+#define MODEL_BORDER_COLOR_PREF _T("borderColor")
+#define PORT_NAME_COLOR_PREF _T("portColor")
+#define NAME_COLOR_PREF _T("nameColor")
+#define NAME_POS_PREF _T("namePosition")
+#define ICON_PREF _T("icon")
+#define PORTICON_PREF _T("porticon")
#define META_DEFAULT_SHOWABSTRACT true
#define META_DEFAULT_SHOWATTRIBUTES true
-#define META_ATTRIBUTE_SEP " : "
+#define META_ATTRIBUTE_SEP _T(" : ")
#define META_DECORATOR_MARGINX 6
#define META_DECORATOR_MARGINY 4
@@ -61,53 +61,53 @@
typedef enum {NULLSHAPE, CLASS, CLASSPROXY, CONNECTOR, CONSTRAINT, EQUIVALENCE, INHERITANCE, INTINHERITANCE, IMPINHERITANCE, CONSTRAINTFUNC } ShapeCode;
-#define META_ABSTRACT_ATTR "IsAbstract"
+#define META_ABSTRACT_ATTR _T("IsAbstract")
-#define META_ATOM_KIND "Atom"
-#define META_ATOMPROXY_KIND "AtomProxy"
-#define META_MODEL_KIND "Model"
-#define META_MODELPROXY_KIND "ModelProxy"
-#define META_REFERENCE_KIND "Reference"
-#define META_REFERENCEPROXY_KIND "ReferenceProxy"
-#define META_SET_KIND "Set"
-#define META_SETPROXY_KIND "SetProxy"
-#define META_CONNECTION_KIND "Connection"
-#define META_CONNECTIONPROXY_KIND "ConnectionProxy"
-#define META_FCO_KIND "FCO"
-#define META_FCOPROXY_KIND "FCOProxy"
-
-#define META_FOLDER_KIND "Folder"
-#define META_FOLDERPROXY_KIND "FolderProxy"
-
-#define META_ASPECT_KIND "Aspect"
-#define META_ASPECTPROXY_KIND "AspectProxy"
-
-#define META_BOOLEANATTR_KIND "BooleanAttribute"
-#define META_ENUMATTR_KIND "EnumAttribute"
-#define META_FIELDATTR_KIND "FieldAttribute"
-
-#define META_CONSTRAINT_KIND "Constraint"
-#define META_CONSTRAINTFUNC_KIND "ConstraintFunc"
-
-#define META_CONNECTOR_KIND "Connector"
-
-#define META_EQUIVALENCE_KIND "Equivalence"
-#define META_SAMEFOLDER_KIND "SameFolder"
-#define META_SAMEASPECT_KIND "SameAspect"
-
-
-#define META_INHERITANCE_KIND "Inheritance"
-#define META_IMPINHERITANCE_KIND "ImplementationInheritance"
-#define META_INTINHERITANCE_KIND "InterfaceInheritance"
-
-#define META_BOOLEANATTR_LABEL "bool"
-#define META_ENUMATTR_LABEL "enum"
-#define META_FIELDATTR_LABEL "field"
-
-#define META_PARAM_SHOWATTRIBUTES "showattributes"
-#define META_PARAM_SHOWABSTRACT "showabstract"
-#define META_PARAM_VAL_TRUE "true"
-#define META_PARAM_VAL_FALSE "false"
+#define META_ATOM_KIND _T("Atom")
+#define META_ATOMPROXY_KIND _T("AtomProxy")
+#define META_MODEL_KIND _T("Model")
+#define META_MODELPROXY_KIND _T("ModelProxy")
+#define META_REFERENCE_KIND _T("Reference")
+#define META_REFERENCEPROXY_KIND _T("ReferenceProxy")
+#define META_SET_KIND _T("Set")
+#define META_SETPROXY_KIND _T("SetProxy")
+#define META_CONNECTION_KIND _T("Connection")
+#define META_CONNECTIONPROXY_KIND _T("ConnectionProxy")
+#define META_FCO_KIND _T("FCO")
+#define META_FCOPROXY_KIND _T("FCOProxy")
+
+#define META_FOLDER_KIND _T("Folder")
+#define META_FOLDERPROXY_KIND _T("FolderProxy")
+
+#define META_ASPECT_KIND _T("Aspect")
+#define META_ASPECTPROXY_KIND _T("AspectProxy")
+
+#define META_BOOLEANATTR_KIND _T("BooleanAttribute")
+#define META_ENUMATTR_KIND _T("EnumAttribute")
+#define META_FIELDATTR_KIND _T("FieldAttribute")
+
+#define META_CONSTRAINT_KIND _T("Constraint")
+#define META_CONSTRAINTFUNC_KIND _T("ConstraintFunc")
+
+#define META_CONNECTOR_KIND _T("Connector")
+
+#define META_EQUIVALENCE_KIND _T("Equivalence")
+#define META_SAMEFOLDER_KIND _T("SameFolder")
+#define META_SAMEASPECT_KIND _T("SameAspect")
+
+
+#define META_INHERITANCE_KIND _T("Inheritance")
+#define META_IMPINHERITANCE_KIND _T("ImplementationInheritance")
+#define META_INTINHERITANCE_KIND _T("InterfaceInheritance")
+
+#define META_BOOLEANATTR_LABEL _T("bool")
+#define META_ENUMATTR_LABEL _T("enum")
+#define META_FIELDATTR_LABEL _T("field")
+
+#define META_PARAM_SHOWATTRIBUTES _T("showattributes")
+#define META_PARAM_SHOWABSTRACT _T("showabstract")
+#define META_PARAM_VAL_TRUE _T("true")
+#define META_PARAM_VAL_FALSE _T("false")
#define E_METADECORATOR_KINDNOTSUPPORTED 0x80737050
#define E_METADECORATOR_INVALID_PARAMVALUE 0x80737051
Modified: trunk/Paradigms/MetaGME/MetaDecorator/MetaClassPart.cpp
==============================================================================
--- trunk/Paradigms/MetaGME/MetaDecorator/MetaClassPart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/Paradigms/MetaGME/MetaDecorator/MetaClassPart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -144,8 +144,7 @@
}
CComBSTR bstr;
COMTHROW(m_spFCO->get_Name(&bstr));
- CString labelStr;
- CopyTo(bstr, labelStr);
+ CString labelStr = bstr;
m_LabelPart = new DecoratorSDK::ClassLabelPart(this, m_eventSink, m_showAbstract && m_isAbstract);
m_LabelPart->SetText(labelStr);
}
@@ -206,23 +205,20 @@
CComBSTR attrPosBstr; // zolmol added: sort by [y, x]
COMTHROW(targetFco->get_RegistryValue(L"PartRegs/Attributes/Position", &attrPosBstr));
- CString attr_pos;
- CopyTo(attrPosBstr, attr_pos);
+ CString attr_pos = attrPosBstr;
CPoint pos(0, 0);
- int res = _stscanf(attr_pos, "%d,%d", &pos.x, &pos.y);
+ int res = _stscanf(attr_pos, _T("%d,%d"), &pos.x, &pos.y);
if (res != 2)
pos = CPoint(0, 0);
- CString targetKind;
- CopyTo(bstr, targetKind);
+ CString targetKind = bstr;
if (targetKind == META_BOOLEANATTR_KIND ||
targetKind == META_ENUMATTR_KIND ||
targetKind == META_FIELDATTR_KIND)
{
CComBSTR nameBstr;
COMTHROW(targetFco->get_Name(&nameBstr));
- CString targetName;
- CopyTo(nameBstr, targetName);
+ CString targetName = nameBstr;
CString targetType;
if (targetKind == META_BOOLEANATTR_KIND)
targetType = META_BOOLEANATTR_LABEL;
Modified: trunk/Paradigms/MetaGME/MetaDecorator/MetaCompositePart.cpp
==============================================================================
--- trunk/Paradigms/MetaGME/MetaDecorator/MetaCompositePart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/Paradigms/MetaGME/MetaDecorator/MetaCompositePart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -76,8 +76,7 @@
CComBSTR bstr;
COMTHROW(m_spMetaFCO->get_Name(&bstr));
- CString stereotypeName;
- CopyTo(bstr, stereotypeName);
+ CString stereotypeName = bstr;
// Get ShapeCode
ShapeCode shape = MetaDecor::GetDecorUtils().GetShapeCode(stereotypeName);
@@ -131,7 +130,7 @@
} else { // This must be a class
COMTHROW(m_spMetaFCO->get_DisplayedName(&bstr));
if (bstr.Length() != 0)
- CopyTo(bstr, stereotypeName);
+ stereotypeName = bstr;
AddObjectPart(new MetaClassPart(this, m_eventSink, shape, stereotypeName));
// The MetaClassPart handles the label also
Modified: trunk/Paradigms/MetaGME/MetaDecorator/MetaDecorator.vcxproj
==============================================================================
--- trunk/Paradigms/MetaGME/MetaDecorator/MetaDecorator.vcxproj Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/Paradigms/MetaGME/MetaDecorator/MetaDecorator.vcxproj Fri Apr 1 10:08:25 2011 (r1242)
@@ -20,13 +20,13 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
- <CharacterSet>MultiByte</CharacterSet>
+ <CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Modified: trunk/Paradigms/MetaGME/MetaGME.sln
==============================================================================
--- trunk/Paradigms/MetaGME/MetaGME.sln Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/Paradigms/MetaGME/MetaGME.sln Fri Apr 1 10:08:25 2011 (r1242)
@@ -38,10 +38,10 @@
{92AE3C21-CE95-4A59-97D9-ACB5082426DE}.Debug|Win32.Build.0 = Debug|Win32
{92AE3C21-CE95-4A59-97D9-ACB5082426DE}.Release|Win32.ActiveCfg = Release|Win32
{92AE3C21-CE95-4A59-97D9-ACB5082426DE}.Release|Win32.Build.0 = Release|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.ActiveCfg = Debug|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.Build.0 = Debug|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.ActiveCfg = Release|Win32
- {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.Build.0 = Release|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.ActiveCfg = DebugUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Debug|Win32.Build.0 = DebugUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.ActiveCfg = ReleaseUnicode|Win32
+ {77FEBD41-CD6C-4D55-B561-3957F7151CC2}.Release|Win32.Build.0 = ReleaseUnicode|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Modified: trunk/SDK/DecoratorLib/BitmapUtil.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/BitmapUtil.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/BitmapUtil.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -478,8 +478,8 @@
m_pBMI (NULL),
m_pPalette (NULL)
{
- char chBuffer[10];
- _ultoa( nResID, chBuffer, 10 );
+ TCHAR chBuffer[10];
+ _ultot( nResID, chBuffer, 10 );
setName(chBuffer);
ReadFromResource( nResID );
@@ -1000,9 +1000,9 @@
for ( unsigned int i = 0 ; !success && i < vecPathes.size() ; i++ )
{
CString imageFileName = vecPathes[ i ] + strFName;
- bool fileExists = (_access(imageFileName, 0) == 0); // Uses GetFileAttributes
+ bool fileExists = (_taccess(imageFileName, 0) == 0); // Uses GetFileAttributes
if (fileExists) {
- m_pImage = Gdiplus::Image::FromFile( CA2W( (LPCTSTR) imageFileName));
+ m_pImage = Gdiplus::Image::FromFile( CStringW( (LPCTSTR) imageFileName));
if( m_pImage && m_pImage->GetLastStatus() == Gdiplus::Ok)
{
UINT widthToSet = m_pImage->GetWidth();
Modified: trunk/SDK/DecoratorLib/DecoratorDefs.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorDefs.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorDefs.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -12,8 +12,8 @@
{
CString createResString( int iID )
{
- char chBuffer[ 10 ];
- _itoa( iID, chBuffer, 10 );
+ TCHAR chBuffer[ 10 ];
+ _itot( iID, chBuffer, 10 );
return CString( chBuffer ) + ".res";
}
Modified: trunk/SDK/DecoratorLib/DecoratorDefs.h
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorDefs.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorDefs.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -182,28 +182,28 @@
static const int GME_3D_BORDER_SIZE = 3;
static const double INHERITANCE_RATIO = 0.86602540378443864676372317075294;
- static const char* TILE_ATOMDEFAULT = "$TILE$Atom_Default";
- static const char* TILE_MODELDEFAULT = "$TILE$Model_Default";
- static const char* TILE_PORTDEFAULT = "$TILE$Port_Default";
-
- static const char* CTX_MENU_STR_RENAME = "Rename";
- static const char* CTX_MENU_STR_RESETSIZE = "Reset to original size";
- static const char* CTX_MENU_STR_SETSIZE = "Set size";
- static const char* CTX_MENU_STR_EXPANDMODEL = "Expand model";
- static const char* CTX_MENU_STR_COLLAPSEMODEL = "Collapse model";
+ static const TCHAR* TILE_ATOMDEFAULT = _T("$TILE$Atom_Default");
+ static const TCHAR* TILE_MODELDEFAULT = _T("$TILE$Model_Default");
+ static const TCHAR* TILE_PORTDEFAULT = _T("$TILE$Port_Default");
+
+ static const TCHAR* CTX_MENU_STR_RENAME = _T("Rename");
+ static const TCHAR* CTX_MENU_STR_RESETSIZE = _T("Reset to original size");
+ static const TCHAR* CTX_MENU_STR_SETSIZE = _T("Set size");
+ static const TCHAR* CTX_MENU_STR_EXPANDMODEL = _T("Expand model");
+ static const TCHAR* CTX_MENU_STR_COLLAPSEMODEL = _T("Collapse model");
static const unsigned int CTX_MENU_ID_RENAME = DECORATOR_CTX_MENU_MINID + 0;
static const unsigned int CTX_MENU_ID_RESETSIZE = DECORATOR_CTX_MENU_MINID + 1;
static const unsigned int CTX_MENU_ID_SETSIZE = DECORATOR_CTX_MENU_MINID + 2;
static const unsigned int CTX_MENU_ID_EXPANDMODEL = DECORATOR_CTX_MENU_MINID + 3;
static const unsigned int CTX_MENU_ID_COLLAPSEMODEL = DECORATOR_CTX_MENU_MINID + 4;
- static const char* STEREOTYPE_LEFTA = "<<";
- static const char* STEREOTYPE_RIGHTA = ">>";
+ static const TCHAR* STEREOTYPE_LEFTA = _T("<<");
+ static const TCHAR* STEREOTYPE_RIGHTA = _T(">>");
static const wchar_t* STEREOTYPE_LEFTB = L"\u226A ";
static const wchar_t* STEREOTYPE_RIGHTB = L" \u226B";
- static const char* ABSTRACT_ATTR = "IsAbstract";
- static const char* ATTRIBUTES_ATTR = "Attributes";
- static const char* ATTRIBUTE_SEP = " : ";
+ static const TCHAR* ABSTRACT_ATTR = _T("IsAbstract");
+ static const TCHAR* ATTRIBUTES_ATTR = _T("Attributes");
+ static const TCHAR* ATTRIBUTE_SEP = _T(" : ");
static const int DECORATOR_MARGINX = 6;
static const int DECORATOR_MARGINY = 4;
Modified: trunk/SDK/DecoratorLib/DecoratorLib.vcxproj
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorLib.vcxproj Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorLib.vcxproj Fri Apr 1 10:08:25 2011 (r1242)
@@ -4,10 +4,18 @@
<Configuration Condition="'$(Configuration)'==''">Release</Configuration>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="DebugUnicode|Win32">
+ <Configuration>DebugUnicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
+ <ProjectConfiguration Include="ReleaseUnicode|Win32">
+ <Configuration>ReleaseUnicode</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -25,33 +33,61 @@
<UseOfAtl>Dynamic</UseOfAtl>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Dynamic</UseOfMfc>
+ <UseOfAtl>Dynamic</UseOfAtl>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseOfMfc>Dynamic</UseOfMfc>
<UseOfAtl>Dynamic</UseOfAtl>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseOfMfc>Dynamic</UseOfMfc>
+ <UseOfAtl>Dynamic</UseOfAtl>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GME_ROOT)\GME\Lib\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'">$(GME_ROOT)\GME\Lib\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GME_ROOT)\GME\Lib\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'">$(GME_ROOT)\GME\Lib\</OutDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'" />
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectName)D</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'">$(ProjectName)uD</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'">$(ProjectName)u</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
@@ -66,6 +102,35 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile />
+ <Lib>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Lib>
+ <Xdcmake>
+ <OutputFile>$(GME_ROOT)\SDK\DecoratorLib\Debug\$(TargetName).xml</OutputFile>
+ </Xdcmake>
+ <Bscmake />
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'">
+ <Midl>
+ <AdditionalIncludeDirectories>$(GME_ROOT)\GME\Interfaces;$(GME_ROOT)\Interfaces;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>$(GME_ROOT)\GME\Interfaces;$(GME_ROOT)\Interfaces;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;OLD_DECORATOR_LOOKANDFEEL;LIBCOMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<ResourceCompile />
<Lib>
@@ -95,6 +160,37 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
+ </ClCompile>
+ <ResourceCompile />
+ <Lib>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Lib>
+ <Xdcmake>
+ <OutputFile>$(GME_ROOT)\SDK\DecoratorLib\Release\$(TargetName).xml</OutputFile>
+ </Xdcmake>
+ <Bscmake />
+ <PostBuildEvent>
+ <Command>
+ </Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'">
+ <Midl>
+ <AdditionalIncludeDirectories>$(GME_ROOT)\GME\Interfaces;$(GME_ROOT)\Interfaces;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </Midl>
+ <ClCompile>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>$(GME_ROOT)\GME\Interfaces;$(GME_ROOT)\Interfaces;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;OLD_DECORATOR_LOOKANDFEEL;LIBCOMPILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<ResourceCompile />
<Lib>
@@ -156,7 +252,9 @@
<ClCompile Include="SizeTrackerDialog.cpp" />
<ClCompile Include="Stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugUnicode|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseUnicode|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="StereoLabelPart.cpp" />
<ClCompile Include="TextPart.cpp" />
Modified: trunk/SDK/DecoratorLib/DecoratorMfc.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorMfc.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorMfc.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -5,12 +5,12 @@
// --------------------------- Error
-void DisplayError(const char *msg, HRESULT hr)
+void DisplayError(const TCHAR *msg, HRESULT hr)
{
ASSERT( msg != NULL );
CString a;
- a.Format(" (0x%x)", hr);
+ a.Format(_T(" (0x%x)"), hr);
a.Insert(0, msg);
CString desc;
Modified: trunk/SDK/DecoratorLib/DecoratorMfc.h
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorMfc.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorMfc.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -10,33 +10,38 @@
// --------------------------- CString
-inline void CopyTo(const CString &s, BSTR *b) { CopyTo(s, s.GetLength(), b); }
-inline void CopyTo(const CString &s, VARIANT *v) { CopyTo(s, s.GetLength(), v); }
-inline void CopyTo(const CString &s, CComBstrObj &a) { CopyTo(s, s.GetLength(), a); }
-inline void CopyTo(const CString &s, CComVariant &a) { CopyTo(s, s.GetLength(), a); }
+inline void CopyTo(const CStringA &s, BSTR *b) { CopyTo(s, s.GetLength(), b); }
+inline void CopyTo(const CStringA &s, VARIANT *v) { CopyTo(s, s.GetLength(), v); }
+inline void CopyTo(const CStringA &s, CComBstrObj &a) { CopyTo(s, s.GetLength(), a); }
+inline void CopyTo(const CStringW &s, CComBstrObj &a) { a = CComBstrObj(static_cast<const wchar_t*>(s)); }
+inline void CopyTo(const CStringW &s, CComBSTR &a) { a = static_cast<const wchar_t*>(s); }
+inline void CopyTo(const CComBstrObj &s, CStringW &a) { a = static_cast<const wchar_t*>(s); }
+inline void CopyTo(const CStringA &s, CComVariant &a) { CopyTo(s, s.GetLength(), a); }
-inline void CopyTo(BSTR b, CString &s)
+inline void CopyTo(BSTR b, CStringA &s)
{
int len = GetCharLength(b);
CopyTo(b, s.GetBufferSetLength(len), len);
s.ReleaseBuffer(len);
}
-inline void CopyTo(VARIANT &v, CString &s)
+inline void CopyTo(VARIANT &v, CStringA &s)
{
int len = GetCharLength(v);
CopyTo(v, s.GetBufferSetLength(len), len);
s.ReleaseBuffer(len);
}
-inline void CopyTo(const CString &s, CComBSTR &b) { CopyTo(s, &b); }
+inline void CopyTo(const CStringA &s, CComBSTR &b) { CopyTo(s, &b); }
+template<class char_t>
class PutOutCString
{
+ typedef ATL::CStringT< char_t, StrTraitMFC_DLL< char_t > > CString_t;
private:
- friend PutOutCString PutOut(CString &s);
+ friend PutOutCString PutOut(CString_t &s);
- PutOutCString(CString &a) : s(a)
+ PutOutCString(CString_t &a) : s(a)
{
ASSERT( &s != NULL );
}
@@ -56,12 +61,17 @@
private:
CComBstrObj b;
- CString &s;
+ CString_t &s;
};
-inline PutOutCString PutOut(CString &s)
+inline PutOutCString<char> PutOut(CStringA &s)
{
- return PutOutCString(s);
+ return PutOutCString<char>(s);
+}
+
+inline PutOutCString<wchar_t> PutOut(CStringW &s)
+{
+ return PutOutCString<wchar_t>(s);
}
class PutInCString
@@ -70,10 +80,10 @@
template<class T>
PutInCString(T t) { CopyTo(t, b); }
- operator const CString &() { return b; }
+ operator const CStringA &() { return b; }
operator const char *() { return b; }
- CString b;
+ CStringA b;
};
// --------------------------- CComObjPtrArray
Modified: trunk/SDK/DecoratorLib/DecoratorUtil.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorUtil.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorUtil.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -29,7 +29,7 @@
bool Convert( const CString& strValue, long& lValue, bool bIsHexa )
{
- return sscanf( strValue, ( bIsHexa ) ? "%x" : "%ld", &lValue ) == 1;
+ return _stscanf( strValue, ( bIsHexa ) ? _T("%x") : _T("%ld"), &lValue ) == 1;
}
bool Convert( const CString& strValue, COLORREF& crValue )
@@ -49,46 +49,46 @@
bool Convert( const CString& strValueIn, ELocation& eValue )
{
int iValue = 0;
- if ( sscanf( strValueIn, "%d", &iValue ) == 1 ) {
+ if ( _stscanf( strValueIn, _T("%d"), &iValue ) == 1 ) {
eValue = (ELocation) iValue;
return true;
}
CString strValue = strValueIn;
strValue.TrimLeft( _T("\t ") );
strValue.TrimRight( _T("\t ") );
- if ( strValue == "N") {
+ if ( strValue == _T("N")) {
eValue = L_NORTH;
return true;
}
- if ( strValue == "NE") {
+ if ( strValue == _T("NE")) {
eValue = L_NORTHEAST;
return true;
}
- if ( strValue == "E") {
+ if ( strValue == _T("E")) {
eValue = L_EAST;
return true;
}
- if ( strValue == "SE") {
+ if ( strValue == _T("SE")) {
eValue = L_SOUTHEAST;
return true;
}
- if ( strValue == "S") {
+ if ( strValue == _T("S")) {
eValue = L_SOUTH;
return true;
}
- if ( strValue == "SW") {
+ if ( strValue == _T("SW")) {
eValue = L_SOUTHWEST;
return true;
}
- if ( strValue == "W") {
+ if ( strValue == _T("W")) {
eValue = L_WEST;
return true;
}
- if ( strValue == "NW") {
+ if ( strValue == _T("NW")) {
eValue = L_NORTHWEST;
return true;
}
- if ( strValue =="C") {
+ if ( strValue ==_T("C")) {
eValue = L_CENTER;
return true;
}
@@ -119,13 +119,13 @@
COMTHROW(registrar->get_FontSmoothMode(REGACCESS_USER, &fontSmoothMode));
m_eFontAntiAlias = (Gdiplus::TextRenderingHint)fontSmoothMode;
- createFont( FONT_LABEL, "Arial", FW_NORMAL, false, 16 );
- createFont( FONT_PORT, "Arial", FW_BOLD, false, 12 );
- createFont( FONT_TYPE, "Arial", FW_NORMAL, false, 12 );
- createFont( FONT_PORT_OUTSIDE, "Arial", FW_BOLD, false, 11 );
- createFont( FONT_PORTNAME, "Arial", FW_NORMAL, false, 15 );
- createFont( FONT_CONNLABEL, "Arial", FW_LIGHT, false, 12 );
- createFont( FONT_ABSTRACT, "Arial", FW_NORMAL, true, 15 );
+ createFont( FONT_LABEL, _T("Arial"), FW_NORMAL, false, 16 );
+ createFont( FONT_PORT, _T("Arial"), FW_BOLD, false, 12 );
+ createFont( FONT_TYPE, _T("Arial"), FW_NORMAL, false, 12 );
+ createFont( FONT_PORT_OUTSIDE, _T("Arial"), FW_BOLD, false, 11 );
+ createFont( FONT_PORTNAME, _T("Arial"), FW_NORMAL, false, 15 );
+ createFont( FONT_CONNLABEL, _T("Arial"), FW_LIGHT, false, 12 );
+ createFont( FONT_ABSTRACT, _T("Arial"), FW_NORMAL, true, 15 );
TileVector* pTileVector = new TileVector();
@@ -222,7 +222,7 @@
CComBSTR bstrParadigm;
COMTHROW( pProject->get_ParadigmConnStr( &bstrParadigm ) );
m_strParadigmPath = CString( bstrParadigm );
- if ( m_strParadigmPath.Find( "MGA=" ) == 0 ) {
+ if ( m_strParadigmPath.Find( _T("MGA=") ) == 0 ) {
int iPos = m_strParadigmPath.ReverseFind( _T('\\') );
if( iPos >= 4 ) {
m_strParadigmPath = m_strParadigmPath.Mid( 4, iPos - 4 );
@@ -234,7 +234,7 @@
CComBSTR bstrProject;
COMTHROW( pProject->get_ProjectConnStr( &bstrProject ) );
m_strProjectPath = CString( bstrProject );
- if ( m_strProjectPath.Find( "MGA=" ) == 0 ) {
+ if ( m_strProjectPath.Find( _T("MGA=") ) == 0 ) {
int iPos = m_strProjectPath.ReverseFind( _T('\\') );
if( iPos >= 4 ) {
m_strProjectPath = m_strProjectPath.Mid( 4, iPos - 4 );
@@ -255,13 +255,13 @@
CComBSTR bstrPath;
COMTHROW( spRegistrar->get_IconPath( REGACCESS_BOTH, &bstrPath ) );
- CopyTo( bstrPath, strPath );
+ strPath = bstrPath;
}
catch ( hresult_exception & ) {
}
- strPath.Replace( "$PARADIGMDIR", m_strParadigmPath );
- strPath.Replace( "$PROJECTDIR", m_strProjectPath );
+ strPath.Replace( _T("$PARADIGMDIR"), m_strParadigmPath );
+ strPath.Replace( _T("$PROJECTDIR"), m_strProjectPath );
while( ! strPath.IsEmpty() ) {
int iPos = strPath.Find( ';' );
@@ -281,10 +281,10 @@
}
strDir.Replace( '/', '\\' );
if ( strDir.GetAt( strDir.GetLength() - 1 ) != '\\' )
- strDir += "\\";
+ strDir += _T("\\");
m_vecPathes.push_back( strDir );
}
- m_vecPathes.push_back( ".\\" );
+ m_vecPathes.push_back( _T(".\\") );
m_bArePathesValid = true;
}
@@ -380,8 +380,7 @@
bstrValue.Empty();
}
- CString strValueT;
- CopyTo( bstrValue, strValueT );
+ CString strValueT = bstrValue;
if ( ! strValueT.IsEmpty() )
strValue = strValueT;
return ! strValueT.IsEmpty();
@@ -429,7 +428,7 @@
if ( ! getPreference( spFCO, spMetaFCO, strName, strValue ) )
return false;
strValue.MakeLower();
- bValue = strValue == "t" || strValue == "true" || strValue == "1";
+ bValue = strValue == _T("t") || strValue == _T("true") || strValue == _T("1");
return true;
}
@@ -469,8 +468,7 @@
bstrValue.Empty();
}
- CString strValueT;
- CopyTo( bstrValue, strValueT );
+ CString strValueT = bstrValue;
if ( ! strValueT.IsEmpty() )
strValue = strValueT;
return ! strValueT.IsEmpty();
@@ -632,21 +630,21 @@
CString strID( strName );
if ( masked ) {
if (nResID != 0) {
- char chBuffer[ 10 ];
- _ultoa( nResID, chBuffer, 10 );
+ TCHAR chBuffer[ 10 ];
+ _ultot( nResID, chBuffer, 10 );
strID += chBuffer;
}
- strID += "<Masked>";
+ strID += _T("<Masked>");
}
if ( bHasTC ) {
- char chBuffer[ 10 ];
- _ultoa( crTC, chBuffer, 16 );
- strID += "<TC:" + CString( chBuffer ) + ">";
+ TCHAR chBuffer[ 10 ];
+ _ultot( crTC, chBuffer, 16 );
+ strID += _T("<TC:") + CString( chBuffer ) + _T(">");
}
if ( bHasBC ) {
- char chBuffer[ 10 ];
- _ultoa( crBC, chBuffer, 16 );
- strID += "<BC:" + CString( chBuffer ) + ">";
+ TCHAR chBuffer[ 10 ];
+ _ultot( crBC, chBuffer, 16 );
+ strID += _T("<BC:") + CString( chBuffer ) + _T(">");
}
std::map<CString,BitmapBase*>::iterator it = m_mapBitmaps.find( strID );
@@ -673,16 +671,16 @@
if( strName.GetLength() >= 5) // in case of ".jpeg"
strEx2 = strName.Right(5).MakeLower();
- if ( strExt != ".bmp" && strExt != ".gif" && strExt != ".png"
- && strExt != ".jpg" && strExt != ".jpe" && strEx2 != ".jpeg"
- && strExt != ".res" && strExt != ".wmf" && strExt != ".emf")
- strExt = "";
+ if ( strExt != _T(".bmp") && strExt != _T(".gif") && strExt != _T(".png")
+ && strExt != _T(".jpg") && strExt != _T(".jpe") && strEx2 != _T(".jpeg")
+ && strExt != _T(".res") && strExt != _T(".wmf") && strExt != _T(".emf"))
+ strExt = _T("");
}
if( strExt.IsEmpty()) // if no extension then try the different formats
{
bool success = false;
- static char * exts[] = { ".bmp", ".gif", ".png", ".jpg", ".jpe", ".jpeg", ".wmf", ".emf" };
+ static TCHAR * exts[] = { _T(".bmp"), _T(".gif"), _T(".png"), _T(".jpg"), _T(".jpe"), _T(".jpeg"), _T(".wmf"), _T(".emf") };
for( int i = 0; !success && i < 6; ++i)
{
CString strName2 = strName + exts[i];
@@ -699,7 +697,7 @@
delete pBMP;
}
}
- else if( strExt != ".res") // if regular file use name as is
+ else if( strExt != _T(".res")) // if regular file use name as is
{
BitmapGen* pBMP = NULL;
if ( bHasTC )
@@ -713,8 +711,8 @@
delete pBMP;
}
- if ( strExt == ".res" || strExt.IsEmpty() ) {
- int iID = atoi( strName.Left( strName.GetLength() - ( ( strExt.IsEmpty() ) ? 0 : 4 ) ) );
+ if ( strExt == _T(".res") || strExt.IsEmpty() ) {
+ int iID = _ttoi( strName.Left( strName.GetLength() - ( ( strExt.IsEmpty() ) ? 0 : 4 ) ) );
if( iID == 0) // might be true if specified icon filename
return NULL; // has no extension and not found yet
BitmapRES* pBMP = NULL;
@@ -759,7 +757,7 @@
BitmapBase* Facilities::getMaskedBitmap( UINT nResID, COLORREF crTransparent, COLORREF crBackground )
{
- return getBitmap( "", true, crTransparent, true, crBackground, true, nResID );
+ return getBitmap( _T(""), true, crTransparent, true, crBackground, true, nResID );
}
void Facilities::addTileVector( const CString& strName, TileVector* vecTiles )
@@ -817,7 +815,7 @@
Gdiplus::Pen* Facilities::GetPen( COLORREF crColor, int iWidth )
{
CString chBuffer;
- chBuffer.Format("%x-%ld", crColor, iWidth);
+ chBuffer.Format(_T("%x-%ld"), crColor, iWidth);
std::map<CString,Gdiplus::Pen*>::iterator it = m_mapPens.find(chBuffer);
if (it != m_mapPens.end())
return it->second;
@@ -829,7 +827,7 @@
Gdiplus::SolidBrush* Facilities::GetBrush( COLORREF crColor )
{
CString chBuffer;
- chBuffer.Format("%x", crColor);
+ chBuffer.Format(_T("%x"), crColor);
std::map<CString,Gdiplus::SolidBrush*>::iterator it = m_mapBrushes.find(chBuffer);
if (it != m_mapBrushes.end())
return it->second;
@@ -838,21 +836,21 @@
return pBrush;
}
-CSize Facilities::MeasureText( Gdiplus::Graphics* gdip, GdipFont* pFont, const CString& strText)
+CSize Facilities::MeasureText( Gdiplus::Graphics* gdip, GdipFont* pFont, const CString& strText) const
{
return MeasureText(gdip, pFont->gdipFont, strText);
}
-CSize Facilities::MeasureText( Gdiplus::Graphics* gdip, Gdiplus::Font* pFont, const CString& strText)
+CSize Facilities::MeasureText( Gdiplus::Graphics* gdip, Gdiplus::Font* pFont, const CString& strText) const
{
Gdiplus::Graphics* gdip2 = gdip;
if (gdip == NULL)
gdip2 = m_gdip;
- CA2W wcTxt(strText);
Gdiplus::PointF origin(0, 0);
Gdiplus::RectF rectF;
- gdip2->MeasureString(wcTxt, strText.GetLength(), pFont, origin, &rectF);
+ CStringW strText2(strText);
+ gdip2->MeasureString(strText2, strText2.GetLength(), pFont, origin, &rectF);
Gdiplus::SizeF sizeF;
rectF.GetSize(&sizeF);
CSize size(static_cast<long> (sizeF.Width), static_cast<long> (sizeF.Height));
@@ -871,7 +869,7 @@
{
CString strText2( strPre + strText + strPost );
if ( iLength != -1 && strText2.GetLength() > iLength )
- strText2 = strPre + strText.Left( iLength ) + ( ( bPeriods ) ? "..." : "" ) + strPost;
+ strText2 = strPre + strText.Left( iLength ) + ( ( bPeriods ) ? _T("...") : _T("") ) + strPost;
Gdiplus::StringFormat format;
Gdiplus::StringAlignment horizontalAlignment;
@@ -903,7 +901,7 @@
GetGValue(textColor),
GetBValue(textColor)));
- CA2W wcTxt(strText2);
+ CStringW wcTxt(strText2);
Gdiplus::RectF rectF(static_cast<float> (crBounds.left),
static_cast<float> (crBounds.top),
static_cast<float> (crBounds.Width()),
Modified: trunk/SDK/DecoratorLib/DecoratorUtil.h
==============================================================================
--- trunk/SDK/DecoratorLib/DecoratorUtil.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DecoratorUtil.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -108,8 +108,8 @@
bool getMetaFCO(const CComPtr<IMgaMetaPart> &metaPart, CComPtr<IMgaMetaFCO> &metaFco) const;
- CSize MeasureText( Gdiplus::Graphics* gdip, GdipFont* pFont, const CString& strText);
- CSize MeasureText( Gdiplus::Graphics* gdip, Gdiplus::Font* pFont, const CString& strText);
+ CSize MeasureText( Gdiplus::Graphics* gdip, GdipFont* pFont, const CString& strText) const;
+ CSize MeasureText( Gdiplus::Graphics* gdip, Gdiplus::Font* pFont, const CString& strText) const;
void DrawString( Gdiplus::Graphics* gdip, const CString& strText, const CRect& crBounds, GdipFont* pFont,
COLORREF crColor, int iAlign, int iLength = -1, const CString& strPre = "",
const CString& strPost = "", bool bPeriods = true ) const;
Modified: trunk/SDK/DecoratorLib/DialogTemplate.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/DialogTemplate.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DialogTemplate.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -4,11 +4,11 @@
#include "stdafx.h"
#include "DialogTemplate.h"
-CDialogTemplate::CDialogTemplate(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h,
- LPCSTR font, WORD fontSize)
+CDialogTemplate::CDialogTemplate(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h,
+ LPCTSTR font, WORD fontSize)
{
usedBufferLength = sizeof(DLGTEMPLATE);
- totalBufferLength = 4 * usedBufferLength;
+ totalBufferLength = 8 * usedBufferLength; // FIXME: this appears to be a guess
dialogTemplate = (DLGTEMPLATE*)(new char[totalBufferLength]);
@@ -29,8 +29,8 @@
// The dialog box doesn't have a menu or a special class
- AppendData(_T("\0"), 2);
- AppendData(_T("\0"), 2);
+ AppendData("\0", 2);
+ AppendData("\0", 2);
// Add the dialog's caption to the template
@@ -59,7 +59,7 @@
delete [] ((char*)dialogTemplate);
}
-void CDialogTemplate::AddButton(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddButton(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0080, caption, style, exStyle, x, y, w, h, id);
@@ -68,7 +68,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddEditBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddEditBox(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0081, caption, style, exStyle, x, y, w, h, id);
@@ -77,7 +77,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddStatic(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddStatic(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0082, caption, style, exStyle, x, y, w, h, id);
@@ -86,7 +86,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddListBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddListBox(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0083, caption, style, exStyle, x, y, w, h, id);
@@ -95,7 +95,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddScrollBar(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddScrollBar(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0084, caption, style, exStyle, x, y, w, h, id);
@@ -104,7 +104,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddComboBox(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddComboBox(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddStandardComponent(0x0085, caption, style, exStyle, x, y, w, h, id);
@@ -113,7 +113,7 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddRichEdit(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y,
+void CDialogTemplate::AddRichEdit(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y,
int w, int h, WORD id)
{
AddComponent(0x0081, RICHEDIT_CLASS, caption, style, exStyle, x, y, w, h, id);
@@ -122,13 +122,13 @@
AppendData(&creationDataLength, sizeof(WORD));
}
-void CDialogTemplate::AddStandardComponent(WORD type, LPCSTR caption, DWORD style,
+void CDialogTemplate::AddStandardComponent(WORD type, LPCTSTR caption, DWORD style,
DWORD exStyle, int x, int y, int w, int h, WORD id)
{
AddComponent(type, NULL, caption, style, exStyle, x, y, w, h, id);
}
-void CDialogTemplate::AddComponent(WORD type, LPCSTR classId, LPCSTR caption, DWORD style,
+void CDialogTemplate::AddComponent(WORD type, LPCTSTR classId, LPCTSTR caption, DWORD style,
DWORD exStyle, int x, int y, int w, int h, WORD id)
{
DLGITEMTEMPLATE item;
@@ -175,6 +175,11 @@
}
}
+void CDialogTemplate::AppendString(LPCWSTR string)
+{
+ AppendData(string, (wcslen(string) + 1) * sizeof(wchar_t));
+}
+
void CDialogTemplate::AppendString(LPCSTR string)
{
int length = MultiByteToWideChar(CP_ACP, 0, string, -1, NULL, 0);
@@ -186,7 +191,7 @@
free(wideString);
}
-void CDialogTemplate::AppendData(void* data, int dataLength)
+void CDialogTemplate::AppendData(const void* data, int dataLength)
{
EnsureSpace(dataLength);
Modified: trunk/SDK/DecoratorLib/DialogTemplate.h
==============================================================================
--- trunk/SDK/DecoratorLib/DialogTemplate.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/DialogTemplate.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -17,25 +17,26 @@
class CDialogTemplate
{
public:
- CDialogTemplate(LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h,
- LPCSTR font = NULL, WORD fontSize = 8);
+ CDialogTemplate(LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h,
+ LPCTSTR font = NULL, WORD fontSize = 8);
virtual ~CDialogTemplate();
operator const DLGTEMPLATE*() const;
- void AddButton (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddEditBox (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddStatic (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddListBox (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddScrollBar (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddComboBox (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddRichEdit (LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddButton (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddEditBox (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddStatic (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddListBox (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddScrollBar (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddComboBox (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddRichEdit (LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
protected:
- void AddStandardComponent(WORD type, LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
- void AddComponent(WORD type, LPCSTR classId, LPCSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddStandardComponent(WORD type, LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
+ void AddComponent(WORD type, LPCTSTR classId, LPCTSTR caption, DWORD style, DWORD exStyle, int x, int y, int w, int h, WORD id);
void AlignData(int size);
+ void AppendString(LPCWSTR string);
void AppendString(LPCSTR string);
- void AppendData(void* data, int dataLength);
+ void AppendData(const void* data, int dataLength);
void EnsureSpace(int length);
private:
Modified: trunk/SDK/DecoratorLib/InPlaceEditDialog.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/InPlaceEditDialog.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/InPlaceEditDialog.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -85,7 +85,11 @@
bool CInPlaceEditDialog::IsValidString(const CString& textToValidate)
{
+#ifdef UNICODE
+ return true; // FIXME
+#else
return IsAsciiString(textToValidate);
+#endif
}
void CInPlaceEditDialog::SignalBackToGme(void)
@@ -101,7 +105,7 @@
m_parentPart->ExecuteOperation(m_Text);
// transaction operation end
} else {
- m_intendedParentCWnd->MessageBox("Invalid (non ASCII) string data: " + textToValidate, "In-place Editor", MB_ICONERROR);
+ m_intendedParentCWnd->MessageBox(_T("Invalid (non ASCII) string data: ") + textToValidate, _T("In-place Editor"), MB_ICONERROR);
}
}
m_parentPart->LabelEditingFinished(m_initialRect);
@@ -132,7 +136,7 @@
// start font scaling pass 1
Gdiplus::Font* originalFont = DecoratorSDK::getFacilities().GetFont(m_iFontKey)->gdipFont;
LOGFONT lf1;
- originalFont->GetLogFontA(DecoratorSDK::getFacilities().getGraphics(), &lf1);
+ originalFont->GetLogFontT(DecoratorSDK::getFacilities().getGraphics(), &lf1);
CSize windowExt = dc.GetWindowExt();
CSize viewPortExt = dc.GetViewportExt();
ASSERT(viewPortExt.cx / windowExt.cx == viewPortExt.cy / windowExt.cy);
@@ -152,7 +156,7 @@
// start font scaling pass 2
LOGFONT lf2;
- originalFont->GetLogFontA(DecoratorSDK::getFacilities().getGraphics(), &lf2);
+ originalFont->GetLogFontT(DecoratorSDK::getFacilities().getGraphics(), &lf2);
double zoom2 = (double)m_labelRect.Height() * viewZoom / (double)cSize.cy; // Correction zoom
old_lfheight = lf2.lfHeight;
lf2.lfHeight = (long)(lf2.lfHeight * viewZoom * zoom2);
Modified: trunk/SDK/DecoratorLib/ModelComplexPart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/ModelComplexPart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/ModelComplexPart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -138,7 +138,7 @@
}
LOGFONT logFont;
- getFacilities().GetFont(FONT_PORT)->gdipFont->GetLogFontA(getFacilities().getGraphics(), &logFont);
+ getFacilities().GetFont(FONT_PORT)->gdipFont->GetLogFontT(getFacilities().getGraphics(), &logFont);
long lWidth = 0;
if (m_bPortLabelInside) {
ASSERT(m_iLongestPortTextLength >= 0 && m_iLongestPortTextLength <= 1000);
Modified: trunk/SDK/DecoratorLib/ModelSwitchPart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/ModelSwitchPart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/ModelSwitchPart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -80,9 +80,7 @@
}
}
- CString boolStr;
- CopyTo(bstrVal, boolStr);
- if (boolStr == "1")
+ if (bstrVal == L"1")
bExpanded = true;
else
bExpanded = false;
Modified: trunk/SDK/DecoratorLib/ResizablePart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/ResizablePart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/ResizablePart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -190,13 +190,13 @@
CDialogTemplate dlgTemplate(_T("Set size"),
DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU, // Window Styles
0, // Extended Window Styles
- 0, 0, SetSizeDialogWidth, SetSizeDialogHeight, "MS Shell Dlg", 8);
- dlgTemplate.AddButton("OK", WS_VISIBLE, 0, 6, 42, 50, 14, IDOK);
- dlgTemplate.AddButton("Cancel", WS_VISIBLE, 0, 60, 42, 50, 14, IDCANCEL);
- dlgTemplate.AddStatic("Width:", WS_VISIBLE, 0, 6, 6, 26, 8, WidthTextCtrlId);
- dlgTemplate.AddStatic("Height:", WS_VISIBLE, 0, 6, 24, 26, 8, HeightTextCtrlId);
- dlgTemplate.AddEditBox("", WS_VISIBLE | ES_AUTOHSCROLL, 0, 36, 6, 72, 14, WidthEditCtrlId);
- dlgTemplate.AddEditBox("", WS_VISIBLE | ES_AUTOHSCROLL, 0, 36, 24, 72, 14, HeightEditCtrlId);
+ 0, 0, SetSizeDialogWidth, SetSizeDialogHeight, _T("MS Shell Dlg"), 8);
+ dlgTemplate.AddButton(_T("OK"), WS_VISIBLE, 0, 6, 42, 50, 14, IDOK);
+ dlgTemplate.AddButton(_T("Cancel"), WS_VISIBLE, 0, 60, 42, 50, 14, IDCANCEL);
+ dlgTemplate.AddStatic(_T("Width:"), WS_VISIBLE, 0, 6, 6, 26, 8, WidthTextCtrlId);
+ dlgTemplate.AddStatic(_T("Height:"), WS_VISIBLE, 0, 6, 24, 26, 8, HeightTextCtrlId);
+ dlgTemplate.AddEditBox(_T(""), WS_VISIBLE | ES_AUTOHSCROLL, 0, 36, 6, 72, 14, WidthEditCtrlId);
+ dlgTemplate.AddEditBox(_T(""), WS_VISIBLE | ES_AUTOHSCROLL, 0, 36, 24, 72, 14, HeightEditCtrlId);
CSetSizeDialog setSizeDlg;
setSizeDlg.SetParameters(this, GetLocation(), point, resizeLogic.DeterminePotentialResize(point),
Modified: trunk/SDK/DecoratorLib/SetSizeDialog.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/SetSizeDialog.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/SetSizeDialog.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -140,11 +140,11 @@
{
CString sizeStr;
m_widthEditWnd->GetWindowText(sizeStr);
- m_lWidth = atoi(sizeStr);
+ m_lWidth = _ttoi(sizeStr);
m_heightEditWnd->GetWindowText(sizeStr);
- m_lHeight = atoi(sizeStr);
+ m_lHeight = _ttoi(sizeStr);
if (m_lWidth <= 0 || m_lHeight <= 0) {
- AfxMessageBox("Please provide valid non-negative integer values!", MB_OK | MB_ICONSTOP);
+ AfxMessageBox(_T("Please provide valid non-negative integer values!"), MB_OK | MB_ICONSTOP);
return false;
}
return true;
@@ -166,9 +166,9 @@
void CSetSizeDialog::AdjustPositionAndValues(const CPoint& point, const CRect& location)
{
CString sizeStr;
- sizeStr.Format("%ld", location.Width());
+ sizeStr.Format(_T("%ld"), location.Width());
m_widthEditWnd->SetWindowText(sizeStr);
- sizeStr.Format("%ld", location.Height());
+ sizeStr.Format(_T("%ld"), location.Height());
m_heightEditWnd->SetWindowText(sizeStr);
CPoint adjPos = GetAdjustedPosition(point);
MoveWindow(adjPos.x, adjPos.y, SetSizeDialogWidth, SetSizeDialogHeight);
Modified: trunk/SDK/DecoratorLib/SizeTrackerDialog.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/SizeTrackerDialog.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/SizeTrackerDialog.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -76,7 +76,7 @@
CString CSizeTrackerDialog::GetStrToDisplay(const CRect& location)
{
CString sizeTxt;
- sizeTxt.Format("size:(%ld,%ld)", location.Width(), location.Height());
+ sizeTxt.Format(_T("size:(%ld,%ld)"), location.Width(), location.Height());
return sizeTxt;
}
Modified: trunk/SDK/DecoratorLib/Stdafx.h
==============================================================================
--- trunk/SDK/DecoratorLib/Stdafx.h Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/Stdafx.h Fri Apr 1 10:08:25 2011 (r1242)
@@ -48,6 +48,12 @@
#include "DecoratorMfc.h"
#include <stdio.h>
+#ifdef UNICODE
+#define GetLogFontT GetLogFontW
+#else
+#define GetLogFontT GetLogFontA
+#endif
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Modified: trunk/SDK/DecoratorLib/TextPart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/TextPart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/TextPart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -121,7 +121,7 @@
COMTHROW(m_spFCO->get_Name(&bstrText));
}
if (!bTextDefined)
- CopyTo(bstrText, m_strText);
+ m_strText = bstrText;
if (m_strText == "Condition") {
m_strText = "Condition";
}
Modified: trunk/SDK/DecoratorLib/TypeableLabelPart.cpp
==============================================================================
--- trunk/SDK/DecoratorLib/TypeableLabelPart.cpp Thu Mar 31 16:33:52 2011 (r1241)
+++ trunk/SDK/DecoratorLib/TypeableLabelPart.cpp Fri Apr 1 10:08:25 2011 (r1242)
@@ -82,7 +82,7 @@
COMTHROW(m_spFCO->get_DerivedFrom(&spType));
CComBSTR bstrName;
COMTHROW(spType->get_Name(&bstrName));
- CopyTo(bstrName, m_strTypeName);
+ m_strTypeName = bstrName;
}
} else {
CComPtr<IMgaFCO> spType;
@@ -92,7 +92,7 @@
// proba [
CComBSTR bstrName;
COMTHROW(spType->get_Name(&bstrName));
- CopyTo(bstrName, m_strTypeName);
+ m_strTypeName = bstrName;
// ] proba
} else {
CComPtr<IMgaFCOs> spFCOs;
@@ -134,7 +134,7 @@
if (m_bTypeNameEnabled && (m_iTypeInfo == 3 || m_iTypeInfo == 2)) {
LOGFONT logFont;
- getFacilities().GetFont(FONT_TYPE)->gdipFont->GetLogFontA(gdip, &logFont);
+ getFacilities().GetFont(FONT_TYPE)->gdipFont->GetLogFontT(gdip, &logFont);
ECoordRefPoint eAlign = GetAlignment(m_eTextLocation);
CSize cSize(logFont.lfWidth * m_strTypeName.GetLength(), logFont.lfHeight);
More information about the gme-commit
mailing list