// Author: Vadim Zeitlin
// Modified by:
// Created: 20.09.99 (extracted from src/common/log.cpp)
-// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#include "wx/image.h"
#endif // wxUSE_LOG_DIALOG/!wxUSE_LOG_DIALOG
-#if defined(__MWERKS__) && wxUSE_UNICODE
- #include <wtime.h>
-#endif
-
-#include "wx/datetime.h"
+#include "wx/time.h"
// the suffix we add to the button to show that the dialog can be expanded
#define EXPAND_SUFFIX wxT(" >>")
// allows to exclude the usage of wxDateTime
static wxString TimeStamp(const wxString& format, time_t t)
{
-#if wxUSE_DATETIME
wxChar buf[4096];
struct tm tm;
if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) )
wxFAIL_MSG(wxT("strftime() failed"));
}
return wxString(buf);
-#else // !wxUSE_DATETIME
- return wxEmptyString;
-#endif // wxUSE_DATETIME/!wxUSE_DATETIME
}
// find the top window and set it's status text if it has any
if ( pFrame == NULL ) {
wxWindow *pWin = wxTheApp->GetTopWindow();
- if ( pWin != NULL && pWin->IsKindOf(CLASSINFO(wxFrame)) ) {
+ if ( wxDynamicCast(pWin, wxFrame) ) {
pFrame = (wxFrame *)pWin;
}
}
wxLogFrame(wxWindow *pParent, wxLogWindow *log, const wxString& szTitle);
virtual ~wxLogFrame();
+ // Don't prevent the application from exiting if just this frame remains.
+ virtual bool ShouldPreventAppExit() const { return false; }
+
// menu callbacks
void OnClose(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
wxMenuBar *pMenuBar = new wxMenuBar;
wxMenu *pMenu = new wxMenu;
#if CAN_SAVE_FILES
- pMenu->Append(Menu_Save, _("&Save..."), _("Save log contents to file"));
+ pMenu->Append(Menu_Save, _("Save &As..."), _("Save log contents to file"));
#endif // CAN_SAVE_FILES
pMenu->Append(Menu_Clear, _("C&lear"), _("Clear the log contents"));
pMenu->AppendSeparator();
// status bar for menu prompts
CreateStatusBar();
#endif // wxUSE_STATUSBAR
-
- m_log->OnFrameCreate(this);
}
void wxLogFrame::DoClose()
return m_pLogFrame;
}
-void wxLogWindow::OnFrameCreate(wxFrame * WXUNUSED(frame))
-{
-}
-
bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame))
{
// allow to close
// add the details pane
#ifndef __SMARTPHONE__
+
+#if wxUSE_COLLPANE
wxCollapsiblePane * const
collpane = new wxCollapsiblePane(this, wxID_ANY, ms_details);
sizerTop->Add(collpane, wxSizerFlags(1).Expand().Border());
wxWindow *win = collpane->GetPane();
+#else
+ wxPanel* win = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ wxBORDER_NONE);
+#endif
wxSizer * const paneSz = new wxBoxSizer(wxVERTICAL);
CreateDetailsControls(win);
btnSizer->Add(new wxButton(win, wxID_SAVE), flagsBtn);
#endif // CAN_SAVE_FILES
- paneSz->Add(btnSizer, wxSizerFlags().Right().Border(wxTOP));
+ paneSz->Add(btnSizer, wxSizerFlags().Right().Border(wxTOP|wxBOTTOM));
#endif // wxUSE_CLIPBOARD || CAN_SAVE_FILES
win->SetSizer(paneSz);
// This may very well fail if there are insufficient colours available.
// Degrade gracefully.
- if ( !bmp.Ok() )
+ if ( !bmp.IsOk() )
{
loadedIcons = false;