Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PlayerListCtrl.h « mpc-hc « src - github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bfe5d05b94580deee3cf5665486b1ec77af5f56a (plain)
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/*
 * (C) 2003-2006 Gabest
 * (C) 2006-2015 see Authors.txt
 *
 * This file is part of MPC-HC.
 *
 * MPC-HC 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 3 of the License, or
 * (at your option) any later version.
 *
 * MPC-HC 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, see <http://www.gnu.org/licenses/>.
 *
 */

#pragma once

#include "WinHotkeyCtrl.h"

#define LVN_DOLABELEDIT (LVN_FIRST+1)


class CInPlaceWinHotkey : public CWinHotkeyCtrl
{
private:
    int m_iItem;
    int m_iSubItem;
    CString m_sInitText;
    BOOL m_bESC; // To indicate whether ESC key was pressed

public:
    CInPlaceWinHotkey(int iItem, int iSubItem, CString sInitText);
    virtual ~CInPlaceWinHotkey();

protected:
    virtual BOOL PreTranslateMessage(MSG* pMsg);

    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnNcDestroy();
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

class CInPlaceEdit : public CEdit
{
protected:
    int m_iItem;
    int m_iSubItem;
    CString m_sInitText;
    BOOL m_bESC; // To indicate whether ESC key was pressed

public:
    CInPlaceEdit(int iItem, int iSubItem, CString sInitText);
    virtual ~CInPlaceEdit();

protected:
    virtual BOOL PreTranslateMessage(MSG* pMsg);

    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnNcDestroy();
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

class CInPlaceFloatEdit : public CInPlaceEdit
{
public:
    CInPlaceFloatEdit(int iItem, int iSubItem, CString sInitText);
    virtual ~CInPlaceFloatEdit();

protected:
    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
};

class CInPlaceComboBox : public CComboBox
{
private:
    int m_iItem;
    int m_iSubItem;
    CAtlList<CString> m_lstItems;
    int m_nSel;
    BOOL m_bESC; // To indicate whether ESC key was pressed

public:
    CInPlaceComboBox(int iItem, int iSubItem, CAtlList<CString>& plstItems, int nSel);
    virtual ~CInPlaceComboBox();

protected:
    virtual BOOL PreTranslateMessage(MSG* pMsg);

    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnNcDestroy();
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
    afx_msg void OnCloseup();
};

class CInPlaceListBox : public CListBox
{
private:
    int m_iItem;
    int m_iSubItem;
    CAtlList<CString> m_lstItems;
    int m_nSel;
    BOOL m_bESC; // To indicate whether ESC key was pressed

public:
    CInPlaceListBox(int iItem, int iSubItem, CAtlList<CString>& plstItems, int nSel);
    virtual ~CInPlaceListBox();

protected:
    virtual BOOL PreTranslateMessage(MSG* pMsg);

    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnKillFocus(CWnd* pNewWnd);
    afx_msg void OnNcDestroy();
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
};

// CPlayerListCtrl

class CPlayerListCtrl : public CListCtrl
{
    DECLARE_DYNAMIC(CPlayerListCtrl)

private:
    int m_nItemClicked, m_nSubItemClicked;
    int m_tStartEditingDelay;
    UINT_PTR m_nTimerID;

    bool PrepareInPlaceControl(int nRow, int nCol, CRect& rect);

public:
    CPlayerListCtrl(int tStartEditingDelay = 500);
    virtual ~CPlayerListCtrl();

    int HitTestEx(const CPoint& point, int* col) const;
    CImageList* CreateDragImageEx(LPPOINT lpPoint);

    int GetBottomIndex() const;

    CWinHotkeyCtrl* ShowInPlaceWinHotkey(int nItem, int nCol);
    CEdit* ShowInPlaceEdit(int nItem, int nCol);
    CEdit* ShowInPlaceFloatEdit(int nItem, int nCol);
    CComboBox* ShowInPlaceComboBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel, bool bShowDropDown = false);
    CListBox* ShowInPlaceListBox(int nItem, int nCol, CAtlList<CString>& lstItems, int nSel);

    bool m_fInPlaceDirty;

protected:
    virtual void PreSubclassWindow();
    virtual INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const;
    virtual ULONG GetGestureStatus(CPoint) override { return 0; };

    DECLARE_MESSAGE_MAP()

public:
    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
    afx_msg void OnTimer(UINT_PTR nIDEvent);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnLvnMarqueeBegin(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnLvnInsertitem(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnLvnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnEnChangeEdit1();
    afx_msg void OnEnChangeWinHotkey1();
    afx_msg void OnCbnDropdownCombo1();
    afx_msg void OnCbnSelendokCombo1();
    afx_msg void OnLbnSelChangeList1();
    afx_msg BOOL OnHdnItemchanging(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg BOOL OnToolTipNotify(UINT id, NMHDR* pNMHDR, LRESULT* pResult);
    afx_msg void OnXButtonDown(UINT nFlags, UINT nButton, CPoint point);
    afx_msg void OnXButtonUp(UINT nFlags, UINT nButton, CPoint point);
    afx_msg void OnXButtonDblClk(UINT nFlags, UINT nButton, CPoint point);
};