CodeLite and wxCrafter

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.
philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 5:28 pm

Can this be fixed?
The code shows what I'm trying to do and (for those that understand) why I can't.

Code: Select all

sudo apt-add-repository 'deb https://repos.codelite.org/ubuntu/ artful universe'
phil@phil-OptiPlex-380 ~ $ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]         
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease                           
Hit:3 http://repos.codelite.org/wx3.0.4/ubuntu xenial InRelease                   
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]           
Hit:5 http://archive.canonical.com/ubuntu xenial InRelease                         
Ign:6 http://packages.linuxmint.com sylvia InRelease                               
Get:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]         
Hit:8 http://packages.linuxmint.com sylvia Release                               
Get:10 https://repos.codelite.org/ubuntu artful InRelease [2,855 B]               
Get:11 https://repos.codelite.org/ubuntu artful/universe amd64 Packages [1,250 B]
Get:12 https://repos.codelite.org/ubuntu artful/universe i386 Packages [1,271 B]
Fetched 312 kB in 3s (89.5 kB/s)
Reading package lists... Done
phil@phil-OptiPlex-380 ~ $ sudo apt-get install codelite wxcrafter
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies.
 codelite : Depends: libclang1-4.0 (>= 1:4.0-3~) but it is not going to be installed
            Depends: libhunspell-1.6-0 but it is not installable
            Depends: libwxbase3.0-0v5 (>= 3.0.3.1+dfsg2) but it is not going to be installed
            Depends: libwxgtk3.0-0v5 (>= 3.0.3.1+dfsg2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Wed Mar 21, 2018 7:33 pm

sudo apt-add-repository 'deb https://repos.codelite.org/ubuntu/ artful universe'

As mentioned in the other thread, the current Mint is based on ubuntu xenial, not artful.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 9:05 pm

As mentioned in the other thread, the current Mint is based on ubuntu xenial, not artful.


My brother in law is researching genealogy, I'll have to get him to see if idiocy runs in my family. Thanks.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 9:50 pm

Well, I did this (again!):

Code: Select all

sudo apt-add-repository -r 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ artful universe'

then

Code: Select all

sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ xenial universe'

then

Code: Select all

sudo apt-get install codelite

that worked fine
then

Code: Select all

 sudo apt-get install wxcrafter
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package wxcrafter


What next?

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Wed Mar 21, 2018 10:14 pm

Well, I did this (again!):
sudo apt-add-repository -r 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ artful universe'
then
sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ xenial universe'

Perhaps a copy/paste error, but those are the lines for wx3.0.4, not for CodeLite/wxCrafter.

If that's not relevant, I don't know what could be wrong. The file does exist in the repo.
If all else fails, you can download it using the direct link: https://repos.codelite.org/wxCrafter-2.9/xenial/64/wxcrafter_2.9-1unofficial.xenial_amd64.deb and install it using dpkg.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 10:28 pm

It was a faithfully reproduced copy/paste error, in that it accurately reflected what I had wrongly done by copy pasting into terminal.
Here is the contents of my additional-repositories.list in sources.list.d

Code: Select all

deb http://repos.codelite.org/wx3.0.4/ubuntu/ xenial universe


deb https://repos.codelite.org/ubuntu/ xenial universe


Having ensured that those entries are there, and that they appear to be correct, I tried again.
Still 'Unable to locate package wxcrafter'.


When I look at 'Manage Plugins' in Codelite, it has nothing in the left hand pane and only one item in the right hand pane 'wxHtmlWindow control!'.
Check, and check all are greyed out.
There was a message saying Codelite had many plugins by default, so this looks a bit odd.

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Wed Mar 21, 2018 10:44 pm

Having ensured that those entries are there, and that they appear to be correct, I tried again.

Did you apt clean too?

When I look at 'Manage Plugins' in Codelite, it has nothing in the left hand pane and only one item in the right hand pane 'wxHtmlWindow control!'

Which version of CodeLite have you actually installed (see the 'About' dialog)? The official debian/ubuntu one has the plugins in a separate package...

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 10:52 pm

help about says it is v9.1.0.

and

Code: Select all

apt-cache madison codelite
  codelite | 9.1+dfsg-2 | http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

Code: Select all

 apt-cache madison wxcrafter
N: Unable to locate package wxcrafter

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Wed Mar 21, 2018 11:09 pm

That's the official Mint package, not CodeLite 12.0. So you haven't succeeded in getting apt to see the CodeLite repo, which explains the wxCrafter issue too.

Did you apt clean followed by apt update?

One good thing about an apt frontend like synaptic is you can easily see what's available; and what isn't.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 11:13 pm

DavidHart wrote:That's the official Mint package, not CodeLite 12.0. So you haven't succeeded in getting apt to see the CodeLite repo, which explains the wxCrafter issue too.

Did you apt clean followed by apt update?

One good thing about an apt frontend like synaptic is you can easily see what's available; and what isn't.


I did, and redid stuff and it is now v12.
Now codelite has an impressive long list of plugins to run, including wxcrafter - which also runs.
One thing, I imported my wxformbuilder project, but can only see one of it's three forms, is that because it has not all imported or because I haven't figured out how to navigate in wxcrafter?

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Wed Mar 21, 2018 11:21 pm

I did, and redid stuff and it is now v12.

:)

One thing, I imported my wxformbuilder project, but can only see one of it's three forms, is that because it has not all imported or because I haven't figured out how to navigate in wxcrafter?

Possibly the latter. You probably have 3 *.wxcp files, one for each form. wxCrafter can only display one of them at a time. You may see the others listed in the combobox at the top of the Workspace View. Otherwise you can open a particular one by double-clicking it in CodeLite.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Wed Mar 21, 2018 11:35 pm

