Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: paddle on October 30, 2019, 05:37:11 pm

Title: How to define new frame type in wxSmith? To add a worker thread.
Post by: paddle on October 30, 2019, 05:37:11 pm
Using codeblocks17.12 + wxwidgets 3.1.2 + wxsmith project template.

I need to add a worker thread as discussed on this wxwidget forum topic : https://forums.wxwidgets.org/viewtopic.php?f=1&t=46472

Someone supplied me a demo, but writen on raw wxwidgets. As I am using wxsmith there are some structure differences that makes things different.

One issue is that the demo declares a new frame type deriving from wxFrame, in which he adds a thread class.

My issue is that on wxSmith template created by the CodeBlocks new wxwidgets project, I can't find where the frame class is defined.

In XxxApp.cpp (where Xxx is the project name) there's :

Code
XxxFrame* Frame = new XxxFrame(0);

But I cannot find where the XxxFrame is defined.

In XxxMain.cpp there's :

Code
//(*InternalHeaders(XxxFrame)
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(XxxFrame)
const long XxxFrame::ID_PANEL1 = wxNewId();
const long XxxFrame::idMenuQuit = wxNewId();
const long XxxFrame::idMenuAbout = wxNewId();
const long XxxFrame::ID_STATUSBAR1 = wxNewId();
//*)

XxxFrame::XxxFrame (wxWindow* parent,wxWindowID id)
{
...
But nothing like :

Code
class XxxFrame : public wxFrame
{
public:
    ...
};
How can I add some changes to the Frame class to add my thread class?

Alternatively, if someone have a demo for a wxsmith project with a worker thread that would be really awesome.

Thanks!
Title: Re: How to define new frame type in wxSmith? To add a worker thread.
Post by: Miguel Gimenez on October 30, 2019, 05:43:07 pm
The frame is defined in XxxMain.h
Title: Re: How to define new frame type in wxSmith? To add a worker thread.
Post by: paddle on October 30, 2019, 05:49:06 pm
Thanks!