Changes between Version 14 and Version 15 of Coding_Conventions


Ignore:
Timestamp:
Mar 2, 2012, 12:43:23 AM (12 years ago)
Author:
historic_bruno
Comment:

Adds wxString info and simple typecasting example

Legend:

Unmodified
Added
Removed
Modified
  • Coding_Conventions

    v14 v15  
    9595
    9696    for (int i = 0; i < value; ++i)
    97         DoSomethingElse(i, value);
     97        DoSomethingElse(i, (unsigned int)value);
    9898
    9999    return value;
     
    190190wprintf(L"%ls", L"wchar_t string");
    191191}}}
     192 * In AtlasUI, you should prefer the wxWidgets API and construct strings like this (see the [http://wiki.wxwidgets.org/Converting_everything_to_and_from_wxString wxWiki] for more examples):
     193{{{
     194#!cpp
     195wxString str = _T("SomeUnicodeSTRING"); // Don't use wxT() directly because it breaks OS X build
     196wxString translatedStr = _("A string that may be translated"); // Translated string for UI purposes
     197
     198// Sometimes you have to pass messages to the engine and need C++ strings:
     199std::string cppStr = str.c_str();
     200std::wstring cppWStr = str.wc_str(); // Don't use c_str() because it breaks OS X build
     201}}}
    192202
    193203=== Misc ===