Search found 200 matches

by ollydbg23
Thu Apr 09, 2020 2:56 am
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

@ONEEYEMAN
Thanks, I understand your suggestion now.
Thanks for your time and help.

I think I will close this thread now.
by ollydbg23
Wed Apr 08, 2020 11:55 pm
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

Hi, widgets sample. Found in the wxWidgets\samples\widgets. Oh, I see this sample code. I search the text "wxChoice" in all the source in this sample project. I don't know which part implements "It has a code showing how to implement it without using static variable." Do you mean this part? void Ch...
by ollydbg23
Wed Apr 08, 2020 3:26 pm
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

ONEEYEMAN wrote:
Wed Apr 08, 2020 3:06 pm
Hi,
No it shouldn't.

Look at the widgets sample. It has a code showing how to implement it without using static variable.

Thank you.
Which sample? Thanks.
by ollydbg23
Wed Apr 08, 2020 7:08 am
Forum: C++ Development
Topic: How to display math formula or symbol in wxWidgets?
Replies: 7
Views: 521

Re: How to display math formula or symbol in wxWidgets?

shawnee wrote:
Tue Apr 07, 2020 7:33 am
ollydbg23 wrote:
Tue Mar 24, 2020 12:57 am
https://github.com/NanoMichael/cLaTeXMath

I found another good latex render library.
Thank you, ollydbg23!
It looks good.
Please note that the cLaTeXMath project doesn't have a wxWidgets port, so you have to implement it yourself. Show us the progress if you have any good work. :D
by ollydbg23
Wed Apr 08, 2020 7:06 am
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

Hi, Why not just make it a member of wxApp-derived class and then make a getter/setter pair? Thank you. Hi, ONEEYEMAN, a bit late reply. In-fact, I have a string array which is used to construct a wxChoice list in a setting dialog or a panel. I don't think this string array should belong to a wxApp...
by ollydbg23
Fri Apr 03, 2020 12:47 am
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

Well, I do need to share some const strings(wxString) between classes, any good way to avoid this issue? Initialize them at run-time, e.g. with a static Init() function you call from wxApp::OnInit() OK, I understand, thanks. The steps are: 1, leave the static member string as empty string in cpp, t...
by ollydbg23
Fri Apr 03, 2020 12:03 am
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

The main issue is still that if you use _() for global variables, wxWidgets functions will be called before wxWidgets itself is initialized. Which may work or not and should be avoided. I see, thanks. In general, there shall be no global variable of a non-trivial wxWidgets class. So, you suggest th...
by ollydbg23
Thu Apr 02, 2020 11:24 pm
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

You mean it works when you only use _() when initializing elements and never calling wxGetTranslation()/_() on it? I mean I use _() in the initialization of the static string instead of wxTRANSLATE(), and later I call wxGetTranslation() on the string. I mean using _() is still OK , but we must call...
by ollydbg23
Thu Apr 02, 2020 2:25 pm
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

Re: wxLocale and static wxString's translation

Thanks for the suggestion. I think the only other way besides initializing the string after the locale is set would be something like the code here https://docs.wxwidgets.org/trunk/group__group__funcmacro__string.html#gab8862de0f74049708bfea75ae9e14c45 I'm a little puzzled, that: I see the link sugg...
by ollydbg23
Thu Apr 02, 2020 2:11 am
Forum: C++ Development
Topic: wxLocale and static wxString's translation
Replies: 18
Views: 729

wxLocale and static wxString's translation

Hi, What is the best place to set the language translation initialization? For me, I have initialization the language here: bool MainApp::OnInit() { int sysLang = wxLocale::GetSystemLanguage(); m_locale.Init(sysLang, wxLOCALE_LOAD_DEFAULT); wxLocale::AddCatalogLookupPathPrefix("yyyyy"); if(!m_locale...
by ollydbg23
Sun Mar 22, 2020 8:54 am
Forum: C++ Development
Topic: How to display math formula or symbol in wxWidgets?
Replies: 7
Views: 521

Re: How to display math formula or symbol in wxWidgets?

I don't know any C or C++ library for converting from LATEX to image, except latexpp , so you can try to use it. As an alternative you can find some utility for convertation and call it from your application. This github project looks good. From my point of view, there are two methods (which I thin...
by ollydbg23
Sun Jul 21, 2019 1:31 am
Forum: Component Writing
Topic: Is it possible to show autocomplete dropdown manually
Replies: 14
Views: 2266

Re: Is it possible to show autocomplete dropdown manually

I think the OP want the feature like in this link: Visual Assist Features: Coding Assistance - Whole Tomato Software.

When user enter: "lstb", the autocompletion shows an entry "LuaStackToBinary".
by ollydbg23
Sun May 19, 2019 3:46 am
Forum: C++ Development
Topic: Implementing MVC in wxWidgets
Replies: 12
Views: 11294

Re: Implementing MVC in wxWidgets

Hi, I notice that there is a bug in your SimpleMVC.zip sample code which lead to crash when you click the "exit" button. Here: MainFrame::~MainFrame() { ModelClass::getInstance()->UnNotifyOnNewMail(view_id); } /*Controller functions*/ void MainFrame::controllerGetNewMails(wxCommandEvent& e) { //get ...
by ollydbg23
Sat Jul 14, 2018 3:03 pm
Forum: wxCode
Topic: assert GetEventHandler()== this failed
Replies: 5
Views: 13379

Re: assert GetEventHandler()== this failed

As this is rather common problem with (the first-time use of) AUI, I am surprised patch from this ticket , seemingly simple, working and backwards compatible was not been applied long time ago. Perhaps it somewhat slipped through the cracks... I meet this issue today(I just forget to add the Uninit...