wxWidgets and VSCode

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

wxWidgets and VSCode

Tim Burgess-5
Hi,

Just wondering if anybody has had any success configuring a VSCode c++ environment with wxWidgets. Visual Studio 2017 works really well for me on Windows, but Xcode is an accessibility nightmare. VSCode looks like it might be a better alternative and Microsoft’s senior program manager is reaching out for accessibility feedback, so that’s good.

Any and all information would be most gratefully received.

Best wishes.

Tim Burgess

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: wxWidgets and VSCode

bubnikv
If I were you, I would go with CMake, and I would try


Please report back your experience :-)

On Wed, Oct 24, 2018 at 2:37 PM Tim Burgess <[hidden email]> wrote:
Hi,

Just wondering if anybody has had any success configuring a VSCode c++ environment with wxWidgets. Visual Studio 2017 works really well for me on Windows, but Xcode is an accessibility nightmare. VSCode looks like it might be a better alternative and Microsoft’s senior program manager is reaching out for accessibility feedback, so that’s good.

Any and all information would be most gratefully received.

Best wishes.

Tim Burgess

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: wxWidgets and VSCode

anil kumar
That is great, please share your experience.

On Wed, Oct 24, 2018 at 6:49 PM bubnikv <[hidden email]> wrote:
If I were you, I would go with CMake, and I would try


Please report back your experience :-)

On Wed, Oct 24, 2018 at 2:37 PM Tim Burgess <[hidden email]> wrote:
Hi,

Just wondering if anybody has had any success configuring a VSCode c++ environment with wxWidgets. Visual Studio 2017 works really well for me on Windows, but Xcode is an accessibility nightmare. VSCode looks like it might be a better alternative and Microsoft’s senior program manager is reaching out for accessibility feedback, so that’s good.

Any and all information would be most gratefully received.

Best wishes.

Tim Burgess

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: wxWidgets and VSCode

Pavel Kalugin
In reply to this post by Tim Burgess-5
Hi,

On 10/24/18 3:36 PM, Tim Burgess wrote:
> Hi,
>
> Just wondering if anybody has had any success configuring a VSCode c++ environment with wxWidgets.

I use VSCode as my primary IDE on Linux, and CMake to build wxWidgets.
This is how I set it up for IntelliSense to work in VSCode:

1. Add "C_Cpp.default.includePath" to workspace settings. The value
should reference the directory from where <wx/setup.h> could be found.
For example:
  "C_Cpp.default.includePath":
["${workspaceRoot}/../wx-debug-gtk2/lib/wx/include/gtk2-unicode-3.1"]

