2004-05-17 22:15:10 +00:00
|
|
|
// $Id$
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision History:
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2004-09-21 01:30:29 +00:00
|
|
|
#pragma implementation "ViewMessages.h"
|
2004-04-11 04:37:10 +00:00
|
|
|
#endif
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
#include "stdwx.h"
|
2004-08-11 23:52:22 +00:00
|
|
|
#include "BOINCGUIApp.h"
|
|
|
|
#include "MainDocument.h"
|
2004-09-24 22:19:02 +00:00
|
|
|
#include "BOINCTaskCtrl.h"
|
|
|
|
#include "BOINCListCtrl.h"
|
2004-09-21 01:30:29 +00:00
|
|
|
#include "ViewMessages.h"
|
2004-07-13 05:56:03 +00:00
|
|
|
#include "Events.h"
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
#include "res/mess.xpm"
|
2004-09-24 22:19:02 +00:00
|
|
|
#include "res/task.xpm"
|
|
|
|
#include "res/tips.xpm"
|
|
|
|
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
#define VIEW_HEADER wxT("mess")
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
#define SECTION_TASK wxT(VIEW_HEADER "task")
|
|
|
|
#define SECTION_TIPS wxT(VIEW_HEADER "tips")
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
#define BITMAP_MESSAGE wxT(VIEW_HEADER ".xpm")
|
|
|
|
#define BITMAP_TASKHEADER wxT(SECTION_TASK ".xpm")
|
|
|
|
#define BITMAP_TIPSHEADER wxT(SECTION_TIPS ".xpm")
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
#define LINK_DEFAULT wxT("default")
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
#define COLUMN_PROJECT 0
|
|
|
|
#define COLUMN_TIME 1
|
|
|
|
#define COLUMN_MESSAGE 2
|
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
#define PRIORITY_INFO 1
|
|
|
|
#define PRIORITY_ERROR 2
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
const wxString LINK_TASKCOPYALL = wxT(SECTION_TASK "copyall");
|
|
|
|
const wxString LINKDESC_TASKCOPYALL =
|
|
|
|
_("<b>Copy All</b><br>"
|
|
|
|
"Selecting copy all, copies all the messages to the system clipboard.");
|
|
|
|
|
|
|
|
const wxString LINK_TASKCOPYMESSAGE = wxT(SECTION_TASK "copymessage");
|
|
|
|
const wxString LINKDESC_TASKCOPYMESSAGE =
|
|
|
|
_("<b>Copy Message</b><br>"
|
|
|
|
"Selecting copy message, copies the single message to the system clipboard.");
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CViewMessages, CBOINCBaseView)
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CViewMessages::CViewMessages()
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CViewMessages::CViewMessages(wxNotebook* pNotebook) :
|
2004-09-24 02:01:53 +00:00
|
|
|
CBOINCBaseView(pNotebook, ID_HTML_MESSAGESVIEW, ID_LIST_MESSAGESVIEW)
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
2004-09-25 21:33:24 +00:00
|
|
|
m_bProcessingTaskRenderEvent = false;
|
|
|
|
m_bProcessingListRenderEvent = false;
|
2004-09-21 01:30:29 +00:00
|
|
|
|
|
|
|
wxASSERT(NULL != m_pTaskPane);
|
|
|
|
wxASSERT(NULL != m_pListPane);
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
wxBitmap bmpMessage(mess_xpm);
|
|
|
|
wxBitmap bmpTask(task_xpm);
|
|
|
|
wxBitmap bmpTips(tips_xpm);
|
|
|
|
|
|
|
|
bmpMessage.SetMask(new wxMask(bmpMessage, wxColour(255, 0, 255)));
|
|
|
|
bmpTask.SetMask(new wxMask(bmpTask, wxColour(255, 0, 255)));
|
|
|
|
bmpTips.SetMask(new wxMask(bmpTips, wxColour(255, 0, 255)));
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
m_pTaskPane->AddVirtualFile(BITMAP_MESSAGE, bmpMessage, wxBITMAP_TYPE_XPM);
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
m_pTaskPane->CreateTaskHeader(BITMAP_TASKHEADER, bmpTask, _("Tasks"));
|
|
|
|
m_pTaskPane->CreateTaskHeader(BITMAP_TIPSHEADER, bmpTips, _("Quick Tips"));
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, -1);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_TIME, _("Time"), wxLIST_FORMAT_LEFT, -1);
|
|
|
|
m_pListPane->InsertColumn(COLUMN_MESSAGE, _("Message"), wxLIST_FORMAT_LEFT, -1);
|
2004-09-24 22:19:02 +00:00
|
|
|
|
2004-09-29 22:21:45 +00:00
|
|
|
m_pMessageInfoAttr = new wxListItemAttr( *wxBLACK, *wxWHITE, wxNullFont );
|
|
|
|
m_pMessageErrorAttr = new wxListItemAttr( *wxRED, *wxWHITE, wxNullFont );
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
m_bTipsHeaderHidden = false;
|
|
|
|
|
|
|
|
SetCurrentQuickTip(
|
|
|
|
wxT(LINK_DEFAULT),
|
|
|
|
_("Please select a message to see additional options.")
|
|
|
|
);
|
|
|
|
|
|
|
|
UpdateSelection();
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
CViewMessages::~CViewMessages()
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
2004-09-29 22:21:45 +00:00
|
|
|
if ( m_pMessageInfoAttr )
|
|
|
|
{
|
|
|
|
delete m_pMessageInfoAttr;
|
|
|
|
m_pMessageInfoAttr = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( m_pMessageErrorAttr )
|
|
|
|
{
|
|
|
|
delete m_pMessageErrorAttr;
|
|
|
|
m_pMessageErrorAttr = NULL;
|
|
|
|
}
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
wxString CViewMessages::GetViewName()
|
2004-04-10 09:11:03 +00:00
|
|
|
{
|
|
|
|
return wxString(_("Messages"));
|
|
|
|
}
|
2004-04-11 05:09:18 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
char** CViewMessages::GetViewIcon()
|
2004-04-13 00:33:40 +00:00
|
|
|
{
|
|
|
|
return mess_xpm;
|
|
|
|
}
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
void CViewMessages::OnTaskRender(wxTimerEvent &event)
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2004-09-25 21:33:24 +00:00
|
|
|
if (!m_bProcessingTaskRenderEvent)
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2004-09-25 21:33:24 +00:00
|
|
|
m_bProcessingTaskRenderEvent = true;
|
2004-07-13 05:56:03 +00:00
|
|
|
|
2004-09-21 01:30:29 +00:00
|
|
|
wxASSERT(NULL != m_pListPane);
|
2004-07-13 05:56:03 +00:00
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( ( 0 == m_pListPane->GetSelectedItemCount() ) && m_bItemSelected )
|
2004-09-24 22:19:02 +00:00
|
|
|
{
|
|
|
|
UpdateSelection();
|
|
|
|
}
|
|
|
|
|
2004-09-25 21:33:24 +00:00
|
|
|
m_bProcessingTaskRenderEvent = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CViewMessages::OnListRender(wxTimerEvent &event)
|
|
|
|
{
|
|
|
|
if (!m_bProcessingListRenderEvent)
|
|
|
|
{
|
|
|
|
m_bProcessingListRenderEvent = true;
|
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
|
|
|
|
wxASSERT(NULL != pDoc);
|
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
2004-09-25 21:33:24 +00:00
|
|
|
wxASSERT(NULL != m_pListPane);
|
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
wxInt32 iCount = pDoc->GetMessageCount();
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( iCount != m_iCount )
|
|
|
|
{
|
|
|
|
m_iCount = iCount;
|
|
|
|
m_pListPane->SetItemCount(iCount);
|
|
|
|
m_pListPane->EnsureVisible(iCount-1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wxListItem liListItemMessage;
|
2004-10-05 03:40:28 +00:00
|
|
|
wxString strListItemMessage;
|
2004-10-05 02:55:26 +00:00
|
|
|
wxString strDocumentItemMessage;
|
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
FormatMessage(m_iCacheTo, strDocumentItemMessage);
|
2004-10-05 02:55:26 +00:00
|
|
|
|
|
|
|
liListItemMessage.SetId(m_iCacheTo);
|
|
|
|
liListItemMessage.SetColumn(COLUMN_MESSAGE);
|
|
|
|
liListItemMessage.SetMask(wxLIST_MASK_TEXT);
|
|
|
|
|
|
|
|
m_pListPane->GetItem(liListItemMessage);
|
|
|
|
|
2004-10-05 03:40:28 +00:00
|
|
|
strListItemMessage = liListItemMessage.GetText();
|
|
|
|
|
|
|
|
if ( !strDocumentItemMessage.IsSameAs(strListItemMessage) )
|
2004-10-05 02:55:26 +00:00
|
|
|
{
|
|
|
|
m_pListPane->RefreshItems(m_iCacheFrom, m_iCacheTo);
|
|
|
|
m_pListPane->EnsureVisible(m_iCacheTo);
|
|
|
|
}
|
|
|
|
}
|
2004-09-25 21:33:24 +00:00
|
|
|
|
|
|
|
m_bProcessingListRenderEvent = false;
|
2004-09-21 01:30:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
event.Skip();
|
|
|
|
}
|
2004-05-21 06:27:15 +00:00
|
|
|
}
|
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
void CViewMessages::OnListSelected ( wxListEvent& event )
|
|
|
|
{
|
2004-10-09 03:05:01 +00:00
|
|
|
SetCurrentQuickTip(
|
|
|
|
LINK_DEFAULT,
|
|
|
|
wxT("")
|
|
|
|
);
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
UpdateSelection();
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CViewMessages::OnListDeselected ( wxListEvent& event )
|
|
|
|
{
|
2004-10-09 03:05:01 +00:00
|
|
|
SetCurrentQuickTip(
|
|
|
|
LINK_DEFAULT,
|
|
|
|
wxT("")
|
|
|
|
);
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
UpdateSelection();
|
|
|
|
event.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxString CViewMessages::OnListGetItemText( long item, long column ) const
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2004-09-29 22:21:45 +00:00
|
|
|
wxString strBuffer;
|
|
|
|
|
|
|
|
switch(column)
|
|
|
|
{
|
2004-08-11 23:52:22 +00:00
|
|
|
case COLUMN_PROJECT:
|
2004-10-11 04:38:00 +00:00
|
|
|
if (item == m_iCacheFrom) wxGetApp().GetDocument()->CachedStateLock();
|
|
|
|
FormatProjectName( item, strBuffer );
|
2004-08-11 23:52:22 +00:00
|
|
|
break;
|
|
|
|
case COLUMN_TIME:
|
2004-10-11 04:38:00 +00:00
|
|
|
FormatTime( item, strBuffer );
|
2004-08-11 23:52:22 +00:00
|
|
|
break;
|
|
|
|
case COLUMN_MESSAGE:
|
2004-10-11 04:38:00 +00:00
|
|
|
FormatMessage( item, strBuffer );
|
|
|
|
if (item == m_iCacheTo) wxGetApp().GetDocument()->CachedStateUnlock();
|
2004-08-11 23:52:22 +00:00
|
|
|
break;
|
|
|
|
}
|
2004-09-29 22:21:45 +00:00
|
|
|
|
2004-08-11 23:52:22 +00:00
|
|
|
return strBuffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
wxListItemAttr* CViewMessages::OnListGetItemAttr( long item ) const
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2004-09-29 22:21:45 +00:00
|
|
|
wxListItemAttr* pAttribute = NULL;
|
|
|
|
wxInt32 iBuffer = 0;
|
|
|
|
|
|
|
|
wxGetApp().GetDocument()->GetMessagePriority(item, iBuffer);
|
|
|
|
|
|
|
|
switch(iBuffer)
|
|
|
|
{
|
|
|
|
case PRIORITY_INFO:
|
|
|
|
pAttribute = m_pMessageInfoAttr;
|
|
|
|
break;
|
|
|
|
case PRIORITY_ERROR:
|
|
|
|
pAttribute = m_pMessageErrorAttr;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return pAttribute;
|
2004-08-11 23:52:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-24 22:19:02 +00:00
|
|
|
void CViewMessages::OnTaskLinkClicked( const wxHtmlLinkInfo& link )
|
2004-09-21 01:30:29 +00:00
|
|
|
{
|
2004-09-24 22:19:02 +00:00
|
|
|
wxASSERT(NULL != m_pTaskPane);
|
|
|
|
wxASSERT(NULL != m_pListPane);
|
|
|
|
|
|
|
|
wxString strMessage;
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( link.GetHref() == SECTION_TASK )
|
2004-09-24 22:19:02 +00:00
|
|
|
m_bTaskHeaderHidden ? m_bTaskHeaderHidden = false : m_bTaskHeaderHidden = true;
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( link.GetHref() == SECTION_TIPS )
|
2004-09-24 22:19:02 +00:00
|
|
|
m_bTipsHeaderHidden ? m_bTipsHeaderHidden = false : m_bTipsHeaderHidden = true;
|
|
|
|
|
|
|
|
|
|
|
|
UpdateSelection();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CViewMessages::OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
|
|
|
{
|
|
|
|
if ( NULL != cell->GetLink() )
|
|
|
|
{
|
|
|
|
bool bUpdateSelection = false;
|
|
|
|
wxString strLink;
|
|
|
|
|
|
|
|
strLink = cell->GetLink()->GetHref();
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( UpdateQuickTip( strLink, LINK_TASKCOPYALL, LINKDESC_TASKCOPYALL ) )
|
|
|
|
bUpdateSelection = true;
|
|
|
|
else if ( UpdateQuickTip( strLink, LINK_TASKCOPYMESSAGE, LINKDESC_TASKCOPYMESSAGE ) )
|
|
|
|
bUpdateSelection = true;
|
2004-09-24 22:19:02 +00:00
|
|
|
else
|
|
|
|
{
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( 0 == m_pListPane->GetSelectedItemCount() )
|
2004-09-24 22:19:02 +00:00
|
|
|
{
|
2004-10-05 03:40:28 +00:00
|
|
|
if ( LINK_DEFAULT != GetCurrentQuickTip() )
|
2004-09-24 22:19:02 +00:00
|
|
|
{
|
|
|
|
SetCurrentQuickTip(
|
2004-10-05 03:40:28 +00:00
|
|
|
LINK_DEFAULT,
|
2004-09-24 22:19:02 +00:00
|
|
|
_("Please select a message to see additional options.")
|
|
|
|
);
|
|
|
|
|
|
|
|
bUpdateSelection = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( bUpdateSelection )
|
|
|
|
{
|
|
|
|
UpdateSelection();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CViewMessages::UpdateSelection()
|
|
|
|
{
|
|
|
|
wxASSERT(NULL != m_pTaskPane);
|
|
|
|
wxASSERT(NULL != m_pListPane);
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
if ( 0 == m_pListPane->GetSelectedItemCount() )
|
2004-09-24 22:19:02 +00:00
|
|
|
{
|
|
|
|
m_bTaskHeaderHidden = false;
|
|
|
|
m_bTaskCopyAllHidden = false;
|
|
|
|
m_bTaskCopyMessageHidden = true;
|
|
|
|
|
2004-10-09 03:05:01 +00:00
|
|
|
if ( m_bItemSelected )
|
|
|
|
{
|
|
|
|
SetCurrentQuickTip(
|
|
|
|
LINK_DEFAULT,
|
|
|
|
wxT("")
|
|
|
|
);
|
|
|
|
}
|
2004-09-24 22:19:02 +00:00
|
|
|
m_bItemSelected = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_bTaskHeaderHidden = false;
|
|
|
|
m_bTaskCopyAllHidden = false;
|
|
|
|
m_bTaskCopyMessageHidden = false;
|
|
|
|
|
|
|
|
m_bItemSelected = true;
|
|
|
|
}
|
|
|
|
UpdateTaskPane();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CViewMessages::UpdateTaskPane()
|
|
|
|
{
|
|
|
|
wxASSERT(NULL != m_pTaskPane);
|
|
|
|
|
|
|
|
m_pTaskPane->BeginTaskPage();
|
|
|
|
|
2004-10-05 02:55:26 +00:00
|
|
|
m_pTaskPane->BeginTaskSection( SECTION_TASK, BITMAP_TASKHEADER, m_bTaskHeaderHidden );
|
2004-09-24 22:19:02 +00:00
|
|
|
if (!m_bTaskHeaderHidden)
|
|
|
|
{
|
2004-10-05 02:55:26 +00:00
|
|
|
m_pTaskPane->CreateTask( LINK_TASKCOPYALL, BITMAP_MESSAGE, _("Copy All"), m_bTaskCopyAllHidden );
|
|
|
|
m_pTaskPane->CreateTask( LINK_TASKCOPYMESSAGE, BITMAP_MESSAGE, _("Copy Message"), m_bTaskCopyMessageHidden );
|
2004-09-24 22:19:02 +00:00
|
|
|
}
|
|
|
|
m_pTaskPane->EndTaskSection( m_bTaskHeaderHidden );
|
|
|
|
|
2004-10-05 03:40:28 +00:00
|
|
|
m_pTaskPane->UpdateQuickTip( SECTION_TIPS, BITMAP_TIPSHEADER, GetCurrentQuickTipText(), m_bTipsHeaderHidden );
|
2004-09-24 22:19:02 +00:00
|
|
|
|
|
|
|
m_pTaskPane->EndTaskPage();
|
2004-08-11 23:52:22 +00:00
|
|
|
}
|
|
|
|
|
2004-10-11 04:38:00 +00:00
|
|
|
|
|
|
|
wxInt32 CViewMessages::FormatProjectName( wxInt32 item, wxString& strBuffer ) const
|
|
|
|
{
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
|
|
|
|
wxASSERT(NULL != pDoc);
|
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
|
|
|
|
|
|
|
strBuffer.Clear();
|
|
|
|
|
|
|
|
pDoc->GetMessageProjectName(item, strBuffer);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CViewMessages::FormatTime( wxInt32 item, wxString& strBuffer ) const
|
|
|
|
{
|
|
|
|
wxDateTime dtBuffer(wxDateTime::Now());
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
|
|
|
|
wxASSERT(NULL != pDoc);
|
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
|
|
|
|
|
|
|
strBuffer.Clear();
|
|
|
|
|
|
|
|
pDoc->GetMessageTime(item, dtBuffer);
|
|
|
|
strBuffer = dtBuffer.Format();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxInt32 CViewMessages::FormatMessage( wxInt32 item, wxString& strBuffer ) const
|
|
|
|
{
|
|
|
|
CMainDocument* pDoc = wxGetApp().GetDocument();
|
|
|
|
|
|
|
|
wxASSERT(NULL != pDoc);
|
|
|
|
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
|
|
|
|
|
|
|
strBuffer.Clear();
|
|
|
|
|
|
|
|
pDoc->GetMessageMessage(item, strBuffer);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|