-void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
-{
- wxSizer *sizer = GetSizer();
-
- if ( m_showingDetails )
- {
- m_btnDetails->SetLabel(ms_details + EXPAND_SUFFIX);
-
- sizer->Detach( m_listctrl );
-
-#if wxUSE_STATLINE
- sizer->Detach( m_statline );
-#endif // wxUSE_STATLINE
-
-#if wxUSE_FILE
- sizer->Detach( m_btnSave );
-#endif // wxUSE_FILE
- }
- else // show details now
- {
- m_btnDetails->SetLabel(wxString(_T("<< ")) + ms_details);
-
- if ( !m_listctrl )
- {
- CreateDetailsControls();
- }
-
-#if wxUSE_STATLINE
- sizer->Add(m_statline, 0, wxEXPAND | (wxALL & ~wxTOP), MARGIN);
-#endif // wxUSE_STATLINE
-
- sizer->Add(m_listctrl, 1, wxEXPAND | (wxALL & ~wxTOP), MARGIN);
-
- // VZ: this doesn't work as this becomes the initial (and not only
- // minimal) listctrl height as well - why?
-#if 0
- // allow the user to make the dialog shorter than its initial height -
- // without this it wouldn't work as the list ctrl would have been
- // incompressible
- sizer->SetItemMinSize(m_listctrl, 100, 3*GetCharHeight());
-#endif // 0
-
-#if wxUSE_FILE
- sizer->Add(m_btnSave, 0, wxALIGN_RIGHT | (wxALL & ~wxTOP), MARGIN);
-#endif // wxUSE_FILE
- }
-
- m_showingDetails = !m_showingDetails;
-
- // in any case, our size changed - relayout everything and set new hints
- // ---------------------------------------------------------------------
-
- // we have to reset min size constraints or Fit() would never reduce the
- // dialog size when collapsing it and we have to reset max constraint
- // because it wouldn't expand it otherwise
-
- m_minHeight =
- m_maxHeight = -1;
-
- // wxSizer::FitSize() is private, otherwise we might use it directly...
- wxSize sizeTotal = GetSize(),
- sizeClient = GetClientSize();
-
- wxSize size = sizer->GetMinSize();
- size.x += sizeTotal.x - sizeClient.x;
- size.y += sizeTotal.y - sizeClient.y;
-
- // we don't want to allow expanding the dialog in vertical direction as
- // this would show the "hidden" details but we can resize the dialog
- // vertically while the details are shown
- if ( !m_showingDetails )
- m_maxHeight = size.y;
-
- SetSizeHints(size.x, size.y, m_maxWidth, m_maxHeight);
-
- // don't change the width when expanding/collapsing
- SetSize(-1, size.y);
-
-#ifdef __WXGTK__
- // VS: this is neccessary in order to force frame redraw under
- // WindowMaker or fvwm2 (and probably other broken WMs).
- // Otherwise, detailed list wouldn't be displayed.
- Show(TRUE);
-#endif // wxGTK
-}
-