News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to prevent wxSmith from auto overwriting wxS("") string format back to _("")

Started by tomay3000, June 03, 2021, 11:24:12 PM

Previous topic - Next topic

tomay3000

Hello,

I need to prevent wxSmith from auto overwriting all string format manually changed to wxS("") back to _("") each time?
I need it to stay like wxS("").

TIA.

stahta01

Quote from: tomay3000 on June 03, 2021, 11:24:12 PM
Hello,

I need to prevent wxSmith from auto overwriting all string format manually changed to wxS("") back to _("") each time?
I need it to stay like wxS("").

TIA.

Do the change outside of the wxSmith comment block.

Edit: If that is not possible post where it happens and maybe someone can fix the wxSmith code.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Miguel Gimenez

In wxSmith's properties you can deactivate usage of i18n strings, but then it will use the format specified for non-i18n strings (wxS is not in the list)

tomay3000

Quote from: Miguel Gimenez on June 04, 2021, 08:17:08 AM
In wxSmith's properties you can deactivate usage of i18n strings, but then it will use the format specified for non-i18n strings (wxS is not in the list)

That helped, thank you ;)
I think wxS should be added to the list too in future development.

stahta01

Quote from: tomay3000 on June 04, 2021, 06:31:32 PM
Quote from: Miguel Gimenez on June 04, 2021, 08:17:08 AM
In wxSmith's properties you can deactivate usage of i18n strings, but then it will use the format specified for non-i18n strings (wxS is not in the list)

That helped, thank you ;)
I think wxS should be added to the list too in future development.

Do you know how to build Code::Blocks from source?
And, do you know how to use wxSmith?
If yes to both, I am trying to create a patch that adds wxS to list.
But, I have little knowledge of how to use wxSmith and really can not test it.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Possible patch that needs tested by someone who uses wxSmith and checked by someone who knows how to patch wxSmith.

Edit: Patch is too simple to give me credit; just use sf.net to add feature request and add this as a possible patch.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Miguel Gimenez


BlueHazzard

Quote from: stahta01 on June 05, 2021, 04:41:47 AM
Possible patch that needs tested by someone who uses wxSmith and checked by someone who knows how to patch wxSmith.

Edit: Patch is too simple to give me credit; just use sf.net to add feature request and add this as a possible patch.

Tim S.

Can you create the ticket? I will try to apply it as soon as i am at home, but in case i forget it... (we should add this... wxT() is deprecated according to the docs)
Credit to the creator!

stahta01

Quote from: BlueHazzard on June 05, 2021, 04:22:33 PM
Quote from: stahta01 on June 05, 2021, 04:41:47 AM
Possible patch that needs tested by someone who uses wxSmith and checked by someone who knows how to patch wxSmith.

Edit: Patch is too simple to give me credit; just use sf.net to add feature request and add this as a possible patch.

Tim S.

Can you create the ticket? I will try to apply it as soon as i am at home, but in case i forget it... (we should add this... wxT() is deprecated according to the docs)
Credit to the creator!

Replacing wxT() with wxT_2() would be better than removing it.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

Quote from: stahta01 on June 05, 2021, 06:41:44 PM
Replacing wxT() with wxT_2() would be better than removing it.
Why? wx people have removed wxT from their code base.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

stahta01

https://docs.wxwidgets.org/trunk/group__group__funcmacro__string.html#ga2e7c1f911a731a4b98a85fa44f1d9fbc

QuoteCompatibility macro which expands to wxT() in wxWidgets 2 only.

This macro can be used in code which needs to compile with both wxWidgets 2 and 3 versions, in places where the wx2 API requires a Unicode string (in Unicode build) but the wx3 API only accepts a standard narrow string, as in e.g. wxCmdLineEntryDesc structure objects initializers.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

oBFusCATed

wx2.x compatibility is not required for wxSmith.
For me a goal for wxSmith is to be able to generate correct and readable wx3.x code.
If it works in wx2.x fine, but it shouldn't be our goal.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

gd_on

In wxssettings.cpp, line 259, you use the macro _() to set the string wxS(""). As far as I understand, this string does not need to be translated (and more, must not...). So a macro as _T() or wxT() or may be wxT_2() should be preferable. And it's probably also the case for some other strings in the same cpp file.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Miguel Gimenez

Or just "wxS()", _T() and wxT() are not needed anymore.

QuoteNote that since wxWidgets 2.9.0 you shouldn't use wxT() anymore in your program sources