Scrollbar appears in the panel but doesn't work Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 03, 2020 10:29 am

I would like to add a scrollbar to one of my panels (I'm using

Code: Select all

wxSimplebook 
to add panels to my main frame).

The problem is that the vertical and horizontal scrollbars appear, but nothing happens when I scroll them (they move, but the content inside the frame doesn't change).

This is my code:

Code: Select all

// secondpanel.cpp
Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL, _T("wxID_ANY"));
	BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
//... code for other controls.. //

ScrolledWindow1 = new wxScrolledWindow(this, ID_SCROLLEDWINDOW1, wxDefaultPosition, wxDefaultSize, 0, _T("ID_SCROLLEDWINDOW1"));
	ScrolledWindow1->SetVirtualSize(wxSize(2000,1100));
	ScrolledWindow1->SetScrollRate(1, 1);
	BoxSizer1->Add(ScrolledWindow1, 1, wxALL, 5);
	SetSizer(BoxSizer1);
	BoxSizer1->Fit(this);
	BoxSizer1->SetSizeHints(this);

//main frame:
   Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id"));
    SetClientSize(wxSize(1024,768));
    MenuBar1 = new wxMenuBar();
//... other controls.. //
second = new secondpanel(notebook, this, wxID_ANY);
This is how the problem looks:

Image
Attachments
wx_scrollbars.jpg

Wanderer82
Earned some good credits
Earned some good credits
Posts: 144
Joined: Tue Jul 26, 2016 2:00 pm

Re: Scrollbar appears in the panel but doesn't work

Post by Wanderer82 » Sun May 03, 2020 11:27 am

Hm, I did such a thing.

My "Create"-function looks like this:

Code: Select all

Create(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"))
And then:

Code: Select all

ScrolledWindow1 = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL );
    ScrolledWindow1->SetMaxSize(wxSize(100,200));
    ScrolledWindow1->SetScrollRate(15, 15);
    (...)
    ScrolledWindow1->SetSizer(BoxSizer5);
    BoxSizer5->Fit(ScrolledWindow1);
    BoxSizer5->SetSizeHints(ScrolledWindow1);
    BoxSizer1->Add(ScrolledWindow1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
    
Don't know if this helps. I didn't put wxHSCROLL|wcVSCROLL into the "Create"-function but in the ScrolledWindow1.

Thomas
Last edited by Wanderer82 on Sun May 03, 2020 11:36 am, edited 1 time in total.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
Joined: Sun Jan 03, 2010 5:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by PB » Sun May 03, 2020 11:35 am

Did you create the controls with wxScrolledWindow as the parent?

FWIW, I tried wxScrolledWindow as a page of wxSimpleBook, works as expected (WIn10, wxWidgets master):
simplebook-and-scrolled.png
simplebook-and-scrolled.png (19.97 KiB) Viewed 234 times

Code: Select all

#include <wx/wx.h>
#include <wx/scrolwin.h>
#include <wx/simplebook.h>

class MyFrame : public wxFrame
{
public:
    MyFrame () : wxFrame(nullptr, wxID_ANY, "Test", wxDefaultPosition, wxSize(800, 600))
    {
        wxPanel* mainPanel = new wxPanel(this);
        wxBoxSizer* mainPanelSizer = new wxBoxSizer(wxVERTICAL);
        wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
        wxButton* button = nullptr;
        
        button = new wxButton(mainPanel, wxID_ANY, "Previous page");
        button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { m_book->AdvanceSelection(false); });
        buttonSizer->Add(button, wxSizerFlags().Proportion(1).Expand().DoubleBorder());
        button = new wxButton(mainPanel, wxID_ANY, "Next page");
        button->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { m_book->AdvanceSelection(true); });
        buttonSizer->Add(button, wxSizerFlags().Proportion(1).Expand().DoubleBorder());
        mainPanelSizer->Add(buttonSizer, wxSizerFlags().Border());

        m_book = new wxSimplebook(mainPanel);                
        AddPage("Page 1");  AddPage("Page 2");  AddPage("Page 3");
        mainPanelSizer->Add(m_book, wxSizerFlags().Proportion(4).Expand().Border());
        
        wxTextCtrl* m_logCtrl = new wxTextCtrl(mainPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,
            wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2);
        wxLog::SetActiveTarget(new wxLogTextCtrl(m_logCtrl));
        mainPanelSizer->Add(m_logCtrl, wxSizerFlags().Proportion(1).Expand().DoubleBorder());

        mainPanel->SetSizer(mainPanelSizer);
    }   
