mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=4235
This commit is contained in:
parent
ccfcecdb3c
commit
5f837c5a6c
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 2004/09/24 02:01:44 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.3 2004/09/23 08:28:49 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -114,13 +117,6 @@ char** CBOINCBaseView::GetViewIcon()
|
|||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::UpdateTaskPane()
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::UpdateTaskPane - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::UpdateTaskPane - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnRender (wxTimerEvent& event)
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnRender - Function Begining");
|
||||
|
@ -169,41 +165,106 @@ bool CBOINCBaseView::OnRestoreState( wxConfigBase* pConfig ) {
|
|||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnCacheHint ( wxListEvent& event )
|
||||
void CBOINCBaseView::OnListCacheHint ( wxListEvent& event )
|
||||
{
|
||||
m_iCacheFrom = event.GetCacheFrom();
|
||||
m_iCacheTo = event.GetCacheTo();
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCBaseView::OnGetItemText(long item, long column) const
|
||||
void CBOINCBaseView::OnListSelected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnListSelected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnListDeselected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnListDeselected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnListActivated ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnListActivated - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnListFocused ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnListFocused - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCBaseView::OnListGetItemText(long item, long column) const
|
||||
{
|
||||
return wxString("Undefined");
|
||||
}
|
||||
|
||||
|
||||
int CBOINCBaseView::OnGetItemImage(long item) const
|
||||
int CBOINCBaseView::OnListGetItemImage(long item) const
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
wxListItemAttr* CBOINCBaseView::OnGetItemAttr(long item) const
|
||||
wxListItemAttr* CBOINCBaseView::OnListGetItemAttr(long item) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnLinkClicked( const wxHtmlLinkInfo& link )
|
||||
void CBOINCBaseView::OnTaskLinkClicked( const wxHtmlLinkInfo& link )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnLinkClicked - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::OnLinkClicked - Function Ending");
|
||||
wxLogTrace("CBOINCBaseView::OnTaskLinkClicked - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::OnTaskLinkClicked - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::OnCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
void CBOINCBaseView::OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::OnCellMouseHover - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::OnCellMouseHover - Function Ending");
|
||||
wxLogTrace("CBOINCBaseView::OnTaskCellMouseHover - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::OnTaskCellMouseHover - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCBaseView::GetCurrentQuickTip()
|
||||
{
|
||||
return m_strQuickTip;
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCBaseView::GetCurrentQuickTipText()
|
||||
{
|
||||
return m_strQuickTipText;
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::SetCurrentQuickTip( const wxString& strQuickTip, const wxString& strQuickTipText )
|
||||
{
|
||||
m_strQuickTip = strQuickTip;
|
||||
m_strQuickTipText = strQuickTipText;
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::UpdateSelection()
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::UpdateSelection - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::UpdateSelection - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
void CBOINCBaseView::UpdateTaskPane()
|
||||
{
|
||||
wxLogTrace("CBOINCBaseView::UpdateTaskPane - Function Begining");
|
||||
wxLogTrace("CBOINCBaseView::UpdateTaskPane - Function Ending");
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 2004/09/24 02:01:45 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.2 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -53,24 +56,36 @@ public:
|
|||
virtual wxString GetViewName();
|
||||
virtual char** GetViewIcon();
|
||||
|
||||
virtual void UpdateTaskPane();
|
||||
|
||||
virtual void OnRender( wxTimerEvent& event );
|
||||
virtual bool OnSaveState( wxConfigBase* pConfig );
|
||||
virtual bool OnRestoreState( wxConfigBase* pConfig );
|
||||
|
||||
virtual void OnCacheHint( wxListEvent& event );
|
||||
virtual wxString OnGetItemText( long item, long column ) const;
|
||||
virtual int OnGetItemImage( long item ) const;
|
||||
virtual wxListItemAttr* OnGetItemAttr( long item ) const;
|
||||
virtual void OnListCacheHint( wxListEvent& event );
|
||||
virtual void OnListSelected( wxListEvent& event );
|
||||
virtual void OnListDeselected( wxListEvent& event );
|
||||
virtual void OnListActivated( wxListEvent& event );
|
||||
virtual void OnListFocused( wxListEvent& event );
|
||||
virtual wxString OnListGetItemText( long item, long column ) const;
|
||||
virtual int OnListGetItemImage( long item ) const;
|
||||
virtual wxListItemAttr* OnListGetItemAttr( long item ) const;
|
||||
|
||||
virtual void OnLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
virtual void OnTaskLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
|
||||
wxString GetCurrentQuickTip();
|
||||
wxString GetCurrentQuickTipText();
|
||||
void SetCurrentQuickTip( const wxString& strQuickTip, const wxString& strQuickTipText );
|
||||
|
||||
virtual void UpdateSelection();
|
||||
virtual void UpdateTaskPane();
|
||||
|
||||
bool m_bProcessingRenderEvent;
|
||||
wxInt32 m_iCacheFrom;
|
||||
wxInt32 m_iCacheTo;
|
||||
|
||||
wxString m_strQuickTip;
|
||||
wxString m_strQuickTipText;
|
||||
|
||||
CBOINCTaskCtrl* m_pTaskPane;
|
||||
CBOINCListCtrl* m_pListPane;
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.3 2004/09/24 02:01:46 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.2 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -41,10 +44,43 @@
|
|||
#include "ViewTransfers.h"
|
||||
#include "ViewMessages.h"
|
||||
#include "ViewResources.h"
|
||||
#include "Events.h"
|
||||
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(CBOINCListCtrl, wxListView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CBOINCListCtrl, wxListView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_PROJECTSVIEW, CBOINCListCtrl::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_PROJECTSVIEW, CBOINCListCtrl::OnSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_PROJECTSVIEW, CBOINCListCtrl::OnDeselected)
|
||||
EVT_LIST_ITEM_ACTIVATED(ID_LIST_PROJECTSVIEW, CBOINCListCtrl::OnActivated)
|
||||
EVT_LIST_ITEM_FOCUSED(ID_LIST_PROJECTSVIEW, CBOINCListCtrl::OnFocused)
|
||||
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_WORKVIEW, CBOINCListCtrl::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_WORKVIEW, CBOINCListCtrl::OnSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_WORKVIEW, CBOINCListCtrl::OnDeselected)
|
||||
EVT_LIST_ITEM_ACTIVATED(ID_LIST_WORKVIEW, CBOINCListCtrl::OnActivated)
|
||||
EVT_LIST_ITEM_FOCUSED(ID_LIST_WORKVIEW, CBOINCListCtrl::OnFocused)
|
||||
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_TRANSFERSVIEW, CBOINCListCtrl::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_TRANSFERSVIEW, CBOINCListCtrl::OnSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_TRANSFERSVIEW, CBOINCListCtrl::OnDeselected)
|
||||
EVT_LIST_ITEM_ACTIVATED(ID_LIST_TRANSFERSVIEW, CBOINCListCtrl::OnActivated)
|
||||
EVT_LIST_ITEM_FOCUSED(ID_LIST_TRANSFERSVIEW, CBOINCListCtrl::OnFocused)
|
||||
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_MESSAGESVIEW, CBOINCListCtrl::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_MESSAGESVIEW, CBOINCListCtrl::OnSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_MESSAGESVIEW, CBOINCListCtrl::OnDeselected)
|
||||
EVT_LIST_ITEM_ACTIVATED(ID_LIST_MESSAGESVIEW, CBOINCListCtrl::OnActivated)
|
||||
EVT_LIST_ITEM_FOCUSED(ID_LIST_MESSAGESVIEW, CBOINCListCtrl::OnFocused)
|
||||
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_RESOURCEUTILIZATIONVIEW, CBOINCListCtrl::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_RESOURCEUTILIZATIONVIEW, CBOINCListCtrl::OnSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_RESOURCEUTILIZATIONVIEW, CBOINCListCtrl::OnDeselected)
|
||||
EVT_LIST_ITEM_ACTIVATED(ID_LIST_RESOURCEUTILIZATIONVIEW, CBOINCListCtrl::OnActivated)
|
||||
EVT_LIST_ITEM_FOCUSED(ID_LIST_RESOURCEUTILIZATIONVIEW, CBOINCListCtrl::OnFocused)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
CBOINCListCtrl::CBOINCListCtrl()
|
||||
{
|
||||
|
@ -167,6 +203,111 @@ bool CBOINCListCtrl::OnRestoreState( wxConfigBase* pConfig ) {
|
|||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnCacheHint( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
if (wxDynamicCast(m_pParentView, CViewProjects)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CViewProjects), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewWork)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CViewWork), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewTransfers)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CViewTransfers), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewMessages)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CViewMessages), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewResources)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CViewResources), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CBOINCBaseView)) {
|
||||
FireOnCacheHintEvent(wxDynamicCast(m_pParentView, CBOINCBaseView), event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnSelected( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
if (wxDynamicCast(m_pParentView, CViewProjects)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CViewProjects), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewWork)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CViewWork), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewTransfers)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CViewTransfers), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewMessages)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CViewMessages), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewResources)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CViewResources), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CBOINCBaseView)) {
|
||||
FireOnSelectedEvent(wxDynamicCast(m_pParentView, CBOINCBaseView), event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnDeselected( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
if (wxDynamicCast(m_pParentView, CViewProjects)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CViewProjects), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewWork)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CViewWork), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewTransfers)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CViewTransfers), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewMessages)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CViewMessages), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewResources)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CViewResources), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CBOINCBaseView)) {
|
||||
FireOnDeselectedEvent(wxDynamicCast(m_pParentView, CBOINCBaseView), event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnActivated( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
if (wxDynamicCast(m_pParentView, CViewProjects)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CViewProjects), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewWork)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CViewWork), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewTransfers)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CViewTransfers), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewMessages)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CViewMessages), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewResources)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CViewResources), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CBOINCBaseView)) {
|
||||
FireOnActivatedEvent(wxDynamicCast(m_pParentView, CBOINCBaseView), event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCListCtrl::OnFocused( wxListEvent& event )
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
wxASSERT(wxDynamicCast(m_pParentView, CBOINCBaseView));
|
||||
|
||||
if (wxDynamicCast(m_pParentView, CViewProjects)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CViewProjects), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewWork)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CViewWork), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewTransfers)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CViewTransfers), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewMessages)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CViewMessages), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CViewResources)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CViewResources), event);
|
||||
} else if (wxDynamicCast(m_pParentView, CBOINCBaseView)) {
|
||||
FireOnFocusedEvent(wxDynamicCast(m_pParentView, CBOINCBaseView), event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
wxString CBOINCListCtrl::OnGetItemText( long item, long column ) const
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
|
@ -187,13 +328,6 @@ wxString CBOINCListCtrl::OnGetItemText( long item, long column ) const
|
|||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
wxString CBOINCListCtrl::FireOnGetItemTextEvent( T pView, long item, long column) const
|
||||
{
|
||||
return pView->OnGetItemText( item, column );
|
||||
}
|
||||
|
||||
|
||||
int CBOINCListCtrl::OnGetItemImage( long item ) const
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
|
@ -214,13 +348,6 @@ int CBOINCListCtrl::OnGetItemImage( long item ) const
|
|||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
int CBOINCListCtrl::FireOnGetItemImageEvent( T pView, long item ) const
|
||||
{
|
||||
return pView->OnGetItemImage( item );
|
||||
}
|
||||
|
||||
|
||||
wxListItemAttr* CBOINCListCtrl::OnGetItemAttr( long item ) const
|
||||
{
|
||||
wxASSERT(NULL != m_pParentView);
|
||||
|
@ -242,8 +369,57 @@ wxListItemAttr* CBOINCListCtrl::OnGetItemAttr( long item ) const
|
|||
|
||||
|
||||
template < class T >
|
||||
wxListItemAttr* CBOINCListCtrl::FireOnGetItemAttrEvent( T pView, long item ) const
|
||||
void CBOINCListCtrl::FireOnCacheHintEvent( T pView, wxListEvent& event )
|
||||
{
|
||||
return pView->OnGetItemAttr( item );
|
||||
return pView->OnListCacheHint( event );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
void CBOINCListCtrl::FireOnSelectedEvent( T pView, wxListEvent& event )
|
||||
{
|
||||
return pView->OnListSelected( event );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
void CBOINCListCtrl::FireOnDeselectedEvent( T pView, wxListEvent& event )
|
||||
{
|
||||
return pView->OnListDeselected( event );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
void CBOINCListCtrl::FireOnActivatedEvent( T pView, wxListEvent& event )
|
||||
{
|
||||
return pView->OnListActivated( event );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
void CBOINCListCtrl::FireOnFocusedEvent( T pView, wxListEvent& event )
|
||||
{
|
||||
return pView->OnListFocused( event );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
wxString CBOINCListCtrl::FireOnGetItemTextEvent( T pView, long item, long column ) const
|
||||
{
|
||||
return pView->OnListGetItemText( item, column );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
int CBOINCListCtrl::FireOnGetItemImageEvent( T pView, long item ) const
|
||||
{
|
||||
return pView->OnListGetItemImage( item );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
wxListItemAttr* CBOINCListCtrl::FireOnGetItemAttrEvent( T pView, long item ) const
|
||||
{
|
||||
return pView->OnListGetItemAttr( item );
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:47 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:24 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -52,20 +55,36 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
virtual void OnCacheHint( wxListEvent& event );
|
||||
virtual void OnSelected( wxListEvent& event );
|
||||
virtual void OnDeselected( wxListEvent& event );
|
||||
virtual void OnActivated( wxListEvent& event );
|
||||
virtual void OnFocused( wxListEvent& event );
|
||||
virtual wxString OnGetItemText( long item, long column ) const;
|
||||
virtual int OnGetItemImage( long item ) const;
|
||||
virtual wxListItemAttr* OnGetItemAttr( long item ) const;
|
||||
|
||||
template < class T >
|
||||
void FireOnCacheHintEvent( T pView, wxListEvent& event );
|
||||
template < class T >
|
||||
void FireOnSelectedEvent( T pView, wxListEvent& event );
|
||||
template < class T >
|
||||
void FireOnDeselectedEvent( T pView, wxListEvent& event );
|
||||
template < class T >
|
||||
void FireOnActivatedEvent( T pView, wxListEvent& event );
|
||||
template < class T >
|
||||
void FireOnFocusedEvent( T pView, wxListEvent& event );
|
||||
template < class T >
|
||||
wxString FireOnGetItemTextEvent( T pView, long item, long column ) const;
|
||||
|
||||
virtual int OnGetItemImage( long item ) const;
|
||||
template < class T >
|
||||
int FireOnGetItemImageEvent( T pView, long item ) const;
|
||||
|
||||
virtual wxListItemAttr* OnGetItemAttr( long item ) const;
|
||||
template < class T >
|
||||
wxListItemAttr* FireOnGetItemAttrEvent( T pView, long item ) const;
|
||||
|
||||
CBOINCBaseView* m_pParentView;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 2004/09/24 02:01:47 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.3 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -112,31 +115,34 @@ void CBOINCTaskCtrl::BeginTaskSection( const wxString& strLink, const wxString&
|
|||
}
|
||||
|
||||
|
||||
void CBOINCTaskCtrl::CreateTask( const wxString& strLink, const wxString& strTaskIconFilename, const wxString& strTaskName )
|
||||
void CBOINCTaskCtrl::CreateTask( const wxString& strLink, const wxString& strTaskIconFilename, const wxString& strTaskName, bool bHidden )
|
||||
{
|
||||
m_strTaskPage += wxT(" <tr>");
|
||||
m_strTaskPage += wxT(" <td valign=\"center\" width=\"100%\">");
|
||||
if ( !bHidden )
|
||||
{
|
||||
m_strTaskPage += wxT(" <tr>");
|
||||
m_strTaskPage += wxT(" <td valign=\"center\" width=\"100%\">");
|
||||
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" <a href=\"") + strLink + wxT("\">");
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" <a href=\"") + strLink + wxT("\">");
|
||||
|
||||
m_strTaskPage += wxT(" <img src=\"memory:") + strTaskIconFilename + wxT("\">");
|
||||
m_strTaskPage += wxT(" <img src=\"memory:") + strTaskIconFilename + wxT("\">");
|
||||
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" </a>");
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" </a>");
|
||||
|
||||
m_strTaskPage += wxT(" ");
|
||||
m_strTaskPage += wxT(" ");
|
||||
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" <a href=\"") + strLink + wxT("\">");
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" <a href=\"") + strLink + wxT("\">");
|
||||
|
||||
m_strTaskPage += wxT(" <font color=\"#000000\">") + strTaskName + wxT("</font>");
|
||||
m_strTaskPage += wxT(" <font color=\"#000000\">") + strTaskName + wxT("</font>");
|
||||
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" </a>");
|
||||
if ( !strLink.empty() )
|
||||
m_strTaskPage += wxT(" </a>");
|
||||
|
||||
m_strTaskPage += wxT(" </td>");
|
||||
m_strTaskPage += wxT(" </tr>");
|
||||
m_strTaskPage += wxT(" </td>");
|
||||
m_strTaskPage += wxT(" </tr>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,13 +321,13 @@ wxHtmlOpeningStatus CBOINCTaskCtrl::OnOpeningURL( wxHtmlURLType type, const wxSt
|
|||
template < class T >
|
||||
void CBOINCTaskCtrl::FireOnLinkClickedEvent( T pView, const wxHtmlLinkInfo& link )
|
||||
{
|
||||
return pView->OnLinkClicked( link );
|
||||
return pView->OnTaskLinkClicked( link );
|
||||
}
|
||||
|
||||
|
||||
template < class T >
|
||||
void CBOINCTaskCtrl::FireOnCellMouseHoverEvent( T pView, wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
{
|
||||
return pView->OnCellMouseHover( cell, x, y );
|
||||
return pView->OnTaskCellMouseHover( cell, x, y );
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 2004/09/24 02:01:47 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.3 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -58,7 +61,8 @@ public:
|
|||
bool bHidden );
|
||||
virtual void CreateTask( const wxString& strLink,
|
||||
const wxString& strTaskIconFilename,
|
||||
const wxString& strTaskName );
|
||||
const wxString& strTaskName,
|
||||
bool bHidden );
|
||||
virtual void EndTaskSection( bool bHidden );
|
||||
virtual void UpdateQuickTip( const wxString& strLink,
|
||||
const wxString& strIconFilename,
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.9 2004/09/24 02:01:47 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.8 2004/09/21 01:26:23 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -34,20 +37,20 @@
|
|||
#define _EVENTS_H_
|
||||
|
||||
|
||||
#define ID_STATUSBAR wxID_HIGHEST + 1
|
||||
#define ID_COMMANDSATTACHPROJECT wxID_HIGHEST + 2
|
||||
#define ID_TOOLSOPTIONS wxID_HIGHEST + 3
|
||||
#define ID_FRAMERENDERTIMER wxID_HIGHEST + 4
|
||||
#define ID_LIST_PROJECTSVIEW wxID_HIGHEST + 5
|
||||
#define ID_LIST_WORKVIEW wxID_HIGHEST + 6
|
||||
#define ID_LIST_TRANSFERSVIEW wxID_HIGHEST + 7
|
||||
#define ID_LIST_MESSAGESVIEW wxID_HIGHEST + 8
|
||||
#define ID_LIST_RESOURCEUTILIZATIONVIEW wxID_HIGHEST + 9
|
||||
#define ID_HTML_PROJECTSVIEW wxID_HIGHEST + 10
|
||||
#define ID_HTML_WORKVIEW wxID_HIGHEST + 11
|
||||
#define ID_HTML_TRANSFERSVIEW wxID_HIGHEST + 12
|
||||
#define ID_HTML_MESSAGESVIEW wxID_HIGHEST + 13
|
||||
#define ID_HTML_RESOURCEUTILIZATIONVIEW wxID_HIGHEST + 14
|
||||
#define ID_STATUSBAR 6000
|
||||
#define ID_COMMANDSATTACHPROJECT 6001
|
||||
#define ID_TOOLSOPTIONS 6002
|
||||
#define ID_FRAMERENDERTIMER 6003
|
||||
#define ID_LIST_PROJECTSVIEW 6004
|
||||
#define ID_LIST_WORKVIEW 6005
|
||||
#define ID_LIST_TRANSFERSVIEW 6006
|
||||
#define ID_LIST_MESSAGESVIEW 6007
|
||||
#define ID_LIST_RESOURCEUTILIZATIONVIEW 6008
|
||||
#define ID_HTML_PROJECTSVIEW 6009
|
||||
#define ID_HTML_WORKVIEW 6010
|
||||
#define ID_HTML_TRANSFERSVIEW 6011
|
||||
#define ID_HTML_MESSAGESVIEW 6012
|
||||
#define ID_HTML_RESOURCEUTILIZATIONVIEW 6013
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.21 2004/09/24 02:01:48 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.20 2004/09/22 21:53:03 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -75,7 +78,6 @@
|
|||
#include "ViewResources.h"
|
||||
#include "DlgAbout.h"
|
||||
#include "DlgOptions.h"
|
||||
#include "DlgAttachProject.h"
|
||||
|
||||
#include "res/BOINCGUIApp.xpm"
|
||||
|
||||
|
@ -83,14 +85,11 @@
|
|||
IMPLEMENT_DYNAMIC_CLASS(CMainFrame, wxFrame)
|
||||
|
||||
BEGIN_EVENT_TABLE (CMainFrame, wxFrame)
|
||||
EVT_CLOSE ( CMainFrame::OnClose)
|
||||
|
||||
EVT_MENU (wxID_EXIT, CMainFrame::OnExit)
|
||||
EVT_MENU (ID_COMMANDSATTACHPROJECT, CMainFrame::OnCommandsAttachProject)
|
||||
EVT_MENU (ID_TOOLSOPTIONS, CMainFrame::OnToolsOptions)
|
||||
EVT_MENU (wxID_ABOUT, CMainFrame::OnAbout)
|
||||
|
||||
EVT_TIMER (ID_FRAMERENDERTIMER, CMainFrame::OnFrameRender)
|
||||
EVT_CLOSE(CMainFrame::OnClose)
|
||||
EVT_TIMER(ID_FRAMERENDERTIMER, CMainFrame::OnFrameRender)
|
||||
EVT_MENU(wxID_EXIT, CMainFrame::OnExit)
|
||||
EVT_MENU(ID_TOOLSOPTIONS, CMainFrame::OnToolsOptions)
|
||||
EVT_MENU(wxID_ABOUT, CMainFrame::OnAbout)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
CMainFrame::CMainFrame()
|
||||
|
@ -118,7 +117,7 @@ CMainFrame::CMainFrame(wxString strTitle) :
|
|||
m_pFrameRenderTimer = new wxTimer(this, ID_FRAMERENDERTIMER);
|
||||
wxASSERT(NULL != m_pFrameRenderTimer);
|
||||
|
||||
m_pFrameRenderTimer->Start(5000); // Send event every 5 seconds
|
||||
m_pFrameRenderTimer->Start(1000); // Send event every 5 seconds
|
||||
|
||||
|
||||
RestoreState();
|
||||
|
@ -450,18 +449,6 @@ void CMainFrame::OnClose(wxCloseEvent &WXUNUSED(event))
|
|||
}
|
||||
|
||||
|
||||
void CMainFrame::OnCommandsAttachProject(wxCommandEvent &WXUNUSED(event))
|
||||
{
|
||||
CDlgAttachProject* pDlg = new CDlgAttachProject(this);
|
||||
wxASSERT(NULL != pDlg);
|
||||
|
||||
pDlg->ShowModal();
|
||||
|
||||
if (pDlg)
|
||||
pDlg->Destroy();
|
||||
}
|
||||
|
||||
|
||||
void CMainFrame::OnToolsOptions(wxCommandEvent &WXUNUSED(event))
|
||||
{
|
||||
CDlgOptions* pDlg = new CDlgOptions(this);
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.10 2004/09/24 02:01:49 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.9 2004/07/13 05:56:01 rwalton
|
||||
// Hooked up the Project and Work tab for the new GUI.
|
||||
//
|
||||
|
@ -43,6 +46,8 @@
|
|||
#pragma interface "MainFrame.cpp"
|
||||
#endif
|
||||
|
||||
class CViewProjects;
|
||||
class CViewWork;
|
||||
|
||||
class CMainFrame : public wxFrame
|
||||
{
|
||||
|
@ -57,7 +62,6 @@ public:
|
|||
void OnExit(wxCommandEvent &event);
|
||||
void OnClose(wxCloseEvent &event);
|
||||
|
||||
void OnCommandsAttachProject(wxCommandEvent &event);
|
||||
void OnToolsOptions(wxCommandEvent &event);
|
||||
void OnAbout(wxCommandEvent &event);
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:25 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -47,7 +50,6 @@
|
|||
IMPLEMENT_DYNAMIC_CLASS(CViewMessages, CBOINCBaseView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CViewMessages, CBOINCBaseView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_MESSAGESVIEW, CViewMessages::OnCacheHint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
@ -59,7 +61,7 @@ CViewMessages::CViewMessages()
|
|||
|
||||
|
||||
CViewMessages::CViewMessages(wxNotebook* pNotebook) :
|
||||
CBOINCBaseView(pNotebook, ID_LIST_MESSAGESVIEW, ID_HTML_MESSAGESVIEW)
|
||||
CBOINCBaseView(pNotebook, ID_HTML_MESSAGESVIEW, ID_LIST_MESSAGESVIEW)
|
||||
{
|
||||
m_bProcessingRenderEvent = false;
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 2004/09/24 02:01:51 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.3 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -43,6 +46,7 @@
|
|||
#include "DlgAttachProject.h"
|
||||
#include "Events.h"
|
||||
|
||||
#include "res/boinc.xpm"
|
||||
#include "res/proj.xpm"
|
||||
#include "res/task.xpm"
|
||||
#include "res/web.xpm"
|
||||
|
@ -59,6 +63,7 @@
|
|||
#define BITMAP_TASKHEADER SECTION_TASK ".xpm"
|
||||
#define BITMAP_WEBHEADER SECTION_WEB ".xpm"
|
||||
#define BITMAP_TIPSHEADER SECTION_TIPS ".xpm"
|
||||
#define BITMAP_BOINC "boinc.xpm"
|
||||
|
||||
#define LINK_TASKATTACH SECTION_TASK "attach"
|
||||
#define LINK_TASKDETACH SECTION_TASK "detach"
|
||||
|
@ -71,6 +76,9 @@
|
|||
#define LINK_WEBTEAM SECTION_WEB "team"
|
||||
#define LINK_WEBUSER SECTION_WEB "user"
|
||||
|
||||
#define LINK_DEFAULT "default"
|
||||
#define LINK_BLANK "blank"
|
||||
|
||||
#define COLUMN_PROJECT 0
|
||||
#define COLUMN_ACCOUNTNAME 1
|
||||
#define COLUMN_TEAMNAME 2
|
||||
|
@ -81,17 +89,9 @@
|
|||
|
||||
IMPLEMENT_DYNAMIC_CLASS(CViewProjects, CBOINCBaseView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CViewProjects, CBOINCBaseView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_PROJECTSVIEW, CViewProjects::OnCacheHint)
|
||||
EVT_LIST_ITEM_SELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListSelected)
|
||||
EVT_LIST_ITEM_DESELECTED(ID_LIST_PROJECTSVIEW, CViewProjects::OnListDeselected)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
CViewProjects::CViewProjects()
|
||||
{
|
||||
wxLogTrace(wxT("CViewProjects::CViewProjects - Function Begining"));
|
||||
wxLogTrace(wxT("CViewProjects::CViewProjects - Function Ending"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -107,13 +107,16 @@ CViewProjects::CViewProjects(wxNotebook* pNotebook) :
|
|||
wxBitmap bmpTask(task_xpm);
|
||||
wxBitmap bmpWeb(web_xpm);
|
||||
wxBitmap bmpTips(tips_xpm);
|
||||
wxBitmap bmpBOINC(boinc_xpm);
|
||||
|
||||
bmpProject.SetMask(new wxMask(bmpProject, wxColour(255, 0, 255)));
|
||||
bmpTask.SetMask(new wxMask(bmpTask, wxColour(255, 0, 255)));
|
||||
bmpWeb.SetMask(new wxMask(bmpWeb, wxColour(255, 0, 255)));
|
||||
bmpTips.SetMask(new wxMask(bmpTips, wxColour(255, 0, 255)));
|
||||
bmpBOINC.SetMask(new wxMask(bmpBOINC, wxColour(255, 0, 255)));
|
||||
|
||||
m_pTaskPane->AddVirtualFile(wxT(BITMAP_PROJECTS), bmpProject, wxBITMAP_TYPE_XPM);
|
||||
m_pTaskPane->AddVirtualFile(wxT(BITMAP_BOINC), bmpBOINC, wxBITMAP_TYPE_XPM);
|
||||
|
||||
m_pTaskPane->CreateTaskHeader(wxT(BITMAP_TASKHEADER), bmpTask, _("Tasks"));
|
||||
m_pTaskPane->CreateTaskHeader(wxT(BITMAP_WEBHEADER), bmpWeb, _("Websites"));
|
||||
|
@ -126,13 +129,14 @@ CViewProjects::CViewProjects(wxNotebook* pNotebook) :
|
|||
m_pListPane->InsertColumn(COLUMN_AVGCREDIT, _("Avg. Credit"), wxLIST_FORMAT_LEFT, -1);
|
||||
m_pListPane->InsertColumn(COLUMN_RESOURCESHARE, _("Resource Share"), wxLIST_FORMAT_LEFT, -1);
|
||||
|
||||
m_bTaskHeaderHidden = false;
|
||||
m_bWebsiteHeaderHidden = false;
|
||||
m_bTipsHeaderHidden = false;
|
||||
|
||||
m_strQuickTip = _("Please select a project to see additional options.");
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_DEFAULT),
|
||||
_("Please select a project to see additional options.")
|
||||
);
|
||||
|
||||
UpdateTaskPane();
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
|
||||
|
@ -155,15 +159,23 @@ char** CViewProjects::GetViewIcon()
|
|||
|
||||
void CViewProjects::OnRender(wxTimerEvent &event)
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxLogTrace(wxT("CViewProjects::OnRender - Processing Render Event..."));
|
||||
if (!m_bProcessingRenderEvent)
|
||||
{
|
||||
m_bProcessingRenderEvent = true;
|
||||
|
||||
wxInt32 iProjectCount = wxGetApp().GetDocument()->GetProjectCount();
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
m_pListPane->SetItemCount(iProjectCount);
|
||||
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( (-1 == lSelected) && m_bItemSelected )
|
||||
{
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
m_bProcessingRenderEvent = false;
|
||||
}
|
||||
else
|
||||
|
@ -173,125 +185,39 @@ void CViewProjects::OnRender(wxTimerEvent &event)
|
|||
}
|
||||
|
||||
|
||||
void CViewProjects::OnLinkClicked( const wxHtmlLinkInfo& link )
|
||||
{
|
||||
if ( link.GetHref() == wxT(SECTION_TASK) )
|
||||
m_bTaskHeaderHidden ? m_bTaskHeaderHidden = false : m_bTaskHeaderHidden = true;
|
||||
|
||||
|
||||
if ( link.GetHref() == wxT(LINK_TASKATTACH) )
|
||||
{
|
||||
CDlgAttachProject* pDlg = new CDlgAttachProject(this);
|
||||
wxASSERT(NULL != pDlg);
|
||||
|
||||
pDlg->ShowModal();
|
||||
|
||||
if (pDlg)
|
||||
pDlg->Destroy();
|
||||
}
|
||||
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_WEB) )
|
||||
m_bWebsiteHeaderHidden ? m_bWebsiteHeaderHidden = false : m_bWebsiteHeaderHidden = true;
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_TIPS) )
|
||||
m_bTipsHeaderHidden ? m_bTipsHeaderHidden = false : m_bTipsHeaderHidden = true;
|
||||
|
||||
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::OnCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
{
|
||||
wxString strLink;
|
||||
|
||||
if ( NULL != cell->GetLink() )
|
||||
strLink = cell->GetLink()->GetHref();
|
||||
|
||||
if ( wxT(LINK_TASKATTACH) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Attach to Project</b><br>"
|
||||
"Selecting attach to project allows you to join other BOINC "
|
||||
"projects. You will need a valid project URL and Authenticator.");
|
||||
}
|
||||
else if ( wxT(LINK_TASKDETACH) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Detach from Project</b><br>"
|
||||
"Selecting detach from project removes the computer from the currently "
|
||||
"selected project. You may wish to update the project first to submit "
|
||||
"any completed work.");
|
||||
}
|
||||
else if ( wxT(LINK_TASKUPDATE) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Update Project</b><br>"
|
||||
"Selecting update project submits any outstanding work and refreshes "
|
||||
"your credit and preferences for the currently selected project.");
|
||||
}
|
||||
else if ( wxT(LINK_TASKRESET) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Reset Project</b><br>"
|
||||
"Selecting reset project removes all workunits and applications from "
|
||||
"the currently selected project. You may wish to update the project "
|
||||
"first to submit any completed work.");
|
||||
}
|
||||
else if ( wxT(LINK_WEBBOINC) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>BOINC Homepage</b><br>"
|
||||
"This will open a browser window to the BOINC homepage.");
|
||||
}
|
||||
else if ( wxT(LINK_WEBFAQ) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>FAQ</b><br>"
|
||||
"This will open a browser window to the BOINC FAQ.");
|
||||
}
|
||||
else if ( wxT(LINK_WEBPROJECT) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Project Homepage</b><br>"
|
||||
"This will open a browser window to the currently selected project "
|
||||
"homepage.");
|
||||
}
|
||||
else if ( wxT(LINK_WEBTEAM) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Team Homepage</b><br>"
|
||||
"This will open a browser window to your team homepage for the currently "
|
||||
"selected project.");
|
||||
}
|
||||
else if ( wxT(LINK_WEBUSER) == strLink )
|
||||
{
|
||||
m_strQuickTip = _("<b>Your Homepage</b><br>"
|
||||
"This will open a browser window to your homepage for the currently "
|
||||
"selected project.");
|
||||
}
|
||||
else
|
||||
m_strQuickTip.Empty();
|
||||
|
||||
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::OnListSelected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace(wxT("CViewProjects::OnListSelected - Function Begining"));
|
||||
|
||||
wxLogTrace("CViewProjects::OnListSelected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
|
||||
wxLogTrace(wxT("CViewProjects::OnListSelected - Function Ending"));
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::OnListDeselected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace(wxT("CViewProjects::OnListDeselected - Function Begining"));
|
||||
|
||||
wxLogTrace("CViewProjects::OnListDeselected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
|
||||
wxLogTrace(wxT("CViewProjects::OnListDeselected - Function Ending"));
|
||||
}
|
||||
|
||||
|
||||
wxString CViewProjects::OnGetItemText(long item, long column) const {
|
||||
void CViewProjects::OnListActivated ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewProjects::OnListActivated - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::OnListFocused ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewProjects::OnListFocused - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxString CViewProjects::OnListGetItemText(long item, long column) const {
|
||||
wxString strBuffer;
|
||||
switch(column) {
|
||||
case COLUMN_PROJECT:
|
||||
|
@ -319,6 +245,299 @@ wxString CViewProjects::OnGetItemText(long item, long column) const {
|
|||
}
|
||||
|
||||
|
||||
void CViewProjects::OnTaskLinkClicked( const wxHtmlLinkInfo& link )
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxString strMessage;
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_TASK) )
|
||||
m_bTaskHeaderHidden ? m_bTaskHeaderHidden = false : m_bTaskHeaderHidden = true;
|
||||
|
||||
|
||||
if ( link.GetHref() == wxT(LINK_TASKATTACH) )
|
||||
{
|
||||
CDlgAttachProject* pDlg = new CDlgAttachProject(this);
|
||||
wxASSERT(NULL != pDlg);
|
||||
|
||||
pDlg->ShowModal();
|
||||
|
||||
if (pDlg)
|
||||
pDlg->Destroy();
|
||||
}
|
||||
|
||||
if ( link.GetHref() == wxT(LINK_TASKDETACH) )
|
||||
{
|
||||
strMessage.Printf(
|
||||
_("Are you sure you wish to detach from project '%s'?"),
|
||||
wxGetApp().GetDocument()->GetProjectProjectName(m_pListPane->GetFirstSelected()).c_str());
|
||||
|
||||
int iAnswer = wxMessageBox(
|
||||
strMessage,
|
||||
_("Detach from Project"),
|
||||
wxYES_NO | wxICON_QUESTION,
|
||||
this
|
||||
);
|
||||
|
||||
if ( wxYES == iAnswer )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ( link.GetHref() == wxT(LINK_TASKUPDATE) )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if ( link.GetHref() == wxT(LINK_TASKRESET) )
|
||||
{
|
||||
strMessage.Printf(
|
||||
_("Are you sure you wish to reset project '%s'?"),
|
||||
wxGetApp().GetDocument()->GetProjectProjectName(m_pListPane->GetFirstSelected()).c_str());
|
||||
|
||||
int iAnswer = wxMessageBox(
|
||||
strMessage,
|
||||
_("Reset Project"),
|
||||
wxYES_NO | wxICON_QUESTION,
|
||||
this
|
||||
);
|
||||
|
||||
if ( wxYES == iAnswer )
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_WEB) )
|
||||
m_bWebsiteHeaderHidden ? m_bWebsiteHeaderHidden = false : m_bWebsiteHeaderHidden = true;
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_TIPS) )
|
||||
m_bTipsHeaderHidden ? m_bTipsHeaderHidden = false : m_bTipsHeaderHidden = true;
|
||||
|
||||
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
{
|
||||
if ( NULL != cell->GetLink() )
|
||||
{
|
||||
bool bUpdateTaskPane = false;
|
||||
wxString strLink;
|
||||
|
||||
strLink = cell->GetLink()->GetHref();
|
||||
|
||||
if ( wxT(LINK_TASKATTACH) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKATTACH) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKATTACH),
|
||||
_("<b>Attach to Project</b><br>"
|
||||
"Selecting attach to project allows you to join other BOINC "
|
||||
"projects. You will need a valid project URL and Authenticator.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_TASKDETACH) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKDETACH) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKDETACH),
|
||||
_("<b>Detach from Project</b><br>"
|
||||
"Selecting detach from project removes the computer from the currently "
|
||||
"selected project. You may wish to update the project first to submit "
|
||||
"any completed work.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_TASKUPDATE) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKUPDATE) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKUPDATE),
|
||||
_("<b>Update Project</b><br>"
|
||||
"Selecting update project submits any outstanding work and refreshes "
|
||||
"your credit and preferences for the currently selected project.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_TASKRESET) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKRESET) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKRESET),
|
||||
_("<b>Reset Project</b><br>"
|
||||
"Selecting reset project removes all workunits and applications from "
|
||||
"the currently selected project. You may wish to update the project "
|
||||
"first to submit any completed work.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_WEBBOINC) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_WEBBOINC) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_WEBBOINC),
|
||||
_("<b>BOINC Homepage</b><br>"
|
||||
"This will open a browser window to the BOINC homepage.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_WEBFAQ) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_WEBFAQ) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_WEBFAQ),
|
||||
_("<b>FAQ</b><br>"
|
||||
"This will open a browser window to the BOINC FAQ.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_WEBPROJECT) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_WEBPROJECT) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_WEBPROJECT),
|
||||
_("<b>Project Homepage</b><br>"
|
||||
"This will open a browser window to the currently selected project "
|
||||
"homepage.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_WEBTEAM) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_WEBTEAM) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_WEBTEAM),
|
||||
_("<b>Team Homepage</b><br>"
|
||||
"This will open a browser window to your team homepage for the currently "
|
||||
"selected project.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_WEBUSER) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_WEBUSER) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_WEBTEAM),
|
||||
_("<b>Your Homepage</b><br>"
|
||||
"This will open a browser window to your homepage for the currently "
|
||||
"selected project.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( -1 == lSelected )
|
||||
{
|
||||
if ( wxT(LINK_DEFAULT) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_DEFAULT),
|
||||
_("Please select a project to see additional options.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( wxT(LINK_BLANK) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_BLANK),
|
||||
wxT("")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( bUpdateTaskPane )
|
||||
{
|
||||
UpdateTaskPane();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::UpdateSelection()
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( -1 == lSelected )
|
||||
{
|
||||
m_bTaskHeaderHidden = false;
|
||||
m_bTaskAttachToProjectHidden = false;
|
||||
m_bTaskDetachFromProjectHidden = true;
|
||||
m_bTaskUpdateProjectHidden = true;
|
||||
m_bTaskResetProjectHidden = true;
|
||||
|
||||
m_bWebsiteHeaderHidden = false;
|
||||
m_bWebsiteBOINCHidden = false;
|
||||
m_bWebsiteFAQHidden = false;
|
||||
m_bWebsiteProjectHidden = true;
|
||||
m_bWebsiteTeamHidden = true;
|
||||
m_bWebsiteUserHidden = true;
|
||||
|
||||
m_bItemSelected = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bTaskHeaderHidden = false;
|
||||
m_bTaskAttachToProjectHidden = false;
|
||||
m_bTaskDetachFromProjectHidden = false;
|
||||
m_bTaskUpdateProjectHidden = false;
|
||||
m_bTaskResetProjectHidden = false;
|
||||
|
||||
m_bWebsiteHeaderHidden = false;
|
||||
m_bWebsiteBOINCHidden = false;
|
||||
m_bWebsiteFAQHidden = false;
|
||||
m_bWebsiteProjectHidden = false;
|
||||
m_bWebsiteTeamHidden = false;
|
||||
m_bWebsiteUserHidden = false;
|
||||
|
||||
m_bItemSelected = true;
|
||||
}
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewProjects::UpdateTaskPane()
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
|
@ -328,10 +547,10 @@ void CViewProjects::UpdateTaskPane()
|
|||
m_pTaskPane->BeginTaskSection( wxT(SECTION_TASK), wxT(BITMAP_TASKHEADER), m_bTaskHeaderHidden );
|
||||
if (!m_bTaskHeaderHidden)
|
||||
{
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKATTACH), wxT(BITMAP_PROJECTS), _("Attach to Project") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKDETACH), wxT(BITMAP_PROJECTS), _("Detach from Project") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKUPDATE), wxT(BITMAP_PROJECTS), _("Update Project") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKRESET), wxT(BITMAP_PROJECTS), _("Reset Project") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKATTACH), wxT(BITMAP_PROJECTS), _("Attach to Project"), m_bTaskAttachToProjectHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKDETACH), wxT(BITMAP_PROJECTS), _("Detach from Project"), m_bTaskDetachFromProjectHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKUPDATE), wxT(BITMAP_PROJECTS), _("Update Project"), m_bTaskUpdateProjectHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKRESET), wxT(BITMAP_PROJECTS), _("Reset Project"), m_bTaskResetProjectHidden );
|
||||
}
|
||||
m_pTaskPane->EndTaskSection( m_bTaskHeaderHidden );
|
||||
|
||||
|
@ -339,15 +558,15 @@ void CViewProjects::UpdateTaskPane()
|
|||
m_pTaskPane->BeginTaskSection( wxT(SECTION_WEB), wxT(BITMAP_WEBHEADER), m_bWebsiteHeaderHidden );
|
||||
if (!m_bWebsiteHeaderHidden)
|
||||
{
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBBOINC), wxT(BITMAP_PROJECTS), _("BOINC") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBFAQ), wxT(BITMAP_PROJECTS), _("FAQ") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBPROJECT), wxT(BITMAP_PROJECTS), _("Project") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBTEAM), wxT(BITMAP_PROJECTS), _("Team") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBUSER), wxT(BITMAP_PROJECTS), _("User") );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBBOINC), wxT(BITMAP_BOINC), _("BOINC"), m_bWebsiteBOINCHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBFAQ), wxT(BITMAP_BOINC), _("FAQ"), m_bWebsiteFAQHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBPROJECT), wxT(BITMAP_PROJECTS), _("Project"), m_bWebsiteProjectHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBTEAM), wxT(BITMAP_PROJECTS), _("Team"), m_bWebsiteTeamHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_WEBUSER), wxT(BITMAP_PROJECTS), _("User"), m_bWebsiteUserHidden );
|
||||
}
|
||||
m_pTaskPane->EndTaskSection(m_bWebsiteHeaderHidden);
|
||||
|
||||
m_pTaskPane->UpdateQuickTip(wxT(SECTION_TIPS), wxT(BITMAP_TIPSHEADER), m_strQuickTip, m_bTipsHeaderHidden);
|
||||
m_pTaskPane->UpdateQuickTip(wxT(SECTION_TIPS), wxT(BITMAP_TIPSHEADER), GetCurrentQuickTipText(), m_bTipsHeaderHidden);
|
||||
|
||||
m_pTaskPane->EndTaskPage();
|
||||
}
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.4 2004/09/24 02:01:52 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.3 2004/09/23 08:28:50 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -47,7 +50,6 @@
|
|||
class CViewProjects : public CBOINCBaseView
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS( CViewProjects )
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
public:
|
||||
CViewProjects();
|
||||
|
@ -60,11 +62,14 @@ public:
|
|||
|
||||
virtual void OnRender( wxTimerEvent& event );
|
||||
|
||||
virtual void OnLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
virtual void OnListSelected( wxListEvent& event );
|
||||
virtual void OnListDeselected( wxListEvent& event );
|
||||
virtual wxString OnGetItemText( long item, long column ) const;
|
||||
virtual void OnListActivated( wxListEvent& event );
|
||||
virtual void OnListFocused( wxListEvent& event );
|
||||
virtual wxString OnListGetItemText( long item, long column ) const;
|
||||
|
||||
virtual void OnTaskLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
|
||||
private:
|
||||
|
||||
|
@ -75,13 +80,18 @@ private:
|
|||
bool m_bTaskResetProjectHidden;
|
||||
|
||||
bool m_bWebsiteHeaderHidden;
|
||||
bool m_bWebsiteBOINCHidden;
|
||||
bool m_bWebsiteFAQHidden;
|
||||
bool m_bWebsiteProjectHidden;
|
||||
bool m_bWebsiteTeamHidden;
|
||||
bool m_bWebsiteUserHidden;
|
||||
|
||||
bool m_bTipsHeaderHidden;
|
||||
|
||||
wxString m_strQuickTip;
|
||||
bool m_bItemSelected;
|
||||
|
||||
virtual void UpdateSelection();
|
||||
virtual void UpdateTaskPane();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:53 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:25 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -42,7 +45,6 @@
|
|||
IMPLEMENT_DYNAMIC_CLASS(CViewResources, CBOINCBaseView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CViewResources, CBOINCBaseView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_RESOURCEUTILIZATIONVIEW, CViewResources::OnCacheHint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
@ -54,7 +56,7 @@ CViewResources::CViewResources()
|
|||
|
||||
|
||||
CViewResources::CViewResources(wxNotebook* pNotebook) :
|
||||
CBOINCBaseView(pNotebook, ID_LIST_RESOURCEUTILIZATIONVIEW, ID_HTML_RESOURCEUTILIZATIONVIEW)
|
||||
CBOINCBaseView(pNotebook, ID_HTML_RESOURCEUTILIZATIONVIEW, ID_LIST_RESOURCEUTILIZATIONVIEW)
|
||||
{
|
||||
m_bProcessingRenderEvent = false;
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:53 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:25 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -51,7 +54,6 @@
|
|||
IMPLEMENT_DYNAMIC_CLASS(CViewTransfers, CBOINCBaseView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CViewTransfers, CBOINCBaseView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_TRANSFERSVIEW, CViewTransfers::OnCacheHint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
|
@ -63,7 +65,7 @@ CViewTransfers::CViewTransfers()
|
|||
|
||||
|
||||
CViewTransfers::CViewTransfers(wxNotebook* pNotebook) :
|
||||
CBOINCBaseView(pNotebook, ID_LIST_TRANSFERSVIEW, ID_HTML_TRANSFERSVIEW)
|
||||
CBOINCBaseView(pNotebook, ID_HTML_TRANSFERSVIEW, ID_LIST_TRANSFERSVIEW)
|
||||
{
|
||||
m_bProcessingRenderEvent = false;
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:53 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:26 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -36,9 +39,28 @@
|
|||
#include "ViewWork.h"
|
||||
#include "Events.h"
|
||||
|
||||
#include "res/boinc.xpm"
|
||||
#include "res/result.xpm"
|
||||
#include "res/task.xpm"
|
||||
#include "res/tips.xpm"
|
||||
|
||||
|
||||
#define VIEW_HEADER "result"
|
||||
|
||||
#define SECTION_TASK VIEW_HEADER "task"
|
||||
#define SECTION_TIPS VIEW_HEADER "tips"
|
||||
|
||||
#define BITMAP_RESULTS VIEW_HEADER ".xpm"
|
||||
#define BITMAP_TASKHEADER SECTION_TASK ".xpm"
|
||||
#define BITMAP_TIPSHEADER SECTION_TIPS ".xpm"
|
||||
|
||||
#define LINK_TASKSUSPENDRESUME SECTION_TASK "suspendresume"
|
||||
#define LINK_TASKSHOWGRAPHICS SECTION_TASK "showgraphics"
|
||||
#define LINK_TASKABORT SECTION_TASK "abort"
|
||||
|
||||
#define LINK_DEFAULT "default"
|
||||
#define LINK_BLANK "blank"
|
||||
|
||||
#define COLUMN_PROJECT 0
|
||||
#define COLUMN_APPLICATION 1
|
||||
#define COLUMN_NAME 2
|
||||
|
@ -51,26 +73,33 @@
|
|||
|
||||
IMPLEMENT_DYNAMIC_CLASS(CViewWork, CBOINCBaseView)
|
||||
|
||||
BEGIN_EVENT_TABLE(CViewWork, CBOINCBaseView)
|
||||
EVT_LIST_CACHE_HINT(ID_LIST_TRANSFERSVIEW, CViewWork::OnCacheHint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
CViewWork::CViewWork()
|
||||
{
|
||||
wxLogTrace("CViewWork::CViewWork - Function Begining");
|
||||
wxLogTrace("CViewWork::CViewWork - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
CViewWork::CViewWork(wxNotebook* pNotebook) :
|
||||
CBOINCBaseView(pNotebook, ID_LIST_WORKVIEW, ID_HTML_WORKVIEW)
|
||||
CBOINCBaseView(pNotebook, ID_HTML_WORKVIEW, ID_LIST_WORKVIEW)
|
||||
{
|
||||
m_bProcessingRenderEvent = false;
|
||||
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxBitmap bmpResult(result_xpm);
|
||||
wxBitmap bmpTask(task_xpm);
|
||||
wxBitmap bmpTips(tips_xpm);
|
||||
|
||||
bmpResult.SetMask(new wxMask(bmpResult, wxColour(255, 0, 255)));
|
||||
bmpTask.SetMask(new wxMask(bmpTask, wxColour(255, 0, 255)));
|
||||
bmpTips.SetMask(new wxMask(bmpTips, wxColour(255, 0, 255)));
|
||||
|
||||
m_pTaskPane->AddVirtualFile(wxT(BITMAP_RESULTS), bmpResult, wxBITMAP_TYPE_XPM);
|
||||
|
||||
m_pTaskPane->CreateTaskHeader(wxT(BITMAP_TASKHEADER), bmpTask, _("Tasks"));
|
||||
m_pTaskPane->CreateTaskHeader(wxT(BITMAP_TIPSHEADER), bmpTips, _("Quick Tips"));
|
||||
|
||||
m_pListPane->InsertColumn(COLUMN_PROJECT, _("Project"), wxLIST_FORMAT_LEFT, -1);
|
||||
m_pListPane->InsertColumn(COLUMN_APPLICATION, _("Application"), wxLIST_FORMAT_LEFT, -1);
|
||||
m_pListPane->InsertColumn(COLUMN_NAME, _("Name"), wxLIST_FORMAT_LEFT, -1);
|
||||
|
@ -79,13 +108,20 @@ CViewWork::CViewWork(wxNotebook* pNotebook) :
|
|||
m_pListPane->InsertColumn(COLUMN_TOCOMPLETETION, _("To Completetion"), wxLIST_FORMAT_LEFT, -1);
|
||||
m_pListPane->InsertColumn(COLUMN_REPORTDEADLINE, _("Report Deadline"), wxLIST_FORMAT_LEFT, -1);
|
||||
m_pListPane->InsertColumn(COLUMN_STATUS, _("Status"), wxLIST_FORMAT_LEFT, -1);
|
||||
|
||||
m_bTipsHeaderHidden = false;
|
||||
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_DEFAULT),
|
||||
_("Please select a result to see additional options.")
|
||||
);
|
||||
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
|
||||
CViewWork::~CViewWork()
|
||||
{
|
||||
wxLogTrace("CViewWork::~CViewWork - Function Begining");
|
||||
wxLogTrace("CViewWork::~CViewWork - Function Ending");
|
||||
}
|
||||
|
||||
|
||||
|
@ -103,15 +139,23 @@ char** CViewWork::GetViewIcon()
|
|||
|
||||
void CViewWork::OnRender(wxTimerEvent &event)
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxLogTrace("CViewWork::OnRender - Processing Render Event...");
|
||||
if (!m_bProcessingRenderEvent)
|
||||
{
|
||||
m_bProcessingRenderEvent = true;
|
||||
|
||||
wxInt32 iProjectCount = wxGetApp().GetDocument()->GetWorkCount();
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
m_pListPane->SetItemCount(iProjectCount);
|
||||
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( (-1 == lSelected) && m_bItemSelected )
|
||||
{
|
||||
UpdateSelection();
|
||||
}
|
||||
|
||||
m_bProcessingRenderEvent = false;
|
||||
}
|
||||
else
|
||||
|
@ -121,7 +165,39 @@ void CViewWork::OnRender(wxTimerEvent &event)
|
|||
}
|
||||
|
||||
|
||||
wxString CViewWork::OnGetItemText(long item, long column) const
|
||||
void CViewWork::OnListSelected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewWork::OnListSelected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::OnListDeselected ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewWork::OnListDeselected - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::OnListActivated ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewWork::OnListActivated - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::OnListFocused ( wxListEvent& event )
|
||||
{
|
||||
wxLogTrace("CViewWork::OnListFocused - Processing Event...");
|
||||
UpdateSelection();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
wxString CViewWork::OnListGetItemText(long item, long column) const
|
||||
{
|
||||
wxString strBuffer;
|
||||
switch(column) {
|
||||
|
@ -155,3 +231,158 @@ wxString CViewWork::OnGetItemText(long item, long column) const
|
|||
return strBuffer;
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::OnTaskLinkClicked( const wxHtmlLinkInfo& link )
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
wxString strMessage;
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_TASK) )
|
||||
m_bTaskHeaderHidden ? m_bTaskHeaderHidden = false : m_bTaskHeaderHidden = true;
|
||||
|
||||
if ( link.GetHref() == wxT(SECTION_TIPS) )
|
||||
m_bTipsHeaderHidden ? m_bTipsHeaderHidden = false : m_bTipsHeaderHidden = true;
|
||||
|
||||
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y )
|
||||
{
|
||||
if ( NULL != cell->GetLink() )
|
||||
{
|
||||
bool bUpdateTaskPane = false;
|
||||
wxString strLink;
|
||||
|
||||
strLink = cell->GetLink()->GetHref();
|
||||
|
||||
if ( wxT(LINK_TASKSUSPENDRESUME) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKSUSPENDRESUME) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKSUSPENDRESUME),
|
||||
_("<b>Suspend/Resume</b><br>"
|
||||
"Selecting suspend/resume allows you to suspend or resume the "
|
||||
"currently selected result.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_TASKSHOWGRAPHICS) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKSHOWGRAPHICS) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKSHOWGRAPHICS),
|
||||
_("<b>Show Graphics</b><br>"
|
||||
"Selecting show graphics will display a window giving you a chance "
|
||||
"to see how the active result will look while in screensaver mode.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else if ( wxT(LINK_TASKABORT) == strLink )
|
||||
{
|
||||
if ( wxT(LINK_TASKABORT) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_TASKABORT),
|
||||
_("<b>Abort Result</b><br>"
|
||||
"Selecting abort result will delete the result from the work queue. "
|
||||
"Doing this will keep you from being granted any credit for this result.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( -1 == lSelected )
|
||||
{
|
||||
if ( wxT(LINK_DEFAULT) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_DEFAULT),
|
||||
_("Please select a result to see additional options.")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( wxT(LINK_BLANK) != GetCurrentQuickTip() )
|
||||
{
|
||||
SetCurrentQuickTip(
|
||||
wxT(LINK_BLANK),
|
||||
wxT("")
|
||||
);
|
||||
|
||||
bUpdateTaskPane = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( bUpdateTaskPane )
|
||||
{
|
||||
UpdateTaskPane();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::UpdateSelection()
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
wxASSERT(NULL != m_pListPane);
|
||||
|
||||
long lSelected = m_pListPane->GetFirstSelected();
|
||||
if ( -1 == lSelected )
|
||||
{
|
||||
m_bTaskHeaderHidden = true;
|
||||
m_bTaskSuspendResumeHidden = true;
|
||||
m_bTaskShowGraphicsHidden = true;
|
||||
m_bTaskAbortHidden = true;
|
||||
|
||||
m_bItemSelected = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bTaskHeaderHidden = false;
|
||||
m_bTaskSuspendResumeHidden = false;
|
||||
m_bTaskShowGraphicsHidden = false;
|
||||
m_bTaskAbortHidden = false;
|
||||
|
||||
m_bItemSelected = true;
|
||||
}
|
||||
UpdateTaskPane();
|
||||
}
|
||||
|
||||
|
||||
void CViewWork::UpdateTaskPane()
|
||||
{
|
||||
wxASSERT(NULL != m_pTaskPane);
|
||||
|
||||
m_pTaskPane->BeginTaskPage();
|
||||
|
||||
m_pTaskPane->BeginTaskSection( wxT(SECTION_TASK), wxT(BITMAP_TASKHEADER), m_bTaskHeaderHidden );
|
||||
if (!m_bTaskHeaderHidden)
|
||||
{
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKSUSPENDRESUME), wxT(BITMAP_RESULTS), _("Suspend/Resume"), m_bTaskSuspendResumeHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKSHOWGRAPHICS), wxT(BITMAP_RESULTS), _("Show Graphics"), m_bTaskShowGraphicsHidden );
|
||||
m_pTaskPane->CreateTask( wxT(LINK_TASKABORT), wxT(BITMAP_RESULTS), _("Abort Result"), m_bTaskAbortHidden );
|
||||
}
|
||||
m_pTaskPane->EndTaskSection( m_bTaskHeaderHidden );
|
||||
|
||||
m_pTaskPane->UpdateQuickTip(wxT(SECTION_TIPS), wxT(BITMAP_TIPSHEADER), GetCurrentQuickTipText(), m_bTipsHeaderHidden);
|
||||
|
||||
m_pTaskPane->EndTaskPage();
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.2 2004/09/24 02:01:53 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.1 2004/09/21 01:26:26 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -53,12 +56,28 @@ public:
|
|||
|
||||
virtual void OnRender( wxTimerEvent& event );
|
||||
|
||||
virtual wxString OnGetItemText(long item, long column) const;
|
||||
virtual void OnListSelected( wxListEvent& event );
|
||||
virtual void OnListDeselected( wxListEvent& event );
|
||||
virtual void OnListActivated( wxListEvent& event );
|
||||
virtual void OnListFocused( wxListEvent& event );
|
||||
virtual wxString OnListGetItemText( long item, long column ) const;
|
||||
|
||||
virtual void OnTaskLinkClicked( const wxHtmlLinkInfo& link );
|
||||
virtual void OnTaskCellMouseHover( wxHtmlCell* cell, wxCoord x, wxCoord y );
|
||||
|
||||
private:
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
bool m_bTaskHeaderHidden;
|
||||
bool m_bTaskSuspendResumeHidden;
|
||||
bool m_bTaskShowGraphicsHidden;
|
||||
bool m_bTaskAbortHidden;
|
||||
|
||||
bool m_bTipsHeaderHidden;
|
||||
|
||||
bool m_bItemSelected;
|
||||
|
||||
virtual void UpdateSelection();
|
||||
virtual void UpdateTaskPane();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
// Revision History:
|
||||
//
|
||||
// $Log$
|
||||
// Revision 1.10 2004/09/24 02:01:53 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
// Revision 1.9 2004/09/21 01:26:23 rwalton
|
||||
// *** empty log message ***
|
||||
//
|
||||
|
@ -79,7 +82,7 @@
|
|||
#include <wx/txtstrm.h> // text streams support
|
||||
#include <wx/datetime.h> // date/time support
|
||||
#include <wx/dynarray.h> // dynamic array support
|
||||
|
||||
#include <wx/utils.h>
|
||||
|
||||
// Standard Libraries
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue