Menu

[0b4401]: / PythonScript / src / AboutDialog2.cpp  Maximize  Restore  History

Download this file

86 lines (69 with data), 1.6 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
#include "stdafx.h"
#include "AboutDialog.h"
#include "PythonScriptVersion.h"
#include "resource.h"
#include "PluginInterface.h"
AboutDialog::AboutDialog(void)
{
m_hbrBackground = CreateSolidBrush(RGB(255,255,255));
}
AboutDialog::~AboutDialog(void)
{
if (m_hbrBackground)
{
DeleteObject(m_hbrBackground);
m_hbrBackground = NULL;
}
}
void AboutDialog::doDialog()
{
if (!isCreated())
create(IDD_ABOUTDLG);
goToCenter();
}
BOOL CALLBACK AboutDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM /* lParam */)
{
switch (Message)
{
case WM_INITDIALOG :
{
std::string message("Python ");
message.append(Py_GetVersion());
message.append("\n");
message.append(Py_GetCopyright());
for (size_t pos = 0;(pos = message.find("\n", pos + 1)) != std::string::npos;)
{
message.replace(pos, 1, "\r\n");
++pos;
}
::SetWindowTextA(GetDlgItem(hWnd, IDC_COPYRIGHT), message.c_str());
::SetWindowText(GetDlgItem(hWnd, IDC_VERSION), _T(PYSCR_VERSION_STRING));
return TRUE;
}
case WM_CTLCOLORDLG:
return (LONG)m_hbrBackground;
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC)wParam;
SetBkMode(hdcStatic, TRANSPARENT);
return (LONG)m_hbrBackground;
}
case WM_COMMAND :
switch (wParam)
{
case IDOK :
case IDCANCEL :
display(false);
return TRUE;
default :
break;
}
return FALSE;
default:
return FALSE;
}
}
void AboutDialog::initDialog( HINSTANCE hInst, NppData& nppData )
{
Window::init(hInst, nppData._nppHandle);
}