2003-07-15 18:19:29 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
2002-12-18 20:24:56 +00:00
|
|
|
// 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
|
2003-07-15 18:19:29 +00:00
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
2002-12-18 20:24:56 +00:00
|
|
|
//
|
|
|
|
// 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):
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef __WIN_LISTCTRL_H_
|
|
|
|
#define __WIN_LISTCTRL_H_
|
|
|
|
|
|
|
|
// constants
|
|
|
|
|
|
|
|
#ifndef IDC_HAND
|
|
|
|
#define IDC_HAND MAKEINTRESOURCE(32649) // hand pointer, the "hidden resource"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SORT_ASCEND 0 // sorting orders
|
|
|
|
#define SORT_DESCEND 1
|
|
|
|
|
2004-09-23 18:58:06 +00:00
|
|
|
#define SORT_ALPHA 0 //sorting types
|
|
|
|
#define SORT_NUMERIC 1
|
|
|
|
|
2002-12-18 20:24:56 +00:00
|
|
|
//////////
|
|
|
|
// class: CProgressBarCtrl
|
|
|
|
// parent: CProgressCtrl
|
|
|
|
// description: forwards specific mouse messages to parent window.
|
|
|
|
class CProgressBarCtrl : public CProgressCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CProgressBarCtrl();
|
2003-01-21 05:41:47 +00:00
|
|
|
double SetPos(double);
|
|
|
|
double GetPos();
|
|
|
|
void SetTextColor(COLORREF);
|
|
|
|
void SetBarColor(COLORREF);
|
|
|
|
void SetBkColor(COLORREF);
|
2002-12-18 20:24:56 +00:00
|
|
|
|
|
|
|
protected:
|
2003-01-21 05:41:47 +00:00
|
|
|
COLORREF m_crText;
|
|
|
|
double m_xPos;
|
|
|
|
|
2002-12-19 00:41:06 +00:00
|
|
|
afx_msg void OnPaint();
|
2002-12-18 20:24:56 +00:00
|
|
|
afx_msg void OnLButtonDown(UINT, CPoint);
|
|
|
|
afx_msg void OnLButtonUp(UINT, CPoint);
|
|
|
|
afx_msg void OnRButtonDown(UINT, CPoint);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////
|
|
|
|
// class: CProgressHeaderCtrl
|
|
|
|
// parent: CHeaderCtrl
|
|
|
|
// description: forwards specific mouse messages to parent window.
|
|
|
|
class CProgressHeaderCtrl : public CHeaderCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CProgressHeaderCtrl();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
afx_msg void OnRButtonDown(UINT, CPoint);
|
|
|
|
afx_msg void OnRButtonUp(UINT, CPoint);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
|
|
|
//////////
|
|
|
|
// class: CProgressListCtrl
|
|
|
|
// parent: CListCtrl
|
|
|
|
// description: extends basic functionality of standard list control by
|
|
|
|
// allowind embedded progress controls, sorting by columns,
|
|
|
|
// and hiding columns.
|
|
|
|
class CProgressListCtrl : public CListCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CProgressListCtrl();
|
|
|
|
~CProgressListCtrl();
|
|
|
|
BOOL DeleteItem(int);
|
2003-01-21 05:41:47 +00:00
|
|
|
void SetItemProgress(int, int, double);
|
2003-06-03 22:44:50 +00:00
|
|
|
double GetItemProgress(int, int);
|
2002-12-18 20:24:56 +00:00
|
|
|
void RepositionProgress();
|
2004-09-23 18:58:06 +00:00
|
|
|
int InsertColumn(int, LPCTSTR, int, int, int, int);
|
2002-12-18 20:24:56 +00:00
|
|
|
int InsertItem(int, LPCTSTR);
|
|
|
|
void GetTextRect(int, int, LPRECT);
|
2003-01-28 01:22:47 +00:00
|
|
|
void GetColumnTitle(int, CString&);
|
2002-12-18 20:24:56 +00:00
|
|
|
int GetColumnWidth(int);
|
2003-03-25 00:01:18 +00:00
|
|
|
CString GetItemTextOrPos(int, int);
|
2002-12-18 20:24:56 +00:00
|
|
|
BOOL SetColumnWidth(int, int);
|
|
|
|
void SetItemColor(int, COLORREF);
|
|
|
|
void SetMenuItems(char**, int);
|
2003-01-28 01:22:47 +00:00
|
|
|
void SaveInactive(char*, char*);
|
|
|
|
void LoadInactive(char*, char*);
|
2003-05-20 23:55:52 +00:00
|
|
|
void SetProjectURL(int, char*);
|
|
|
|
CString GetProjectURL(int);
|
2002-12-18 20:24:56 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
CMenu m_PopupMenu; // context menu for header
|
|
|
|
CMapStringToOb m_Progs; // maps coordinate string to progress control
|
|
|
|
CProgressHeaderCtrl m_Header; // header for subclassing
|
|
|
|
int m_nSort; // column and order of last sort: i = 0: no sort; i > 0: sorted ascending by col i - 1; < 0 sorted descending by col -(i-1)
|
|
|
|
CFont* m_OldFont; // old font for setting subitem font
|
2004-03-04 11:41:43 +00:00
|
|
|
CArray<int,int> m_ColWidths; // column widths for hiding and unhiding; a[i] > 0: col i shown; a[i] < 0: col i hidden, previous width -(a[i] - 1)
|
2004-09-23 18:58:06 +00:00
|
|
|
CArray<int,int> m_ColType; // column type for sorting; a[i] == 0: alpha; a[i]==1 :numeric
|
2003-05-20 23:55:52 +00:00
|
|
|
CArray<COLORREF,COLORREF> m_ItemColors; // special colors of items
|
|
|
|
CArray<CString,CString> m_ProjectURLs; // urls for project links
|
2002-12-18 20:24:56 +00:00
|
|
|
|
|
|
|
void SwapItems(int, int);
|
2003-03-25 00:01:18 +00:00
|
|
|
void QSort(int, int, int, int);
|
2002-12-18 20:24:56 +00:00
|
|
|
void Sort(int, int);
|
|
|
|
void SwapColumnVisibility(int);
|
|
|
|
|
|
|
|
afx_msg BOOL OnCommand(WPARAM, LPARAM);
|
|
|
|
afx_msg int OnCreate(LPCREATESTRUCT);
|
|
|
|
afx_msg void OnDestroy();
|
|
|
|
afx_msg BOOL OnNotify(WPARAM, LPARAM, LRESULT*);
|
|
|
|
afx_msg void OnCustomDraw(NMHDR*, LRESULT*);
|
|
|
|
afx_msg void OnPaint();
|
2003-06-23 20:22:24 +00:00
|
|
|
//afx_msg void OnLButtonDown(UINT, CPoint); // Removed to allow highlighting.
|
2002-12-18 20:24:56 +00:00
|
|
|
afx_msg void OnRButtonDown(UINT, CPoint);
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
};
|
|
|
|
|
2004-03-04 11:41:43 +00:00
|
|
|
|
2002-12-18 20:24:56 +00:00
|
|
|
#endif
|