Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

The sizers arent doing anything?

(1/1)

MadBoat:
Yesterday I was fiddling with some unrelated problems (AFAIK), and suddenly the sizers (both box sizers and grid sizers) I use in the new window I'm working on stop doing anything. I kept paring away functionality from my window until it's idiot-simple, and I still can't get the sizers to DO anything. The problem does seem to be limited to this new window, but I have no idea why.

I give up. Can you see anything I've done wrong?

BotsSummaryWindow4.h

--- Code: ---#include <editorbase.h>
#include <wx/sizer.h>
#include <wx/button.h>

class BotsSummaryWindow4 : public EditorBase
{
    public:
    BotsSummaryWindow4(wxWindow * parent, wxString title);

};

--- End code ---

MAD_Debugging_support.cpp

--- Code: ---...
void MAD_Debugging_Support::OnHitSummaryWindow(wxCommandEvent& event)
{
    DoStartSummary();
}

void MAD_Debugging_Support::DoStartSummary()
{
    if (!m_summaryDisplayed)
    {
        m_summaryDisplay = new BotsSummaryWindow4((wxWindow *) Manager::Get()->GetEditorManager()->GetNotebook(), wxT("BotsDisplay"));
        m_summaryDisplayed = true;
    }
    m_summaryDisplay->SetFocus();
}
...

--- End code ---

BotsSummaryWindow4.cpp

--- Code: ---#include "BotsSummaryWindow4.h"
BotsSummaryWindow4::BotsSummaryWindow4(wxWindow * parent, wxString title) : EditorBase(parent, title)
{
    wxBoxSizer *        buttonsSizer = new wxBoxSizer(wxHORIZONTAL);
    wxPanel *           helpMeObiwan = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(500, 500));
    wxButton *          west = new wxButton(helpMeObiwan, wxID_ANY, _T("west"), wxPoint(100, 100));
    wxButton *          east = new wxButton(helpMeObiwan, wxID_ANY, _T("east"), wxPoint(110, 110));

    buttonsSizer->Add(west, TRUE, wxEXPAND | wxALL, 1);
    buttonsSizer->Add(east, TRUE, wxEXPAND | wxALL, 1);
    helpMeObiwan->SetSizer(buttonsSizer);
}
--- End code ---
how it looks


This is identical to how it appears if I don't use sizers at all.

-----

I notice also that I've been quite liberal asking for help around here recently. It is appreciated. :)

oBFusCATed:
You're not using wxsmith, so your question is better asked in the wx forums/mailing list.

MadBoat:
Yep. Got some useful advice over there. Here's the thread, which has a code sample.

https://forums.wxwidgets.org/viewtopic.php?f=1&t=41364

Needed to call Fit() manually... don't know why I got away with that before, but it works now... good enough.

Jason

Navigation

[0] Message Index

Go to full version