| 1 |
////////////////////////////////////////////////////////////////////////////// |
| 2 |
////////////////////////////////////////////////////////////////////////////// |
| 3 |
// |
| 4 |
// copyright : (C) 2014 Eran Ifrah |
| 5 |
// file name : LogDialog.cpp |
| 6 |
// |
| 7 |
// ------------------------------------------------------------------------- |
| 8 |
// A |
| 9 |
// _____ _ _ _ _ |
| 10 |
// / __ \ | | | | (_) | |
| 11 |
// | / \/ ___ __| | ___| | _| |_ ___ |
| 12 |
// | | / _ \ / _ |/ _ \ | | | __/ _ ) |
| 13 |
// | \__/\ (_) | (_| | __/ |___| | || __/ |
| 14 |
// \____/\___/ \__,_|\___\_____/_|\__\___| |
| 15 |
// |
| 16 |
// F i l e |
| 17 |
// |
| 18 |
// This program is free software; you can redistribute it and/or modify |
| 19 |
// it under the terms of the GNU General Public License as published by |
| 20 |
// the Free Software Foundation; either version 2 of the License, or |
| 21 |
// (at your option) any later version. |
| 22 |
// |
| 23 |
////////////////////////////////////////////////////////////////////////////// |
| 24 |
////////////////////////////////////////////////////////////////////////////// |
| 25 |
|
| 26 |
#include "LogDialog.h" |
| 27 |
|
| 28 |
LogDialog::LogDialog(wxWindow* parent):_LogDialog(parent) |
| 29 |
{ |
| 30 |
m_canClose = false; |
| 31 |
|
| 32 |
m_text = _(" --------------- Log starts at: ") + wxNow() + " -------------------\n"; |
| 33 |
m_textCtrl11->SetValue(m_text); |
| 34 |
} |
| 35 |
|
| 36 |
LogDialog::~LogDialog() |
| 37 |
{ |
| 38 |
} |
| 39 |
|
| 40 |
void LogDialog::AppendText(const wxString& txt) |
| 41 |
{ |
| 42 |
m_text.Append(txt + wxT("\n")); |
| 43 |
m_textCtrl11->SetValue(m_text); |
| 44 |
} |
| 45 |
|
| 46 |
void LogDialog::Clear() |
| 47 |
{ |
| 48 |
m_text.clear(); |
| 49 |
m_textCtrl11->SetValue(m_text); |
| 50 |
} |
| 51 |
|
| 52 |
void LogDialog::OnCloseClick(wxCommandEvent& event) |
| 53 |
{ |
| 54 |
Clear(); |
| 55 |
Destroy(); |
| 56 |
} |
| 57 |
void LogDialog::OnCloseUI(wxUpdateUIEvent& event) |
| 58 |
{ |
| 59 |
event.Enable(m_canClose); |
| 60 |
} |
| 61 |
|
| 62 |
void LogDialog::AppendSeparator() |
| 63 |
{ |
| 64 |
m_text.Append("*********************************************************\n"); |
| 65 |
m_textCtrl11->SetValue(m_text); |
| 66 |
} |
| 67 |
|
| 68 |
void LogDialog::AppendComment(const wxString& txt) |
| 69 |
{ |
| 70 |
m_text.Append(wxNow() + txt + wxT("\n")); |
| 71 |
m_textCtrl11->SetValue(m_text); |
| 72 |
} |
| 73 |
|