private:
    wxSimplebook* m_book;

    void AddPage(const wxString& pageName)
    {
        wxScrolledWindow* page = new wxScrolledWindow(m_book);
        wxGridSizer* pageSizer = new wxGridSizer(8);

        for ( size_t i = 0; i < 100; ++i )
        {
            pageSizer->Add(new wxStaticText(page, wxID_ANY, wxString::Format("%s: Static text #%zu", pageName, i + 1)),
                wxSizerFlags().Border());
        }
        page->SetSizer(pageSizer);
        page->FitInside();
        page->SetScrollRate(FromDIP(24), FromDIP(24)); 

        m_book->AddPage(page, pageName);
    }
}; 

class MyApp : public wxApp
{
public:
    bool OnInit() override
    {
        (new MyFrame())->Show();
        return true;
    }
}; wxIMPLEMENT_APP(MyApp);

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 03, 2020 11:45 am

I'm going to modify my code to reflect your suggestions and I will come back soon.

do you think I have to add the scrollbars to each panel or only to the panel where I need it?

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
Joined: Sun Jan 03, 2010 5:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by PB » Sun May 03, 2020 11:58 am

Do not use use wxVSCROLL and wxHSCROLL with a wxPanel, use them with wxScrolledWindow only. I would use both styles unless I would want the window to be scrollable in one direction only (risking its content to be cut-off in the other direction).

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 03, 2020 2:00 pm

It isn't working and, to be honest, now the scrollbars didn't appear anymore in the panel.

May be the problem is related to the wxpanel implementation.

main app file:

Code: Select all

bool PumpApp::OnInit()
{

    bool wxsOK = true;
    wxInitAllImageHandlers();
    if ( wxsOK )
    {
    	PumpFrame* Frame = new PumpFrame(0);
    	pointer = Frame;
    	Frame->ShowFullScreen(true, wxFULL_REPAINT_ON_RESIZE);
    	Frame->SetMinClientSize(wxSize(1920, 1080));
    	SetTopWindow(Frame);

    }

    return wxsOK;

}
mainframe.cpp

Code: Select all

PumpFrame::PumpFrame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(PumpFrame)
    wxMenu* Menu1;
    wxMenu* Menu2;
    wxMenuBar* MenuBar1;
    wxMenuItem* MenuItem1;
    wxMenuItem* MenuItem2;

    Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxALWAYS_SHOW_SB, _T("id"));
    SetClientSize(wxSize(1024,768));
    MenuBar1 = new wxMenuBar();
    Menu1 = new wxMenu();
    MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Quit\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
    Menu1->Append(MenuItem1);
    MenuBar1->Append(Menu1, _("&File"));
    Menu2 = new wxMenu();
    MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("About\tF1"), _("Show info about this application"), wxITEM_NORMAL);
    Menu2->Append(MenuItem2);
    MenuBar1->Append(Menu2, _("Help"));
    SetMenuBar(MenuBar1);
    StatusBar1 = new wxStatusBar(this, ID_STATUSBAR1, 0, _T("ID_STATUSBAR1"));
    int __wxStatusBarWidths_1[1] = { -1 };
    int __wxStatusBarStyles_1[1] = { wxSB_NORMAL };
    StatusBar1->SetFieldsCount(1,__wxStatusBarWidths_1);
    StatusBar1->SetStatusStyles(1,__wxStatusBarStyles_1);
    SetStatusBar(StatusBar1);
    Center();

    Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&PumpFrame::OnQuit);
    Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&PumpFrame::OnAbout);
    Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&PumpFrame::OnClose);
    //*)

    notebook = new wxSimplebook(this, wxID_ANY);
    first = new firstpanel(notebook, this, wxID_ANY);
    notebook->AddPage(first, L"first panel");
    second = new secondpanel(notebook, this, wxID_ANY);
    notebook->AddPage(second, L"second panel");