2. Reference this default in your active configuration in
.vscode/c_cpp_properties.json - just add "${default}" to includePath.
Here is my entire active configuration (I'm on an OpenSUSE):
     "configurations": [
         {
             "name": "suse-x64-gcc7",
             "includePath": [
                 "/usr/include/linux",
                 "/usr/include/c++/7/",
                 "/usr/include/c++/7/x86_64-suse-linux/",
                 "${workspaceRoot}/include",
                 "${default}"
             ],
             "defines": ["-D_GLIBCXX_USE_CXX11_ABI=1"],
             "intelliSenseMode": "gcc-x64",
             "browse": {
                 "path": [
                     "${workspaceRoot}"
                 ],
                 "limitSymbolsToIncludedHeaders": true,
                 "databaseFilename": ""
             },
             "compilerPath": "/usr/bin/g++-7",
             "cppStandard": "c++03"
         }
     ],

3. Also, you may want to add ".vscode" to your global .gitignore file.

--
Pavel

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

RE: wxWidgets and VSCode

Tim Burgess-5
Hi,

Thanks for both answers. I'm trying to avoid cmake, if I can and just get VSCode to call the same compiler/linker/debugger as XCode. I'm sure I can use Pavel's example as a template, but I'm confused on 2 points:

1 - Shouldn't any include path take the value of the wx-config --cxxflags output.

2 - Similarly, the --libs flag value would need to go somewhere for the linker, presumably?  

Best wishes.

Tim Burgess

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Pavel Kalugin
Sent: 24 October 2018 16:25
To: [hidden email]
Subject: Re: wxWidgets and VSCode

Hi,

On 10/24/18 3:36 PM, Tim Burgess wrote:
> Hi,
>
> Just wondering if anybody has had any success configuring a VSCode c++ environment with wxWidgets.

I use VSCode as my primary IDE on Linux, and CMake to build wxWidgets.
This is how I set it up for IntelliSense to work in VSCode:

1. Add "C_Cpp.default.includePath" to workspace settings. The value should reference the directory from where <wx/setup.h> could be found.
For example:
  "C_Cpp.default.includePath":
["${workspaceRoot}/../wx-debug-gtk2/lib/wx/include/gtk2-unicode-3.1"]

2. Reference this default in your active configuration in .vscode/c_cpp_properties.json - just add "${default}" to includePath.
Here is my entire active configuration (I'm on an OpenSUSE):
     "configurations": [
         {
             "name": "suse-x64-gcc7",
             "includePath": [
                 "/usr/include/linux",
                 "/usr/include/c++/7/",
                 "/usr/include/c++/7/x86_64-suse-linux/",
                 "${workspaceRoot}/include",
                 "${default}"
             ],
             "defines": ["-D_GLIBCXX_USE_CXX11_ABI=1"],
             "intelliSenseMode": "gcc-x64",
             "browse": {
                 "path": [
                     "${workspaceRoot}"
                 ],
                 "limitSymbolsToIncludedHeaders": true,
                 "databaseFilename": ""
             },
             "compilerPath": "/usr/bin/g++-7",
             "cppStandard": "c++03"
         }
     ],

3. Also, you may want to add ".vscode" to your global .gitignore file.

--
Pavel

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Changes in wxTranslations

David Connet-2
In reply to this post by Pavel Kalugin
I just tried switching to trunk and my i18n code now falls flat...

In my file, my strings are of a form "IDS_..." and I provide en (and fr)
po files. In 3.1.1, all is fine. But in 3.1.2, AddCatalog (ln 1580) `if
( msgIdLang == *lang )` prevents this from working (and returns false)

Both languages I support appear in the domain_langs array, but trying to
AddCatalog on either fails. I don't see anything in the docs folder
about wxTranslation changes.

I just compiled the internat sample and that fails with:
[Window Title]
Internat Error

[Content]
Couldn't find/load the 'internat' catalog for locale 'fr-FR'.

[OK]

Dave

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

David Connet-2
On 12/9/2018 10:14 AM, David Connet wrote:

> I just tried switching to trunk and my i18n code now falls flat...
>
> In my file, my strings are of a form "IDS_..." and I provide en (and fr)
> po files. In 3.1.1, all is fine. But in 3.1.2, AddCatalog (ln 1580) `if
> ( msgIdLang == *lang )` prevents this from working (and returns false)
>
> Both languages I support appear in the domain_langs array, but trying to
> AddCatalog on either fails. I don't see anything in the docs folder
> about wxTranslation changes.
>
> I just compiled the internat sample and that fails with:
> [Window Title]
> Internat Error
>
> [Content]
> Couldn't find/load the 'internat' catalog for locale 'fr-FR'.
>
> [OK]
>
> Dave
>

Oh, should mention I'm on Windows 10 using VS2017.

Dave

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

Vadim Zeitlin-4
In reply to this post by David Connet-2
[cc'ing Lauri as I'm not sure if he's subscribed to this list]

On Sun, 9 Dec 2018 10:14:16 -0800 David Connet wrote:

DC> I just tried switching to trunk and my i18n code now falls flat...
DC>
DC> In my file, my strings are of a form "IDS_..." and I provide en (and fr)
DC> po files. In 3.1.1, all is fine. But in 3.1.2, AddCatalog (ln 1580) `if
DC> ( msgIdLang == *lang )` prevents this from working (and returns false)

 I see... The problem is that the logic of this code is, in principle,
correct, as it doesn't make sense to load English translations of the
English messages, for example. But in your case the original messages are
not really in English. I think this might be fixed by just passing
something different from wxLANGUAGE_ENGLISH_US as AddCatalog() second
parameter, e.g. could you please check if using wxLANGUAGE_USER_DEFINED
there solves the problem?

DC> Both languages I support appear in the domain_langs array, but trying to
DC> AddCatalog on either fails.

 Or maybe I don't see, finally. Because what I described above can only
explain failing to "translate" to English, not to French.

DC> I don't see anything in the docs folder about wxTranslation changes.

 This was changed by 2d784da2ee1 but we thought (well, at least I did) that
this change was backwards-compatible. Clearly this is not the case, but
your email comes just a couple of hours too late to revert this commit for
3.1.2, unfortunately.

 Now we need to fix it and the first step should really be reproducing the
problem. Having a unit test would be great: we already have some test
catalogs under tests/intl and we could another one checking for this
situation. If you could add such a test, it would be great, otherwise I'll
try doing it myself.


DC> I just compiled the internat sample and that fails with:
DC> [Window Title]
DC> Internat Error
DC>
DC> [Content]
DC> Couldn't find/load the 'internat' catalog for locale 'fr-FR'.
DC>
DC> [OK]

 This is a different problem, I think. If you're running it under MSW, you
should run it from the root sample directory and not from the subdirectory
containing the executable.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

David Connet-2
(resending as I forgot to reply-all)

On 12/10/2018 7:15 AM, David Connet wrote:

> On 12/9/2018 10:34 AM, Vadim Zeitlin wrote:
>> [cc'ing Lauri as I'm not sure if he's subscribed to this list]
>>
>> On Sun, 9 Dec 2018 10:14:16 -0800 David Connet wrote:
>>
>> DC> I just tried switching to trunk and my i18n code now falls flat...
>> DC>
>> DC> In my file, my strings are of a form "IDS_..." and I provide en
>> (and fr)
>> DC> po files. In 3.1.1, all is fine. But in 3.1.2, AddCatalog (ln
>> 1580) `if
>> DC> ( msgIdLang == *lang )` prevents this from working (and returns
>> false)
>>
>>   I see... The problem is that the logic of this code is, in principle,
>> correct, as it doesn't make sense to load English translations of the
>> English messages, for example. But in your case the original messages are
>> not really in English. I think this might be fixed by just passing
>> something different from wxLANGUAGE_ENGLISH_US as AddCatalog() second
>> parameter, e.g. could you please check if using wxLANGUAGE_USER_DEFINED
>> there solves the problem?
>>
>> DC> Both languages I support appear in the domain_langs array, but
>> trying to
>> DC> AddCatalog on either fails.
>>
>>   Or maybe I don't see, finally. Because what I described above can only
>> explain failing to "translate" to English, not to French.
>
> Yes, I tried the above - English looks ok, but now my French doesn't
> load. (tho AddCatalog says true)
>
>> DC> I don't see anything in the docs folder about wxTranslation changes.
>>
>>   This was changed by 2d784da2ee1 but we thought (well, at least I
>> did) that
>> this change was backwards-compatible. Clearly this is not the case, but
>> your email comes just a couple of hours too late to revert this commit
>> for
>> 3.1.2, unfortunately.
>
> I also just tried commenting out the line I referred to above - my
> French still doesn't load... So the issue is a little deeper than my
> initial debug foray...
>
>>
>>   Now we need to fix it and the first step should really be
>> reproducing the
>> problem. Having a unit test would be great: we already have some test
>> catalogs under tests/intl and we could another one checking for this
>> situation. If you could add such a test, it would be great, otherwise
>> I'll
>> try doing it myself.
>
> I'll try, but I don't know when I'll have time. (I had just decided to
> do a quick 3.1.2 test compile since I saw the announcement - I had meant
> to look earlier, but, well... life.
>
>>
>> DC> I just compiled the internat sample and that fails with:
>> DC> [Window Title]
>> DC> Internat Error
>> DC>
>> DC> [Content]
>> DC> Couldn't find/load the 'internat' catalog for locale 'fr-FR'.
>> DC>
>> DC> [OK]
>>
>>   This is a different problem, I think. If you're running it under
>> MSW, you
>> should run it from the root sample directory and not from the
>> subdirectory
>> containing the executable.
>
> Ah - got it...
>
> Dave

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

Lauri Nurmi-2
In reply to this post by Vadim Zeitlin-4
Vadim Zeitlin kirjoitti 9.12.2018 klo 20:34:
> DC> I don't see anything in the docs folder about wxTranslation changes.
>
>   This was changed by 2d784da2ee1 but we thought (well, at least I did) that
> this change was backwards-compatible.

Yes, being backwards-compatible certainly was and is the intention.

> Clearly this is not the case, but your email comes just a couple of hours
> too late to revert this commit for 3.1.2, unfortunately.
>
>   Now we need to fix it and the first step should really be reproducing the
> problem.

Indeed. The problem sounds fundamental enough to be easily reproducible
in the internat sample. Can it be done?


LN


--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

David Connet-2

On 12/10/2018 2:10 PM, Lauri Nurmi wrote:

> Vadim Zeitlin kirjoitti 9.12.2018 klo 20:34:
>> DC> I don't see anything in the docs folder about wxTranslation changes.
>>
>>   This was changed by 2d784da2ee1 but we thought (well, at least I
>> did) that
>> this change was backwards-compatible.
>
> Yes, being backwards-compatible certainly was and is the intention.
>
>> Clearly this is not the case, but your email comes just a couple of
>> hours
>> too late to revert this commit for 3.1.2, unfortunately.
>>
>>   Now we need to fix it and the first step should really be
>> reproducing the
>> problem.
>
> Indeed. The problem sounds fundamental enough to be easily
> reproducible in the internat sample. Can it be done?
>
Not sure. It looks like internat only loads up one catalog (determined
with printf by adding wxTranslations::Get()->GetAcceptableTranslations
to internat.cpp)

I have 2 catalogs - these are loaded via wxResourceTranslationsLoader.
(At my program startup, I use
wxTranslations::Get()->GetAvailableTranslations("myname"); to display a
dialog with available langs to set at startup - this can also be called
at any time while the program is running)

Dave

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re[2]: Changes in wxTranslations

Vadim Zeitlin-4
In reply to this post by David Connet-2
On Mon, 10 Dec 2018 07:16:40 -0800 David Connet wrote:

DC> (resending as I forgot to reply-all)
DC>
DC> On 12/10/2018 7:15 AM, David Connet wrote:
DC> > On 12/9/2018 10:34 AM, Vadim Zeitlin wrote:
DC> >> [cc'ing Lauri as I'm not sure if he's subscribed to this list]
DC> >>
DC> >> On Sun, 9 Dec 2018 10:14:16 -0800 David Connet wrote:
DC> >>
DC> >> DC> I just tried switching to trunk and my i18n code now falls flat...
DC> >> DC>
DC> >> DC> In my file, my strings are of a form "IDS_..." and I provide en
DC> >> (and fr)
DC> >> DC> po files. In 3.1.1, all is fine. But in 3.1.2, AddCatalog (ln
DC> >> 1580) `if
DC> >> DC> ( msgIdLang == *lang )` prevents this from working (and returns
DC> >> false)
DC> >>
DC> >>   I see... The problem is that the logic of this code is, in principle,
DC> >> correct, as it doesn't make sense to load English translations of the
DC> >> English messages, for example. But in your case the original messages are
DC> >> not really in English. I think this might be fixed by just passing
DC> >> something different from wxLANGUAGE_ENGLISH_US as AddCatalog() second
DC> >> parameter, e.g. could you please check if using wxLANGUAGE_USER_DEFINED
DC> >> there solves the problem?
DC> >>
DC> >> DC> Both languages I support appear in the domain_langs array, but
DC> >> trying to
DC> >> DC> AddCatalog on either fails.
DC> >>
DC> >>   Or maybe I don't see, finally. Because what I described above can only
DC> >> explain failing to "translate" to English, not to French.
DC> >
DC> > Yes, I tried the above - English looks ok, but now my French doesn't
DC> > load. (tho AddCatalog says true)

 Could you please try to debug why exactly isn't French loaded when using
this workaround? I don't see it just from examining the code and I don't
have a way of reproducing the bug myself...

 TIA,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Changes in wxTranslations

David Connet-2
On 12/10/2018 6:57 PM, Vadim Zeitlin wrote:
>   Could you please try to debug why exactly isn't French loaded when using
> this workaround? I don't see it just from examining the code and I don't
> have a way of reproducing the bug myself...

Trying... I just tried modifying internat to use resources, but that
still works correctly (well, except it yells when trying to load
'en-us'). I probably won't get much time until this weekend...

(I know you don't want to look at random programs... but) My code is
https://github.com/dconnet/AgilityBook/blob/master/src/LibARBWin/LanguageManager.cpp 


Oh. I just got it working. It required
```
   if (m_CurLang == wxLANGUAGE_ENGLISH_US)
     rc = wxTranslations::Get()->AddCatalog("myname",
wxLANGUAGE_USER_DEFINED);
   else
     rc = wxTranslations::Get()->AddCatalog("myname");
```

Passing wxLANGUAGE_USER_DEFINED for french causes fr to not load. And
not passing it for EN causes that to fail.

Dave

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users