I'm sorry but I have to came back to this post
I've manage to solve some of the problems but there are others that persist.
This code is in one class that is derived. In one of the subclasses all the widgets are in a panel, but in others I need to use a splitter so the panel is the father of the splitter and the widgets are positioned in the splitter windows.
The problem apears to be in this code:
Code: Select all
void SwbPanel::CreateSplitterWidgets()
{
//spliter
if ( m_verticalSplitter )
{
m_splitter->SplitVertically( m_leftWindow, m_rightWindow, -200 );
}
else
{
m_splitter->SplitHorizontally( m_leftWindow, m_rightWindow, -200 );
}
//Botão de filtro
DoTitle();
m_leftMainSizer->Add(m_headerSizer, 0, wxALIGN_LEFT | wxLEFT | wxTOP | wxBOTTOM | wxEXPAND, 20 );
//DataView com os dados
if ( m_dataView != NULL )
{
m_dataViewSizer->Add( m_dataView, 1, wxEXPAND );
}
m_leftMainSizer->Add(m_dataViewSizer, 1, wxEXPAND);
//Detalhe da transação
if ( m_documentDetail != NULL )
{
m_rightMainSizer->Add(m_documentDetail, 1, wxEXPAND);
}
if ( m_transactionDetail != NULL )
{
m_rightMainSizer->Add(m_transactionDetail, 1, wxEXPAND);
}
SetLblNumRegistos();
m_rightWindow->SetSizer(m_rightMainSizer);
m_leftWindow->SetSizer(m_leftMainSizer);
m_mainSizer->Add( m_splitter, 1, wxEXPAND );
SetSizer(m_mainSizer);
}
void SwbPanel::DoTitle()
{
wxWindow *parent;
//Botão de filtro
if ( m_splitter )
{
parent = m_leftWindow;
}
else
{
parent = this;
}
m_btnFiltro = new wxButton(parent, ID_btn_filtros, wxT("Filtros"));
wxBitmap bmpFilter(filter32_xpm, wxBITMAP_TYPE_XPM);
m_btnFiltro->SetBitmap(bmpFilter, wxTOP);
//Titulo
m_lblNameSizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText *lbl3 = new wxStaticText(parent, wxID_ANY, m_titulo, wxDefaultPosition, wxSize (-1,-1), wxST_ELLIPSIZE_END);
wxFont font(14, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
lbl3->SetForegroundColour(*wxBLUE);
lbl3->SetFont(font);
lbl3->SetLabel(m_titulo + m_nomeEmpresa);
//Nº registos
m_lblNumRegistos = new wxStaticText(parent, wxID_ANY, wxT("Nº Registos: "));
m_lblNameSizer->Add(lbl3, 1, wxALIGN_LEFT | wxALL, 5);
m_titleSizer->Add(m_btnFiltro, 0, wxEXPAND);
m_titleSizer->Add(m_lblNameSizer, 1, wxALIGN_LEFT | wxALL, 5);
m_headerSizer->Add(m_titleSizer, 0, wxALIGN_LEFT | wxALL | wxEXPAND, 5);
m_headerSizer->Add(m_lblNumRegistos, 0, wxALIGN_LEFT | wxLEFT, 5);
}
The lbl3, m_lblNumRegistos and the m_btnFiltro are all in the same sizer so why only the button is not displayed? And why is displayed when I compile the code on Linux and not on Windows?
I've found the problem on the subclass not using splitter, but on this one it is driving me nuts!
Any help will be appreciated.
Thanks,