wxChart as custom control

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
martynwheeler
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Feb 11, 2021 7:53 pm

wxChart as custom control

Post by martynwheeler »

Hi again,

This is probably a longshot, but here goes. I am trying to plot a graph in the app that I am building. I am using codelite which, in turn, uses wxCrafter to build the gui. I have found a graph control called wxCharts. I have compiled it and tested a sample. I would ideally like to add it as a custom control in codelite - there is not very much in the way of documentation for this so I am little in the dark. I realise that this may be quite an advanced task but it would be good if I can work out how to achieve it! If someone could give me a few pointers I would really appreciate it. I guess the other way is to add the graph class manually to file generated from wxCrafter.

Thank you

Martyn
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: wxChart as custom control

Post by stahta01 »

Have you asked this question on the codelite forum? If not, why not?

https://forums.codelite.org/

Tim S.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxChart as custom control

Post by DavidHart »

Hi,

(Indeed, the codelite forum would be a better place.)
guess the other way is to add the graph class manually to file generated from wxCrafter.
No, don't amend generated files; those alterations would be overwritten each time you used wxCrafter to amend something. Instead you should (in a separate file) derive from the base-class(es) created by wxCrafter.

You mentioned earlier that you were using, or thinking of using, XRC. It's a long time since I tried using wxXmlResource::AttachUnknownControl. wxCrafter does support that (see the 'Custom Controls' menu) but it is little used/tested, and obviously won't know any details about wxCharts.

Unless wxCharts provides its own XRC implementation, I suspect you'll find it far easier to subclass the C++ code and add it by hand.

Regards,

David
Post Reply