The treeview for wxCrafter wasn't displayed, when I double clicked wxcrafter in top left pane, a tab opened for it and was selected and the three items then could be seen in the tree view.
My font (I've mentioned the large font I wanted, I think?) Works here (I don't intend to try and compile and link as it is a bit late!) the odd thing is, I cannot find any code in the generated cpp or h for this? How's the compiler and linker going to know about it?

DavidHart
Site Admin
Site Admin
Posts: 3757
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: CodeLite and wxCrafter

Postby DavidHart » Thu Mar 22, 2018 7:50 am

Have you clicked the Generate Code button yet? If so, that code should replicate what you see displayed in wxCrafter. If not, you've found a wxCrafter bug. The easiest way to be sure what's going on is to build and run your program.

BTW, just as for wxFB, the best way to use wxCrafter is to think of the generated classes as 'base' classes (I recommend actually calling them FooBase rther than Foo). You then derive your real Foo class from FooBase. That means you can override and add to the generated features without having your changes overwritten each time you click the Generate Code button. When you create a new Form with wxCrafter you are nudged in that direction. I can't remember if that also happens when you import; maybe it depends on the wxFB project.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Thu Mar 22, 2018 9:43 am

I think I might have misled you. I didn't mean there was no code at all, wxC generated the code and the inherited classes, no problem, what I couldn't see within that code, was anything that seemed to relate to my font size.

philjynx
Earned some good credits
Earned some good credits
Posts: 136
Joined: Tue Mar 06, 2018 6:00 pm

Re: CodeLite and wxCrafter

Postby philjynx » Thu Mar 22, 2018 10:33 am

Here're the sections of the two generated files that relate to that big font frame.

the ccp:

Code: Select all

TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCrafterz7AuANInitBitmapResources();
        bBitmapLoaded = true;
    }
   
    wxGridSizer* gSizer1 = new wxGridSizer(3, 3, 0, 0);
    this->SetSizer(gSizer1);
   
    m_staticText2 = new wxStaticText(this, wxID_ANY, _("GR55"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_staticText2, 0, wxALL, WXC_FROM_DIP(5));
   
    m_staticText4 = new wxStaticText(this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_staticText4, 0, wxALL, WXC_FROM_DIP(5));
   
    m_button7 = new wxButton(this, wxID_ANY, _("Settings"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_button7, 0, wxALL, WXC_FROM_DIP(5));
   
    m_staticText5 = new wxStaticText(this, wxID_ANY, _("Katana"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_staticText5, 0, wxALL, WXC_FROM_DIP(5));
   
    m_staticText6 = new wxStaticText(this, wxID_ANY, _("MyLabel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_staticText6, 0, wxALL, WXC_FROM_DIP(5));
   
    m_button2 = new forward_declare(this, wxID_ANY, _("Settings"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
   
    gSizer1->Add(m_button2, 0, wxALL, WXC_FROM_DIP(5));
   
    m_button1 = new forward_declare(this, wxID_ANY, _("Quit"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_button1->SetDefault();
   
    gSizer1->Add(m_button1, 0, wxALL, WXC_FROM_DIP(5));
   
    m_textCtrl22 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0);
    #if wxVERSION_NUMBER >= 3000
    m_textCtrl22->SetHint(wxT(""));
    #endif
   
    gSizer1->Add(m_textCtrl22, 0, wxALL, WXC_FROM_DIP(5));
   
    m_statusBar1 = new wxStatusBar(this, wxID_ANY, wxST_SIZEGRIP);
    m_statusBar1->SetFieldsCount(1);
    this->SetStatusBar(m_statusBar1);
   
    SetName(wxT("TopFrame"));
    SetSize(540,300);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_button7->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnGR55Settings), NULL, this);
    m_button2->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnKatanaSettings), NULL, this);
    m_button1->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnQuit), NULL, this);
   
}

TopFrame::~TopFrame()
{
    m_button7->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnGR55Settings), NULL, this);
    m_button2->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnKatanaSettings), NULL, this);
    m_button1->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TopFrame::OnQuit), NULL, this);
   
}


and the h

Code: Select all

class TopFrame : public wxFrame
{
protected:
    wxStaticText* m_staticText2;
    wxStaticText* m_staticText4;
    wxButton* m_button7;
    wxStaticText* m_staticText5;
    wxStaticText* m_staticText6;
    forward_declare* m_button2;
    forward_declare* m_button1;
    wxTextCtrl* m_textCtrl22;
    wxStatusBar* m_statusBar1;

protected:
    virtual void OnGR55Settings(wxCommandEvent& event) { event.Skip(); }
    virtual void OnKatanaSettings(wxCommandEvent& event) { event.Skip(); }
    virtual void OnQuit(wxCommandEvent& event) { event.Skip(); }

public:
    wxStaticText* GetStaticText2() { return m_staticText2; }
    wxStaticText* GetStaticText4() { return m_staticText4; }
    wxButton* GetButton7() { return m_button7; }
    wxStaticText* GetStaticText5() { return m_staticText5; }
    wxStaticText* GetStaticText6() { return m_staticText6; }
    forward_declare* GetButton2() { return m_button2; }
    forward_declare* GetButton1() { return m_button1; }
    wxTextCtrl* GetTextCtrl22() { return m_textCtrl22; }
    wxStatusBar* GetStatusBar1() { return m_statusBar1; }
    TopFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT(""), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(540,300), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL);
    virtual ~TopFrame();
};


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 1 guest