| 1 |
doda |
6806 |
/* |
| 2 |
|
|
* Copyright (C) 1994-1998 T. Teranishi |
| 3 |
|
|
* (C) 2007-2017 TeraTerm Project |
| 4 |
|
|
* All rights reserved. |
| 5 |
|
|
* |
| 6 |
|
|
* Redistribution and use in source and binary forms, with or without modification, |
| 7 |
|
|
* are permitted provided that the following conditions are met: |
| 8 |
|
|
* |
| 9 |
|
|
* 1. Redistributions of source code must retain the above copyright notice, |
| 10 |
|
|
* this list of conditions and the following disclaimer. |
| 11 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 |
|
|
* this list of conditions and the following disclaimer in the documentation |
| 13 |
|
|
* and/or other materials provided with the distribution. |
| 14 |
|
|
* 3. The name of the author may not be used to endorse or promote products derived |
| 15 |
|
|
* from this software without specific prior written permission. |
| 16 |
|
|
* |
| 17 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 18 |
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 |
|
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
| 20 |
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 21 |
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
| 22 |
|
|
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 23 |
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 |
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
| 25 |
|
|
* OF SUCH DAMAGE. |
| 26 |
|
|
*/ |
| 27 |
maya |
3227 |
|
| 28 |
|
|
/* TERATERM.EXE, print-abort dialog box */ |
| 29 |
|
|
#include "stdafx.h" |
| 30 |
|
|
#include "teraterm.h" |
| 31 |
|
|
#include "tttypes.h" |
| 32 |
|
|
#include "ttlib.h" |
| 33 |
|
|
#include "tt_res.h" |
| 34 |
|
|
#include "prnabort.h" |
| 35 |
|
|
|
| 36 |
|
|
#ifdef _DEBUG |
| 37 |
|
|
#define new DEBUG_NEW |
| 38 |
|
|
#undef THIS_FILE |
| 39 |
|
|
static char THIS_FILE[] = __FILE__; |
| 40 |
|
|
#endif |
| 41 |
|
|
|
| 42 |
|
|
// CPrnAbortDlg dialog |
| 43 |
|
|
BEGIN_MESSAGE_MAP(CPrnAbortDlg, CDialog) |
| 44 |
|
|
//{{AFX_MSG_MAP(CPrnAbortDlg) |
| 45 |
|
|
//}}AFX_MSG_MAP |
| 46 |
|
|
END_MESSAGE_MAP() |
| 47 |
|
|
|
| 48 |
|
|
// CPrnAbortDlg message handler |
| 49 |
|
|
BOOL CPrnAbortDlg::Create(CWnd* p_Parent, PBOOL AbortFlag, PTTSet pts) |
| 50 |
|
|
{ |
| 51 |
maya |
3392 |
BOOL Ok; |
| 52 |
|
|
HWND HParent; |
| 53 |
|
|
LOGFONT logfont; |
| 54 |
|
|
HFONT font; |
| 55 |
maya |
3227 |
|
| 56 |
maya |
3392 |
m_pParent = p_Parent; |
| 57 |
|
|
if (p_Parent!=NULL) { |
| 58 |
|
|
HParent = p_Parent->GetSafeHwnd(); |
| 59 |
|
|
} |
| 60 |
|
|
else { |
| 61 |
|
|
HParent = NULL; |
| 62 |
|
|
} |
| 63 |
|
|
Abort = AbortFlag; |
| 64 |
|
|
Ok = (CDialog::Create(CPrnAbortDlg::IDD, m_pParent)); |
| 65 |
|
|
if (Ok) { |
| 66 |
|
|
::EnableWindow(HParent,FALSE); |
| 67 |
|
|
::EnableWindow(GetSafeHwnd(),TRUE); |
| 68 |
|
|
} |
| 69 |
maya |
3227 |
|
| 70 |
maya |
3392 |
font = (HFONT)SendMessage(WM_GETFONT, 0, 0); |
| 71 |
|
|
GetObject(font, sizeof(LOGFONT), &logfont); |
| 72 |
|
|
if (get_lang_font("DLG_SYSTEM_FONT", GetSafeHwnd(), &logfont, &DlgFont, pts->UILanguageFile)) { |
| 73 |
|
|
SendDlgItemMessage(IDC_PRNABORT_PRINTING, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0)); |
| 74 |
|
|
SendDlgItemMessage(IDCANCEL, WM_SETFONT, (WPARAM)DlgFont, MAKELPARAM(TRUE,0)); |
| 75 |
|
|
} |
| 76 |
maya |
3227 |
|
| 77 |
maya |
3392 |
return Ok; |
| 78 |
maya |
3227 |
} |
| 79 |
|
|
|
| 80 |
|
|
void CPrnAbortDlg::OnCancel() |
| 81 |
|
|
{ |
| 82 |
maya |
3392 |
*Abort = TRUE; |
| 83 |
|
|
DestroyWindow(); |
| 84 |
maya |
3227 |
} |
| 85 |
|
|
|
| 86 |
doda |
6435 |
BOOL CPrnAbortDlg::OnCommand(WPARAM wParam, LPARAM lParam) |
| 87 |
maya |
3227 |
{ |
| 88 |
maya |
3392 |
*Abort = TRUE; |
| 89 |
|
|
DestroyWindow(); |
| 90 |
|
|
|
| 91 |
|
|
return CDialog::OnCommand(wParam, lParam); |
| 92 |
maya |
3227 |
} |
| 93 |
|
|
|
| 94 |
doda |
6435 |
void CPrnAbortDlg::PostNcDestroy() |
| 95 |
maya |
3227 |
{ |
| 96 |
maya |
3392 |
delete this; |
| 97 |
maya |
3227 |
} |
| 98 |
|
|
|
| 99 |
doda |
6435 |
BOOL CPrnAbortDlg::DestroyWindow() |
| 100 |
maya |
3227 |
{ |
| 101 |
maya |
3392 |
HWND HParent; |
| 102 |
maya |
3227 |
|
| 103 |
maya |
3392 |
HParent = m_pParent->GetSafeHwnd(); |
| 104 |
|
|
::EnableWindow(HParent,TRUE); |
| 105 |
|
|
::SetFocus(HParent); |
| 106 |
|
|
return CDialog::DestroyWindow(); |
| 107 |
maya |
3227 |
} |