Open rossanoparis opened 1 month ago
There is no need for a reason to make function protected or private, what we need is a reason to add it to the public API and I don't see one there. Markup used with wxControl
is pretty specific to its use for labels and I don't see why would you use it anywhere else than in the implementation of the classes using these labels themselves.
What exactly do you want to use this function for and are you aware of the exact markup syntax this function recognizes?
Thank you for your reply.
are you aware of the exact markup syntax this function recognizes?
yes, it should be described in wxStaticText documentation
What exactly do you want to use this function for
Mainly because it is very useful to get a text as it will appear, before applying it to the control.
Reasons for using the function in that way could be different, but perhaps none of them are so important to give you a specific one.
I use the function wxControl::RemoveMnemonics
for the reason I've written, and stupidly, I would have espected to be able to use wxControl::RemoveMarkup
in the same way.
Thank you, regards
To be honest, I find this pretty unconvincing, i.e. I still don't see why would it be very useful.
Let's see if anybody else thinks we should make this part of the public API, but if not, I don't think this passes the bar for inclusion, sorry.
I understand this isn't a critical issue, and I can certainly find a workaround for my code. However, it would be nice if you could consider adding some symmetry to the function RemoveMnemonics. Anyway, thank you ... in the meantime, I'll keep my fingers crossed :)
regards
The following works (result == "Here be italic"), though of course it does mean you are using a private class which is not guaranteed to always be available:
#include <wx/private/markupparser.h>
wxString markup_test("Here be <span fgcolor=\'red\'><i>italic</i></span>");
auto result = wxMarkupParser::Strip(markup_test);
@Thank you @KeyWorksRW it was very kind of you
Description
I'm sorry, I'm not a wx library developer, and I'm not able to get my hands dirty in it, but I would like to propose this small modification I'm going to describe ...
Regarding wxStaticText there is the public static function
wxControl::RemoveMnemonics
which is very useful to get a text as it will appear, before applying it to the control.In my opinion, even the static function
wxControl::RemoveMarkup
should be public instead of protected. The two function are similar in their purpose, aren't they? Is there a specific reason for keepingwxControl::RemoveMarkup
as protected?Thank you, regards