From: Milan Babuskov on 1 Jun 2009 09:59 Vadim Zeitlin wrote: > MB> I just tested, and that is not the real problem. The reported size is > MB> correct. Problem is the horizontal scrollbar. Apparently, the decision > MB> whether to show horizontal scrollbar or not is made before the Size > MB> event, so any changes you make to grid column widths are not accounted. > MB> > MB> Any ideas how to work around that? > > You can use SendSizeEvent() to force a relayout but this is a dirty > solution and it would be better to avoid it. To be honest I don't really > understand where does the problem come from: if you process the size event > before wxGrid (don't you?) I sure hope so. I did Connect for size event. The grid I'm using has a single column which I resize dynamically. This is the whole code: wxGrid *propGrid; .... propGrid->Connect( wxEVT_SIZE, wxSizeEventHandler(MainFrame::OnGridSize), NULL, this); //----------------------------------------------------------------------------- void MainFrame::OnGridSize(wxSizeEvent& event) { resizeGrid(propGrid, event.GetSize()); } //----------------------------------------------------------------------------- void resizeGrid(wxGrid *grid, const wxSize& size) { grid->SetRowLabelSize(50); int wc = size.GetWidth()-50-grid->GetScrollThumb(wxVERTICAL)-2; grid->SetColSize(0, wc); } //----------------------------------------------------------------------------- Please note that this issue does not happen on each resize, but only about 60-70% of the time. Sometimes it does not show the horizontal scrollbar. > If anybody wants to debug this it would be interesting to check how do you > get into the "need scrolling" branch of wxScrollHelper::DoAdjustScrollbar(). I'm not sure I understood this. Could you tell me how to modify the above code to try that? Thanks, -- Milan Babuskov http://www.flamerobin.org http://www.guacosoft.com
|
Pages: 1 Prev: Icon issue in 2.9.0 Next: Re[2]: Problems with building wxPropertyGrid |