Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: ollydbg on May 24, 2023, 12:55:12 pm
-
wxMathPlot (https://github.com/GitHubLionel/wxMathPlot)
This is an improved wxMathPlot which has many good features, such as track the points(around the mouse), magnet cross lines, more powerful context menu and config dialog to tweak the plot.
In-fact, I have helped to improve this control, and when discussed with the author, he has some feature request:
https://github.com/GitHubLionel/wxMathPlot/issues/13#issuecomment-1560538840
Mainly:
the ability (with a checkbox in the IDE) to avoid the creation of the name of the widget (suppress all the long list of wxNewId())
the creation of an array of string for the wxChoice widget
the use of Bind in place of Connect
an user code for i18n string. Default code is _("string") but if you have your own function, you wish could replace it by another thing (for example _myI18N("string")).
Any ideas, and hopefully we can fix some of them.
-
Generation of Bind() vs Connect() would be desirable, currently GCC emits a warning on every Connect() due to incorrect type for the wxObjectEventFunction parameter. This warnings appear when you activate -Wextra.
For the rest, I do not see the need:
- wxChoice already allows entering an array of strings, and you can use the "Extra code" property for more advanced usage.
- The custom string for translation makes little sense, the .POT files should be modified to recognize the custom string for no advantage.
- Removal of the name of the widget may reduce code size, but I see no other advantage
wxNewId() is deprecated, but it is difficult to replace.
-
Generation of Bind() vs Connect() would be desirable, currently GCC emits a warning on every Connect() due to incorrect type for the wxObjectEventFunction parameter. This warnings appear when you activate -Wextra.
Yes, the author of wxMathPlot also saw this issue in his IDE, see his github issue comment: https://github.com/GitHubLionel/wxMathPlot/issues/2#issuecomment-1348985032 and https://github.com/GitHubLionel/wxMathPlot/issues/12#issuecomment-1554172051
For the rest, I do not see the need:
- wxChoice already allows entering an array of strings, and you can use the "Extra code" property for more advanced usage.
- The custom string for translation makes little sense, the .POT files should be modified to recognize the custom string for no advantage.
- Removal of the name of the widget may reduce code size, but I see no other advantage
wxNewId() is deprecated, but it is difficult to replace.
OK, I see.
-
The Connect() calls are generated inside wxsEvents::GenerateBindingCode() and the change to Bind() looks straightforward, but IMHO this is not the best moment for doing this.
-
Now wxSmith allows generation of Bind() instead of Connect() changing a setting.
-
Now wxSmith allows generation of Bind() instead of Connect() changing a setting.
Thanks, let me building the new C::B right now.
-
Good work! I just build the latest svn Code::Blocks, and the generating of "Bind" function call works fine, thanks!
-
Hi, the author of wxMathPlot library has built C::B himself, and he modify the wxSmith code, and it can have the features he needed.
See here:
https://github.com/GitHubLionel/wxSmith/tree/main/src
And you can see the generated code here:
Change Items array for wxChoice (https://github.com/GitHubLionel/wxMathPlot/commit/bec09c323f54e22e9c3891e8d949fa8640e9aad7)
I guess we can incorporate his contribution?
See the discussion here: code with new wxSmith Issue #14 GitHubLionel/wxMathPlot (https://github.com/GitHubLionel/wxMathPlot/issues/14)