Menu

[r1075]: / trunk / src / MainDlg.h  Maximize  Restore  History

Download this file

132 lines (107 with data), 5.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// CommitMonitor - simple checker for new commits in svn repositories
// Copyright (C) 2007-2010, 2012 - Stefan Kueng
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
#pragma once
#include <string>
#include "BaseDialog.h"
#include "ListCtrl.h"
#include "UrlInfo.h"
#include "AeroControls.h"
#define REPOBROWSER_CTRL_MIN_WIDTH 50
#define REPOBROWSER_CTRL_MIN_HEIGHT 40
#define DRAGMODE_NONE 0
#define DRAGMODE_HORIZONTAL 1
#define DRAGMODE_VERTICAL 2
#define TIMER_REFRESH 101
#define TIMER_LABEL 102
#define TIMER_FILTER 103
#define FILTER_ELAPSE 500
/**
* main dialog.
*/
class CMainDlg : public CDialog
{
public:
CMainDlg(HWND hParent);
~CMainDlg(void);
void SetUrlInfos(CUrlInfos * pUrlInfos) {m_pURLInfos = pUrlInfos;}
void SetUpdateAvailable(bool bUpdate) {m_bNewerVersionAvailable = bUpdate;}
void SetLastSelectedProject(const std::wstring& proj) { m_lastSelectedProject = proj; }
std::wstring GetLastSelectedProject() { return m_lastSelectedProject; }
protected:
LRESULT CALLBACK DlgFunc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoCommand(int id);
virtual bool PreTranslateMessage(MSG* pMsg);
private:
bool OnSetCursor(HWND hWnd, UINT nHitTest, UINT message);
bool OnMouseMove(UINT nFlags, POINT point);
bool OnLButtonDown(UINT nFlags, POINT point);
bool OnLButtonUp(UINT nFlags, POINT point);
void DrawXorBar(HDC hDC, LONG x1, LONG y1, LONG width, LONG height);
void PositionChildWindows(POINT point, bool bHorz, bool bShowBar);
void DoResize(int width, int height);
bool CreateToolbar();
void RefreshURLTree(bool bSelectUnread, const std::wstring& urltoselect);
HTREEITEM FindParentTreeNode(const std::wstring& url);
HTREEITEM FindTreeNode(const std::wstring& url, HTREEITEM hItem = TVI_ROOT);
bool SelectNextWithUnread(HTREEITEM hItem = TVI_ROOT);
void OnSelectTreeItem(LPNMTREEVIEW lpNMTreeView);
void OnSelectListItem(LPNMLISTVIEW lpNMListView);
LRESULT OnCustomDrawListItem(LPNMLVCUSTOMDRAW lpNMCustomDraw);
LRESULT OnCustomDrawTreeItem(LPNMTVCUSTOMDRAW lpNMCustomDraw);
void OnKeyDownListItem(LPNMLVKEYDOWN pnkd);
void OnDblClickListItem(LPNMITEMACTIVATE lpnmitem);
void TreeItemSelected(HWND hTreeControl, HTREEITEM hSelectedItem);
void RemoveSelectedListItems();
void MarkAllAsRead(HTREEITEM hItem, bool includingChildren);
void RefreshAll(HTREEITEM hItem);
void CheckNow(HTREEITEM hItem);
void SetRemoveButtonState();
bool ShowDiff(bool bUseTSVN);
void SortItems(int col);
void SaveWndPosition();
void OnContextMenu(WPARAM wParam, LPARAM lParam);
/// window procedure of the sub classed tree view control
static LRESULT CALLBACK TreeProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
WNDPROC m_oldTreeWndProc; ///< pointer to the original window proc of the tree view control
static LRESULT CALLBACK FilterProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
WNDPROC m_oldFilterWndProc; ///< pointer to the original window proc of the filter control
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
private:
HWND m_hTreeControl;
HWND m_hListControl;
HWND m_hLogMsgControl;
HWND m_hFilterControl;
HWND m_hCheckControl;
HFONT m_font;
CListCtrl m_ListCtrl;
HWND m_hParent;
HWND m_hwndToolbar;
HIMAGELIST m_hToolbarImages;
HIMAGELIST m_hImgList;
int m_nDragMode;
LONG m_oldx, m_oldy;
LONG m_topmarg;
LONG m_xSliderPos;
LONG m_ySliderPos;
LONG m_bottommarg;
HFONT m_boldFont;
CUrlInfos * m_pURLInfos;
std::wstring m_lastSelectedProject;
bool m_bBlockListCtrlUI;
bool m_bNewerVersionAvailable;
bool m_refreshNeeded;
size_t m_listviewUnfilteredCount;
AeroControlBase m_aerocontrols;
};
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.