An error occurs when the grid has a lot of data, that is, it has a vertical scroll.
When it is maximized and then minimized, the grid expands, occupying the entire screen and losing half of the graphic interface
edit: I'm using Windows 10
Situation 1 : Maximixe
Start:
Then Maximixe: Observe how half of the screen disappears showing only the expanded grid
Situation 2: Minimize
Start:
Then Minimize:
Any suggestions where to start reviewing?
Regards
Error wxGrid + Maximize/Minimize
Error wxGrid + Maximize/Minimize
Last edited by tomicolon on Sat May 19, 2018 2:17 pm, edited 1 time in total.
Re: Error wxGrid + Maximize/Minimize
Hi,
Could you please show some code?
How the grid was created and how the sizer layout is done.
Thank you.
Could you please show some code?
How the grid was created and how the sizer layout is done.
Thank you.
Re: Error wxGrid + Maximize/Minimize
To develop the work I use the wxFormBuilder tool, I'll copy what the program generates
Here is the code for the sizer of the grid located above, if you need more precise information, please let me know
Here is the code for the sizer of the grid located above, if you need more precise information, please let me know
Code: Select all
this->SetSizeHints( wxDefaultSize, wxSize( -1,-1 ) );
this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
wxBoxSizer* bSizer140;
bSizer140 = new wxBoxSizer( wxVERTICAL );
panel_facturacionCompra = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_panelDetalles = new wxPanel( panel_facturacionCompra, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL );
wxBoxSizer* bSizer1481;
bSizer1481 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer183;
bSizer183 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer112;
bSizer112 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer115;
bSizer115 = new wxBoxSizer( wxHORIZONTAL );
wxBoxSizer* bSizer133;
bSizer133 = new wxBoxSizer( wxVERTICAL );
m_button44 = new wxButton( m_panelDetalles, wxID_ANY, wxT("Agregar\nal detalle\n"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer133->Add( m_button44, 1, wxALL, 5 );
bSizer115->Add( bSizer133, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer194;
bSizer194 = new wxBoxSizer( wxVERTICAL );
grilla_p = new wxGrid( m_panelDetalles, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTRANSPARENT_WINDOW );
grilla_p->CreateGrid( 0, 5 );
grilla_p->EnableEditing( false );
grilla_p->EnableGridLines( true );
grilla_p->EnableDragGridSize( false );
grilla_p->SetMargins( 0, 0 );
// Columns
grilla_p->SetColSize( 0, 39 );
grilla_p->SetColSize( 1, 138 );
grilla_p->SetColSize( 2, 223 );
grilla_p->SetColSize( 3, 134 );
grilla_p->SetColSize( 4, 130 );
grilla_p->EnableDragColMove( false );
grilla_p->EnableDragColSize( true );
grilla_p->SetColLabelSize( 30 );
grilla_p->SetColLabelValue( 0, wxT("ID") );
grilla_p->SetColLabelValue( 1, wxT("Codigo de barra") );
grilla_p->SetColLabelValue( 2, wxT("Nombre") );
grilla_p->SetColLabelValue( 3, wxT("Tipo") );
grilla_p->SetColLabelValue( 4, wxT("Marca") );
grilla_p->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
grilla_p->EnableDragRowSize( true );
grilla_p->SetRowLabelSize( 1 );
grilla_p->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
grilla_p->SetLabelBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_MENU ) );
grilla_p->SetLabelFont( wxFont( 9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Tahoma") ) );
// Cell Defaults
grilla_p->SetDefaultCellFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
grilla_p->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
bSizer194->Add( grilla_p, 1, wxEXPAND, 5 );
bSizer115->Add( bSizer194, 1, wxEXPAND, 5 );
bSizer183->Add( bSizer115, 1, wxEXPAND, 5 );
Re: Error wxGrid + Maximize/Minimize
The (auto generated) sizer code is a little hard to follow.
What happens in you resize the window manually, is the layout correct then?
Try catching the wxMaximizeEvent and wxIconizeEvent, call Layout() inside the event handler and check if it fixes the issue.
What happens in you resize the window manually, is the layout correct then?
Try catching the wxMaximizeEvent and wxIconizeEvent, call Layout() inside the event handler and check if it fixes the issue.
Use the source, Luke!
Re: Error wxGrid + Maximize/Minimize
doublemax wrote:The (auto generated) sizer code is a little hard to follow.
What happens in you resize the window manually, is the layout correct then?
Try catching the wxMaximizeEvent and wxIconizeEvent, call Layout() inside the event handler and check if it fixes the issue.
I do not know if I'm not understanding you, but the only event I can capture by clicking on the maximize box is wxSizeEvent.
I did not say it, but it's a dialog not a frame.
void cVAgregar_FactCompra::OnMaximize( wxSizeEvent& event ) {
Layout();
wxMessageBox("Layout() , On Maximize/Minimize");
}
Even if I do not do the sizer with the EXPAND property, observe how after maximizing and minimizing, it occupies the entire window
Re: Error wxGrid + Maximize/Minimize
Another observation, if the top table is filled with fewer items, it shows me only a portion of the second sizer
In this image there is more data loaded in the grid, and you can see that the second grid is not seen, but you can see the sizer of the total amount
In this image there is more data loaded in the grid, and you can see that the second grid is not seen, but you can see the sizer of the total amount
Re: Error wxGrid + Maximize/Minimize
Under Windows you should also get a wxMaximizeEvent and wxIconizeEvent.I do not know if I'm not understanding you, but the only event I can capture by clicking on the maximize box is wxSizeEvent.
http://docs.wxwidgets.org/trunk/classwx ... event.html
http://docs.wxwidgets.org/trunk/classwx ... event.html
Use the source, Luke!