forked from m417z/Textify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextDlg.h
54 lines (46 loc) · 1.69 KB
/
TextDlg.h
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
#pragma once
#include "UserConfig.h"
class CTextDlg : public CDialogImpl<CTextDlg>
{
public:
enum { IDD = IDD_TEXTDLG };
BEGIN_MSG_MAP_EX(CTextDlg)
MSG_WM_INITDIALOG(OnInitDialog)
MSG_WM_CTLCOLORSTATIC(OnCtlColorStatic)
MSG_WM_ACTIVATE(OnActivate)
COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
MSG_WM_COMMAND(OnCommand)
MESSAGE_HANDLER_EX(WM_NCHITTEST, OnNcHitTest)
ALT_MSG_MAP(1)
MSG_WM_KEYDOWN(OnKeyDown)
MSG_WM_KEYUP(OnKeyUp)
MSG_WM_LBUTTONUP(OnLButtonUp)
MSG_WM_CHAR(OnChar)
END_MSG_MAP()
CTextDlg(std::vector<WebButtonInfo> webButtonInfos, bool autoCopySelection = false) :
m_wndEdit(this, 1),
m_webButtonInfos(std::move(webButtonInfos)),
m_autoCopySelection(autoCopySelection) {}
BOOL OnIdle();
BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
HBRUSH OnCtlColorStatic(CDCHandle dc, CStatic wndStatic);
void OnActivate(UINT nState, BOOL bMinimized, CWindow wndOther);
void OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl);
void OnCommand(UINT uNotifyCode, int nID, CWindow wndCtl);
LRESULT OnNcHitTest(UINT uMsg, WPARAM wParam, LPARAM lParam);
void OnKeyDown(UINT vk, UINT nRepCnt, UINT nFlags);
void OnKeyUp(UINT vk, UINT nRepCnt, UINT nFlags);
void OnLButtonUp(UINT nFlags, CPoint point);
void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
private:
CContainedWindowT<CEdit> m_wndEdit;
bool m_autoCopySelection;
std::vector<int> m_editIndexes;
int m_lastSelStart = 0, m_lastSelEnd = 0;
std::vector<WebButtonInfo> m_webButtonInfos;
std::vector<CIcon> m_webButtonIcons;
bool m_showingModalBrowserHost = false;
void InitWebAppButtons();
void AdjustWindowLocationAndSize(CPoint ptEvent, CRect rcAccObject, CString strText);
void OnSelectionMaybeChanged();
};