");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
}
}
void CBOINCTaskCtrl::BeginTaskSection( const wxString& strLink, const wxString& strTaskHeaderFilename, bool bHidden )
{
wxString strModifiedTaskHeaderFilename;
if ( bHidden )
strModifiedTaskHeaderFilename = strTaskHeaderFilename + wxT(".hidden");
else
strModifiedTaskHeaderFilename = strTaskHeaderFilename + wxT(".visible");
m_strTaskPage += wxT("");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
if ( !strLink.empty() )
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
if ( !strLink.empty() )
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
if ( !bHidden )
{
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
}
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT("");
}
void CBOINCTaskCtrl::UpdateQuickTip( const wxString& strIconFilename, const wxString& strTip, bool bHidden )
{
if (!strTip.empty())
{
BeginTaskSection(
strIconFilename,
bHidden
);
if (!bHidden)
{
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ") + strTip;
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
}
EndTaskSection(bHidden);
}
}
void CBOINCTaskCtrl::UpdateQuickTip( const wxString& strLink, const wxString& strIconFilename, const wxString& strTip, bool bHidden )
{
if (!strTip.empty())
{
BeginTaskSection(
strLink,
strIconFilename,
bHidden
);
if (!bHidden)
{
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ");
m_strTaskPage += wxT(" ") + strTip;
m_strTaskPage += wxT(" | ");
m_strTaskPage += wxT(" ");
}
EndTaskSection(bHidden);
}
}
void CBOINCTaskCtrl::EndTaskPage()
{
m_strTaskPage += wxT("");
SetPage(m_strTaskPage);
}
void CBOINCTaskCtrl::CreateTaskHeader( const wxString& strFilename, const wxBitmap& itemTaskBitmap, const wxString& strTaskName )
{
wxMemoryDC dc;
wxBitmap bmpHeaderVisible(visibleheader_xpm);
wxBitmap bmpHeaderHidden(hiddenheader_xpm);
bmpHeaderVisible.SetMask(new wxMask(bmpHeaderVisible, wxColour(255, 0, 255)));
bmpHeaderHidden.SetMask(new wxMask(bmpHeaderHidden, wxColour(255, 0, 255)));
dc.SelectObject(bmpHeaderVisible);
dc.DrawBitmap(itemTaskBitmap, 17, 9, true);
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetTextForeground(wxColour(255, 255, 255));
dc.DrawText(strTaskName, 44, 12);
dc.SelectObject( wxNullBitmap );
dc.SelectObject(bmpHeaderHidden);
dc.DrawBitmap(itemTaskBitmap, 17, 9, true);
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetTextForeground(wxColour(255, 255, 255));
dc.DrawText(strTaskName, 44, 12);
dc.SelectObject( wxNullBitmap );
wxImage imgHeaderVisible = bmpHeaderVisible.ConvertToImage();
wxImage imgHeaderHidden = bmpHeaderHidden.ConvertToImage();
AddVirtualFile(strFilename + wxT(".visible"), bmpHeaderVisible, wxBITMAP_TYPE_XPM);
AddVirtualFile(strFilename + wxT(".hidden"), bmpHeaderHidden, wxBITMAP_TYPE_XPM);
}
void CBOINCTaskCtrl::AddVirtualFile( const wxString& strFilename, wxImage& itemImage, long lType )
{
wxMemoryFSHandler::AddFile( strFilename, itemImage, lType );
}
void CBOINCTaskCtrl::AddVirtualFile( const wxString& strFilename, const wxBitmap& itemBitmap, long lType )
{
wxMemoryFSHandler::AddFile( strFilename, itemBitmap, lType );
}
void CBOINCTaskCtrl::RemoveVirtualFile( const wxString& strFilename )
{
wxMemoryFSHandler::RemoveFile( strFilename );
}
bool CBOINCTaskCtrl::OnSaveState( wxConfigBase* WXUNUSED(pConfig) )
{
return true;
}
bool CBOINCTaskCtrl::OnRestoreState( wxConfigBase* WXUNUSED(pConfig) )
{
return true;
}
void CBOINCTaskCtrl::OnLinkClicked( const wxHtmlLinkInfo& link )
{
wxASSERT(NULL != m_pParentView);
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
m_pParentView->FireOnTaskLinkClicked( link );
}
void CBOINCTaskCtrl::OnCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
{
wxASSERT(NULL != m_pParentView);
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
m_pParentView->FireOnTaskCellMouseHover( cell, x, y );
}
wxHtmlOpeningStatus CBOINCTaskCtrl::OnOpeningURL( wxHtmlURLType type, const wxString& WXUNUSED(url), wxString* WXUNUSED(redirect) )
{
wxHtmlOpeningStatus retval;
retval = wxHTML_BLOCK;
if ( wxHTML_URL_IMAGE == type )
retval = wxHTML_OPEN;
return retval;
}
#ifdef __GNUC__
static volatile const char __attribute__((unused)) *BOINCrcsid="$Id$";
#else
static volatile const char *BOINCrcsid="$Id$";
#endif
|