and this is the secondpanel.cpp code (I reported all the code here, sorry for its length, the scrollbar code is at the end):

Code: Select all

secondpanel::secondpanel(wxWindow* parent, PumpFrame *mainFrame, wxWindowID id,const wxPoint& pos,const wxSize& size)
{
    pointer = mainFrame;

	//(*Initialize(secondpanel)
	wxBoxSizer* BoxSizer10;
	wxBoxSizer* BoxSizer11;
	wxBoxSizer* BoxSizer12;
	wxBoxSizer* BoxSizer13;
	wxBoxSizer* BoxSizer14;
	wxBoxSizer* BoxSizer15;
	wxBoxSizer* BoxSizer16;
	wxBoxSizer* BoxSizer17;
	wxBoxSizer* BoxSizer18;
	wxBoxSizer* BoxSizer19;
	wxBoxSizer* BoxSizer1;
	wxBoxSizer* BoxSizer20;
	wxBoxSizer* BoxSizer21;
	wxBoxSizer* BoxSizer22;
	wxBoxSizer* BoxSizer23;
	wxBoxSizer* BoxSizer24;
	wxBoxSizer* BoxSizer25;
	wxBoxSizer* BoxSizer26;
	wxBoxSizer* BoxSizer27;
	wxBoxSizer* BoxSizer28;
	wxBoxSizer* BoxSizer29;
	wxBoxSizer* BoxSizer2;
	wxBoxSizer* BoxSizer30;
	wxBoxSizer* BoxSizer31;
	wxBoxSizer* BoxSizer32;
	wxBoxSizer* BoxSizer33;
	wxBoxSizer* BoxSizer34;
	wxBoxSizer* BoxSizer3;
	wxBoxSizer* BoxSizer4;
	wxBoxSizer* BoxSizer5;
	wxBoxSizer* BoxSizer6;
	wxBoxSizer* BoxSizer7;
	wxBoxSizer* BoxSizer8;
	wxBoxSizer* BoxSizer9;
	wxBoxSizer* Gambe;
	wxBoxSizer* femorali;
	wxBoxSizer* quadricipiti;

	Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxALWAYS_SHOW_SB|wxFULL_REPAINT_ON_RESIZE, _T("wxID_ANY"));
	BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
	BoxSizer2 = new wxBoxSizer(wxVERTICAL);
	BoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
	Button1 = new wxButton(this, ID_BUTTON3, _("SCHEDA A"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
	Button1->SetBackgroundColour(wxColour(0,217,0));
	wxFont Button1Font(14,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
	Button1->SetFont(Button1Font);
	BoxSizer3->Add(Button1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer3, 1, wxALL|wxEXPAND, 5);
	BoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
	Choice6 = new wxChoice(this, ID_CHOICE6, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE6"));
	Choice6->SetSelection( Choice6->Append(_("---")) );
	Choice6->Append(_("GRUPPO MUSCOLARE"));
	BoxSizer4->Add(Choice6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer4, 1, wxALL|wxEXPAND, 5);
	BoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
	Choice1 = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
	wxFont Choice1Font(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
	Choice1->SetFont(Choice1Font);
	BoxSizer5->Add(Choice1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl3 = new wxTextCtrl(this, ID_TEXTCTRL3, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
	BoxSizer5->Add(TextCtrl3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl4 = new wxTextCtrl(this, ID_TEXTCTRL4, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL4"));
	BoxSizer5->Add(TextCtrl4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer5, 1, wxALL|wxEXPAND, 5);
	BoxSizer14 = new wxBoxSizer(wxHORIZONTAL);
	Choice2 = new wxChoice(this, ID_CHOICE2, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE2"));
	Choice2->Append(_("GRUPPO MUSCOLARE"));
	Choice2->SetMaxSize(wxSize(-1,-1));
	wxFont Choice2Font(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
	Choice2->SetFont(Choice2Font);
	BoxSizer14->Add(Choice2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
	BoxSizer14->Add(TextCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl2 = new wxTextCtrl(this, ID_TEXTCTRL2, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL2"));
	BoxSizer14->Add(TextCtrl2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer14, 1, wxALL|wxEXPAND, 5);
	Gambe = new wxBoxSizer(wxHORIZONTAL);
	gambe_option = new wxChoice(this, ID_CHOICE7, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE7"));
	gambe_option->SetSelection( gambe_option->Append(_("---")) );
	gambe_option->Append(_("GAMBE"));
	Gambe->Add(gambe_option, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(Gambe, 1, wxALL|wxEXPAND, 5);
	quadricipiti = new wxBoxSizer(wxHORIZONTAL);
	quadricipiti_option = new wxChoice(this, ID_CHOICE8, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE8"));
	quadricipiti->Add(quadricipiti_option, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(quadricipiti, 1, wxALL|wxEXPAND, 5);
	femorali = new wxBoxSizer(wxHORIZONTAL);
	Choice9 = new wxChoice(this, ID_CHOICE9, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE9"));
	femorali->Add(Choice9, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl15 = new wxTextCtrl(this, ID_TEXTCTRL15, _("Prova"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL15"));
	femorali->Add(TextCtrl15, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl16 = new wxTextCtrl(this, ID_TEXTCTRL16, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL16"));
	femorali->Add(TextCtrl16, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(femorali, 1, wxALL|wxEXPAND, 5);
	BoxSizer15 = new wxBoxSizer(wxHORIZONTAL);
	Choice7 = new wxChoice(this, ID_CHOICE10, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE10"));
	BoxSizer15->Add(Choice7, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl13 = new wxTextCtrl(this, ID_TEXTCTRL13, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL13"));
	BoxSizer15->Add(TextCtrl13, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl14 = new wxTextCtrl(this, ID_TEXTCTRL14, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL14"));
	BoxSizer15->Add(TextCtrl14, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer15, 1, wxALL|wxEXPAND, 5);
	BoxSizer16 = new wxBoxSizer(wxHORIZONTAL);
	Choice8 = new wxChoice(this, ID_CHOICE11, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE11"));
	BoxSizer16->Add(Choice8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl17 = new wxTextCtrl(this, ID_TEXTCTRL17, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL17"));
	BoxSizer16->Add(TextCtrl17, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl18 = new wxTextCtrl(this, ID_TEXTCTRL18, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL18"));
	BoxSizer16->Add(TextCtrl18, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer16, 1, wxALL|wxEXPAND, 5);
	BoxSizer17 = new wxBoxSizer(wxHORIZONTAL);
	Choice10 = new wxChoice(this, ID_CHOICE12, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE12"));
	BoxSizer17->Add(Choice10, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer17, 1, wxALL|wxEXPAND, 5);
	BoxSizer18 = new wxBoxSizer(wxHORIZONTAL);
	Choice13 = new wxChoice(this, ID_CHOICE15, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE15"));
	BoxSizer18->Add(Choice13, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl23 = new wxTextCtrl(this, ID_TEXTCTRL23, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL23"));
	BoxSizer18->Add(TextCtrl23, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl24 = new wxTextCtrl(this, ID_TEXTCTRL24, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL24"));
	BoxSizer18->Add(TextCtrl24, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer18, 1, wxALL|wxEXPAND, 5);
	BoxSizer19 = new wxBoxSizer(wxHORIZONTAL);
	Choice11 = new wxChoice(this, ID_CHOICE13, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE13"));
	BoxSizer19->Add(Choice11, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl19 = new wxTextCtrl(this, ID_TEXTCTRL19, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL19"));
	BoxSizer19->Add(TextCtrl19, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl20 = new wxTextCtrl(this, ID_TEXTCTRL20, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL20"));
	BoxSizer19->Add(TextCtrl20, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer19, 1, wxALL|wxEXPAND, 5);
	BoxSizer20 = new wxBoxSizer(wxHORIZONTAL);
	Choice12 = new wxChoice(this, ID_CHOICE14, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE14"));
	BoxSizer20->Add(Choice12, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl21 = new wxTextCtrl(this, ID_TEXTCTRL21, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL21"));
	BoxSizer20->Add(TextCtrl21, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl22 = new wxTextCtrl(this, ID_TEXTCTRL22, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL22"));
	BoxSizer20->Add(TextCtrl22, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer20, 1, wxALL|wxEXPAND, 5);
	BoxSizer21 = new wxBoxSizer(wxHORIZONTAL);
	Choice14 = new wxChoice(this, ID_CHOICE16, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE16"));
	BoxSizer21->Add(Choice14, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl25 = new wxTextCtrl(this, ID_TEXTCTRL25, _("controllo"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL25"));
	BoxSizer21->Add(TextCtrl25, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl26 = new wxTextCtrl(this, ID_TEXTCTRL26, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL26"));
	BoxSizer21->Add(TextCtrl26, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer21, 1, wxALL|wxEXPAND, 5);
	BoxSizer22 = new wxBoxSizer(wxHORIZONTAL);
	Choice15 = new wxChoice(this, ID_CHOICE17, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE17"));
	BoxSizer22->Add(Choice15, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer22, 1, wxALL|wxEXPAND, 5);
	BoxSizer23 = new wxBoxSizer(wxHORIZONTAL);
	Choice16 = new wxChoice(this, ID_CHOICE18, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE18"));
	BoxSizer23->Add(Choice16, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl27 = new wxTextCtrl(this, ID_TEXTCTRL27, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL27"));
	BoxSizer23->Add(TextCtrl27, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl28 = new wxTextCtrl(this, ID_TEXTCTRL28, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL28"));
	BoxSizer23->Add(TextCtrl28, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer23, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer24 = new wxBoxSizer(wxHORIZONTAL);
	Choice17 = new wxChoice(this, ID_CHOICE19, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE19"));
	BoxSizer24->Add(Choice17, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl29 = new wxTextCtrl(this, ID_TEXTCTRL29, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL29"));
	BoxSizer24->Add(TextCtrl29, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl30 = new wxTextCtrl(this, ID_TEXTCTRL30, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL30"));
	BoxSizer24->Add(TextCtrl30, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer24, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer25 = new wxBoxSizer(wxHORIZONTAL);
	Choice18 = new wxChoice(this, ID_CHOICE20, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE20"));
	BoxSizer25->Add(Choice18, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl31 = new wxTextCtrl(this, ID_TEXTCTRL31, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL31"));
	BoxSizer25->Add(TextCtrl31, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl32 = new wxTextCtrl(this, ID_TEXTCTRL32, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL32"));
	BoxSizer25->Add(TextCtrl32, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer25, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer26 = new wxBoxSizer(wxHORIZONTAL);
	Choice19 = new wxChoice(this, ID_CHOICE21, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE21"));
	BoxSizer26->Add(Choice19, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl33 = new wxTextCtrl(this, ID_TEXTCTRL33, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL33"));
	BoxSizer26->Add(TextCtrl33, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl34 = new wxTextCtrl(this, ID_TEXTCTRL34, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL34"));
	BoxSizer26->Add(TextCtrl34, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer26, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer27 = new wxBoxSizer(wxHORIZONTAL);
	Choice20 = new wxChoice(this, ID_CHOICE22, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE22"));
	BoxSizer27->Add(Choice20, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer27, 1, wxALL|wxEXPAND, 5);
	BoxSizer28 = new wxBoxSizer(wxHORIZONTAL);
	Choice21 = new wxChoice(this, ID_CHOICE23, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE23"));
	BoxSizer28->Add(Choice21, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl35 = new wxTextCtrl(this, ID_TEXTCTRL35, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL35"));
	BoxSizer28->Add(TextCtrl35, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl36 = new wxTextCtrl(this, ID_TEXTCTRL36, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL36"));
	BoxSizer28->Add(TextCtrl36, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer28, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer29 = new wxBoxSizer(wxHORIZONTAL);
	Choice22 = new wxChoice(this, ID_CHOICE24, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE24"));
	BoxSizer29->Add(Choice22, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl37 = new wxTextCtrl(this, ID_TEXTCTRL37, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL37"));
	BoxSizer29->Add(TextCtrl37, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl38 = new wxTextCtrl(this, ID_TEXTCTRL38, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL38"));
	BoxSizer29->Add(TextCtrl38, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer29, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer30 = new wxBoxSizer(wxHORIZONTAL);
	Choice23 = new wxChoice(this, ID_CHOICE25, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE25"));
	BoxSizer30->Add(Choice23, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl39 = new wxTextCtrl(this, ID_TEXTCTRL39, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL39"));
	BoxSizer30->Add(TextCtrl39, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl40 = new wxTextCtrl(this, ID_TEXTCTRL40, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL40"));
	BoxSizer30->Add(TextCtrl40, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer30, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer31 = new wxBoxSizer(wxHORIZONTAL);
	Choice24 = new wxChoice(this, ID_CHOICE26, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE26"));
	BoxSizer31->Add(Choice24, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl41 = new wxTextCtrl(this, ID_TEXTCTRL41, _("fine control"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL41"));
	BoxSizer31->Add(TextCtrl41, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl42 = new wxTextCtrl(this, ID_TEXTCTRL42, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL42"));
	BoxSizer31->Add(TextCtrl42, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer31, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer32 = new wxBoxSizer(wxHORIZONTAL);
	Choice25 = new wxChoice(this, ID_CHOICE27, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE27"));
	BoxSizer32->Add(Choice25, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer32, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer33 = new wxBoxSizer(wxHORIZONTAL);
	Choice26 = new wxChoice(this, ID_CHOICE28, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE28"));
	BoxSizer33->Add(Choice26, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl43 = new wxTextCtrl(this, ID_TEXTCTRL43, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL43"));
	BoxSizer33->Add(TextCtrl43, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl44 = new wxTextCtrl(this, ID_TEXTCTRL44, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL44"));
	BoxSizer33->Add(TextCtrl44, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer33, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer34 = new wxBoxSizer(wxHORIZONTAL);
	Choice27 = new wxChoice(this, ID_CHOICE29, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE29"));
	BoxSizer34->Add(Choice27, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl45 = new wxTextCtrl(this, ID_TEXTCTRL45, _("fine controllo"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL45"));
	BoxSizer34->Add(TextCtrl45, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl46 = new wxTextCtrl(this, ID_TEXTCTRL46, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL46"));
	BoxSizer34->Add(TextCtrl46, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer2->Add(BoxSizer34, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer1->Add(BoxSizer2, 1, wxALL, 5);
	BoxSizer6 = new wxBoxSizer(wxVERTICAL);
	BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
	Button2 = new wxButton(this, ID_BUTTON1, _("Label"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
	wxFont Button2Font(14,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
	Button2->SetFont(Button2Font);
	BoxSizer7->Add(Button2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer6->Add(BoxSizer7, 1, wxALL|wxEXPAND, 5);
	BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
	Choice3 = new wxChoice(this, ID_CHOICE3, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE3"));
	Choice3->Append(_("GRUPPO MUSCOLARE"));
	wxFont Choice3Font(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
	Choice3->SetFont(Choice3Font);
	BoxSizer8->Add(Choice3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl5 = new wxTextCtrl(this, ID_TEXTCTRL5, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL5"));
	BoxSizer8->Add(TextCtrl5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl6 = new wxTextCtrl(this, ID_TEXTCTRL6, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL6"));
	BoxSizer8->Add(TextCtrl6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer6->Add(BoxSizer8, 1, wxALL|wxEXPAND, 5);
	BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
	Choice4 = new wxChoice(this, ID_CHOICE4, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE4"));
	BoxSizer9->Add(Choice4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl7 = new wxTextCtrl(this, ID_TEXTCTRL7, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL7"));
	BoxSizer9->Add(TextCtrl7, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl8 = new wxTextCtrl(this, ID_TEXTCTRL8, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL8"));
	BoxSizer9->Add(TextCtrl8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer6->Add(BoxSizer9, 1, wxALL|wxEXPAND, 5);
	BoxSizer1->Add(BoxSizer6, 1, wxALL, 5);
	BoxSizer10 = new wxBoxSizer(wxVERTICAL);
	BoxSizer11 = new wxBoxSizer(wxHORIZONTAL);
	Button3 = new wxButton(this, ID_BUTTON2, _("Label"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
	wxFont Button3Font(14,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT);
	Button3->SetFont(Button3Font);
	BoxSizer11->Add(Button3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer10->Add(BoxSizer11, 1, wxALL|wxEXPAND, 5);
	BoxSizer12 = new wxBoxSizer(wxHORIZONTAL);
	Choice5 = new wxChoice(this, ID_CHOICE5, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE5"));
	BoxSizer12->Add(Choice5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl9 = new wxTextCtrl(this, ID_TEXTCTRL9, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL9"));
	BoxSizer12->Add(TextCtrl9, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl10 = new wxTextCtrl(this, ID_TEXTCTRL10, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL10"));
	BoxSizer12->Add(TextCtrl10, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer10->Add(BoxSizer12, 1, wxALL|wxEXPAND, 5);
	BoxSizer13 = new wxBoxSizer(wxHORIZONTAL);
	Button4 = new wxButton(this, ID_BUTTON4, _("Label"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
	BoxSizer13->Add(Button4, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl11 = new wxTextCtrl(this, ID_TEXTCTRL11, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL11"));
	BoxSizer13->Add(TextCtrl11, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	TextCtrl12 = new wxTextCtrl(this, ID_TEXTCTRL12, _("Text"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_TEXTCTRL12"));
	BoxSizer13->Add(TextCtrl12, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	BoxSizer10->Add(BoxSizer13, 1, wxALL|wxEXPAND, 5);
	BoxSizer1->Add(BoxSizer10, 1, wxALL, 5);
	
	
	ScrolledWindow1 = new wxScrolledWindow(this, ID_SCROLLEDWINDOW1, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL, _T("ID_SCROLLEDWINDOW1"));
	ScrolledWindow1->SetMaxSize(wxSize(100,200));
      ScrolledWindow1->SetScrollRate(15, 15);
      ScrolledWindow1->SetSizer(BoxSizer1);
      BoxSizer1->Fit(ScrolledWindow1);
      BoxSizer1->SetSizeHints(ScrolledWindow1);
      BoxSizer1->Add(ScrolledWindow1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
    

   //BoxSizer1->Add(ScrolledWindow1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	SetSizer(BoxSizer1);
	BoxSizer1->Fit(this);
	BoxSizer1->SetSizeHints(this);

	Connect(ID_CHOICE6,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&secondpanel::OnChoice6Select);
	Connect(ID_TEXTCTRL3,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&secondpanel::OnTextCtrl3Text);
	Connect(ID_CHOICE7,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&secondpanel::OnChoice7Select);
	Connect(ID_TEXTCTRL15,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&secondpanel::OnTextCtrl15Text);
	Connect(ID_TEXTCTRL25,wxEVT_COMMAND_TEXT_UPDATED,(wxObjectEventFunction)&secondpanel::OnTextCtrl25Text);
	//*)
}

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
Joined: Sun Jan 03, 2010 5:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by PB » Sun May 03, 2020 2:49 pm

Sorry, the code you posted is way too long, irrelevant and basically unreadable. I.e., the exact opposite of an SSCE.

Anyway, I just skimmed to the last few lines of secondpanel ctor. I do not understand what you expect the code to do. As I wrote before and shown in the code, if you want to use wxScrolledWindow, you need to create the controls that you want to be placed in its scrollable area as its children. Yet, in the code you posted you just create ScrolledWindow1, add it to a sizer and that's it?

If you want the whole content of the secondpanel to scroll, do not derive secondpanel from wxPanel but from wxScrolledWindow and modify the code accordingly. I believe this was sufficiently demonstrated in the code I posted above.

If you want only a portion of secondpanel to scroll, you still need to create the controls to be scrolled as children of wxScrolledWindow and not secondpanel (i.e., a wxPanel). A simple example of an window where only its part is scrollable can be seen e.g. here: viewtopic.php?t=44435#p183153

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 03, 2020 4:01 pm

I add each page by using the standard AddPage function from wxBookCtrlBase in this way:

Code: Select all

    notebook = new wxSimplebook(this, wxID_ANY);
    first = new firstpanel(notebook, this, wxID_ANY);
    notebook->AddPage(first, L"first panel");
    second = new secondpanel(notebook, this, wxID_ANY);
    notebook->AddPage(second, L"second panel");
and it's different from your example (I compiled your sample code and it works pretty well), however, I'm a beginner, so I can't understand how to change it.

I tried to modify it following your advice:

Code: Select all

   // PumpFrame.cpp
   //globals
   firstpanel *first;
   secondpanel *second;
   // end globals
   
    notebook = new wxSimplebook(this, wxID_ANY);
    first = new firstpanel(notebook, this, wxID_ANY);
    notebook->AddPage(first, L"first panel");

    wxScrolledWindow* page = new wxScrolledWindow(notebook);
    second = new secondpanel(page, this, wxID_ANY);
    page->SetVirtualSize(wxSize(2000,1100));
    page->FitInside();
    page->SetScrollRate(10, 10);
    notebook->AddPage(second, L"second panel");
But nothing appears on the second panel, now, even if it compiles without errors.
I think it's because the controls are not inside the scrollable area as you said, but I do not know how to add them since they are all declared in the secondpanel.cpp file.

All the controls in secondpanel.cpp are contained in BoxSizer1.

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 03, 2020 4:17 pm

I do not know if it makes any difference, but I'm using codeblocks on Windows with WxSmith.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
Joined: Sun Jan 03, 2010 5:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by PB » Sun May 03, 2020 5:58 pm

Yes, the code you posted is obviously wrong, as you just create page but do nothing with it.

I think this is wxSmith question, not wxWidgets one. I do not use wxSmith but I blindly tried to do that there and failed.

At least after working with wxSmith for a bit, I will now appreciate wxFormBuilder much more. :D

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2387
Joined: Sun Jan 03, 2010 5:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by PB » Sun May 03, 2020 7:35 pm

In the end, I could do what was needed even in Code::Blocks with wxSmith. I could not find wxSimpleBook there so I used wxNotebook, there should be no practical difference regarding the topic of this thread:
simplebook-and-scrolled-wxsmith.png
simplebook-and-scrolled-wxsmith.png (5.44 KiB) Viewed 162 times

While there may be a better way, obvious to someone familiar with wxSmith, I did just this (see also the attached project):
  1. I used wxSmith menu to add a standalone wxPanel, except that in Advanced options I changed the base class from wxPanel to wxScrolledWindow. This class is called Page1Scrolled.
  2. I modified its code accordingly, in particular adding #include <wx/scrolwin.h> to its header and few lines of code to add many controls programatically so I did not have to add so many of them by hand in wxSmith.
  3. Then I added a wxNotebook (m_book) to the main frame (scrollWinTestFrame) and added a wxPanel as its first and only page (m_page1). I also added a wxBoxSizer for m_page1 (page1Sizer).
  4. I added member variable m_page1Scrolled (of type Page1Scrolled) to scrollWinTestFrame, and added #include "Page1Scrolled.h" to the header file of the frame.
  5. Finally, I created m_page1Scrolled with m_page1 as the parent, added it to the m_page1Sizer, and called its FitInside() and SetScrollRate() methods.
Writing all this, it came to me that it could be easier in wxSmith had I just added a standalone wxPanel and then added a wxScrolledWindow as its child. The controls would be created as children of wxScrolledWindow. This wxPanel would then be a child of a notebook page.

In the attached project, the code I wrote by hand is always preceded by // Added by PB comment.
Attachments
scrollwin-test.zip
(12.6 KiB) Downloaded 9 times

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sun May 10, 2020 5:20 pm

I'm sorry PB, I didn't see your post because I didn't received the forum notification and I struggled all this week to find out how to add the scrollbar to my project.

I read your topic and I'm studying your solution in order to understand if I can adapt it to my solution.
I spent two hours so far but I still have problems.

I'm going to simplify my code and try again by following your example.
I will let you know if I'll be able to do it.

My problem is that the structure of my WX project is a little bit different from yours, so it is not easy to match the modifications (i.e. I have all the controls declared in each wxPanel file while you declared

Code: Select all

wxBoxSizer* page1Sizer;
in the scrollwin_testMain.cpp file.

marcusbarnet
Experienced Solver
Experienced Solver
Posts: 71
Joined: Sat Jul 27, 2019 3:45 pm

Re: Scrollbar appears in the panel but doesn't work

Post by marcusbarnet » Sat May 16, 2020 8:01 pm

Thank you, PB!

I studied your example and I was able to integrate your code into my project.

Now also my panels have a working scrollbar!

Post Reply