This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdialogEcuFlash.cpp
executable file
·78 lines (61 loc) · 1.66 KB
/
dialogEcuFlash.cpp
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
/*/
dialogEcuFlash.cpp (2005.11.23)
/*/
#include "dialogEcuFlash.h"
#include "definitionError.h"
#include "handlerError.h"
#include "ecuExplorer.h"
extern void nuke();
extern void OutputString(CString sMessage,unsigned short usMessageType = 0);
BEGIN_MESSAGE_MAP(dialogEcuFlash, CDialog)
END_MESSAGE_MAP()
dialogEcuFlash::dialogEcuFlash() : CDialog(dialogEcuFlash::IDD)
{
lpParent = NULL;
iLength = 0;
lpFont = NULL;
lpButton = NULL;
}
void dialogEcuFlash::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
void dialogEcuFlash::OnOK()
{
if(lpFont != NULL)
delete lpFont;
CDialog::OnOK();
}
BOOL dialogEcuFlash::OnInitDialog()
{
lpFont = new CFont;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 0xfffffff5;
lf.lfWeight = FW_REGULAR;
lf.lfOutPrecision = OUT_STROKE_PRECIS;
lf.lfClipPrecision = CLIP_STROKE_PRECIS;
lf.lfQuality = DRAFT_QUALITY;
lf.lfPitchAndFamily = 0x22;
lf.lfCharSet = 0;
strcpy(lf.lfFaceName,"Lucida Console");
lpFont->CreateFontIndirect(&lf);
CEdit* lpEdit = NULL;
if((lpEdit = (CEdit*)GetDlgItem(IDC_ECUFLASH_PROGRESS)) != NULL)
lpEdit->SetFont(lpFont);
if((lpButton = (CButton*)GetDlgItem(IDOK)) == NULL)
return FALSE;
return CDialog::OnInitDialog();
}
void dialogEcuFlash::UpdateProgress(LPCTSTR cBuffer)
{
CString sError;
CEdit* lpEdit = NULL;
CString sNew = cBuffer;
GetDlgItemText(IDC_ECUFLASH_PROGRESS,sError);
sNew.Replace("\n","\r\n");
sError += sNew;
SetDlgItemText(IDC_ECUFLASH_PROGRESS,sError);
if((lpEdit = (CEdit*)GetDlgItem(IDC_ECUFLASH_PROGRESS)) != NULL)
lpEdit->LineScroll(lpEdit->GetLineCount());
}