wxGridBagSizer in wxCrafter

Post here wxCrafter related issues / features / bugs
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

wxGridBagSizer in wxCrafter

Post by iwbnwif »

Hi,

I am trying to use a wxGridBagSizer in wxCrafter (version 2.5, Ubuntu and Windows 10) to layout something like the following:
wxGBS.png
If I add a wxGridBagSizer to any window in wxCrafter it seems to overwrite the entire contents of the window. Also the "Show Preview" function does not seem to work.

However, the code that is generated by wxCrafter is correct, and indeed compiles to produce the desired output as above:

Code: Select all

    m_pMainSizer = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(m_pMainSizer);
    
    m_pMainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxTAB_TRAVERSAL);
    
    m_pMainSizer->Add(m_pMainPanel, 1, wxEXPAND, 5);
    
    m_pGridBagSizer = new wxGridBagSizer(0, 0);
    m_pMainPanel->SetSizer(m_pGridBagSizer);
    
    m_pStatic = new wxStaticText(m_pMainPanel, wxID_ANY, _("Static Text Label:"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    m_pGridBagSizer->Add(m_pStatic, wxGBPosition(0,0), wxGBSpan(1,1), wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
    
    m_pButton = new wxButton(m_pMainPanel, wxID_ANY, _("My Button"), wxDefaultPosition, wxSize(-1,-1), 0);
    
    m_pGridBagSizer->Add(m_pButton, wxGBPosition(0,1), wxGBSpan(1,1), wxALL, 5);
    
    m_pText = new wxTextCtrl(m_pMainPanel, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), wxTE_RICH2);
    #if wxVERSION_NUMBER >= 3000
    m_pText->SetHint(wxT(""));
    #endif
    
    m_pGridBagSizer->Add(m_pText, wxGBPosition(1,0), wxGBSpan(2,2), wxALL|wxEXPAND, 5);
    m_pGridBagSizer->AddGrowableCol(0);
Obviously this is undesirable though because I would like to be able to visually design the layout ;)
You do not have the required permissions to view the files attached to this post.
Lotharyx
CodeLite Enthusiast
Posts: 12
Joined: Wed Apr 20, 2016 8:01 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxGridBagSizer in wxCrafter

Post by Lotharyx »

I had written a post about an assert, but it turned out to be unrelated.

So yeah, it's some sort of issue with wxCrafter itself, and I have the same problem. I'm using nested Sizers to achieve the look I want.

CodeLite 9.1.6 on Debian Jessie
gcc-4.9
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxGridBagSizer in wxCrafter

Post by eranif »

Can you provide a minimal example with wxGridBagSizer that reproduces this?

Eran
Make sure you have read the HOW TO POST thread
iwbnwif
CodeLite Veteran
Posts: 81
Joined: Thu Mar 21, 2013 1:12 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: wxGridBagSizer in wxCrafter

Post by iwbnwif »

Can you provide a minimal example with wxGridBagSizer that reproduces this?
Please try to open the attached in wxCrafter. The layout should be as the image shown in my initial post.
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: wxGridBagSizer in wxCrafter

Post by eranif »

Thanks!
Make sure you have read the HOW TO POST thread
Post Reply