Igor Korot
unread,Sep 26, 2012, 2:45:03 AM9/26/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to wx-u...@googlegroups.com
Hi, ALL,
I have a wxPanel-derived class whose constructor looks like this:
m_label = new wxStaticText( this, wxID_ANY, "Please enter owner names." );
m_scrolled = new wxScrolledWindow( this );
m_label->SetFont( m_label->GetFont().Bold() );
wxSizer *mainSizer = new wxBoxSizer( wxHORIZONTAL );
wxSizer *secondSizer = new wxBoxSizer( wxVERTICAL );
wxSizer *controls = new wxBoxSizer( wxVERTICAL );
wxSizer *editors = new wxBoxSizer( wxVERTICAL );
mainSizer->Add( 5, 5, 0, wxEXPAND, 0 );
secondSizer->Add( 5, 5, 0, wxEXPAND, 0 );
controls->Add( m_label, 0, wxEXPAND, 0 );
controls->Add( 5, 5, 0, wxEXPAND, 0 );
m_owners = new wxTextCtrl[owners];
for( int i = 0; i < owners; i++ )
{
m_owners[i].Create( m_scrolled, wxID_ANY );
editors->Add( &m_owners[i], 0, wxEXPAND, 0 );
editors->Add( 5, 20, wxEXPAND, 0 );
}
m_scrolled->SetSizer( editors );
m_scrolled->FitInside();
m_scrolled->SetScrollRate( 5, 5 );
controls->Add( m_scrolled, 1, wxEXPAND, 0 );
secondSizer->Add( controls, 0, wxEXPAND, 0 );
secondSizer->Add( 5, 5, 0, wxEXPAND, 0 );
mainSizer->Add( secondSizer, 0, wxEXPAND, 0 );
mainSizer->Add( 5, 5, 0, wxEXPAND, 0 );
SetSizerAndFit( mainSizer );
However with this code all I see is very small scrolled window which
is sized around the
text control.
What I want to see is scrolled window that is stretched on the whole
area of the panel.
Screenshot of running the code attached.
What am I doing wrong?
Thank you.