Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /trunk/teraterm/teraterm/prnabort.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9359 - (hide annotations) (download) (as text)
Sat Aug 14 03:26:30 2021 UTC (2 years, 7 months ago) by zmatsuo
File MIME type: text/x-c++src
File size: 3522 byte(s)
UILanguageFile を unicode版(UILanguageFileW)へ切り替え

- SetDlgTexts() -> SetDlgTextsW()
- get_lang_msgW() ->GetI18nStrWW()
- SetI18nList() -> SetI18nListW()
1 zmatsuo 7377 /*
2 doda 6806 * Copyright (C) 1994-1998 T. Teranishi
3 nmaya 9048 * (C) 2007- TeraTerm Project
4 doda 6806 * All rights reserved.
5     *
6 doda 6841 * Redistribution and use in source and binary forms, with or without
7     * modification, are permitted provided that the following conditions
8     * are met:
9 doda 6806 *
10 doda 6841 * 1. Redistributions of source code must retain the above copyright
11     * notice, this list of conditions and the following disclaimer.
12     * 2. Redistributions in binary form must reproduce the above copyright
13     * notice, this list of conditions and the following disclaimer in the
14     * documentation and/or other materials provided with the distribution.
15     * 3. The name of the author may not be used to endorse or promote products
16     * derived from this software without specific prior written permission.
17 doda 6806 *
18 doda 6841 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
19     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21     * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 doda 6806 */
29 maya 3227
30     /* TERATERM.EXE, print-abort dialog box */
31 zmatsuo 7174 #include <windows.h>
32     #include <windowsx.h>
33 maya 3227 #include "teraterm.h"
34     #include "tttypes.h"
35     #include "ttlib.h"
36 zmatsuo 7174 #include "dlglib.h"
37 maya 3227 #include "tt_res.h"
38     #include "prnabort.h"
39    
40 zmatsuo 7174 LRESULT CALLBACK CPrnAbortDlg::OnDlgProc(HWND hDlgWnd, UINT msg, WPARAM wp, LPARAM lp)
41     {
42     static const DlgTextInfo TextInfos[] = {
43 zmatsuo 8567 { IDC_PRNABORT_PRINTING, "DLG_PRNABORT_PRINTING" },
44 zmatsuo 7174 { IDCANCEL, "BTN_CANCEL" },
45     };
46 maya 3227
47 zmatsuo 7174 CPrnAbortDlg *self = (CPrnAbortDlg *)GetWindowLongPtr(hDlgWnd, DWLP_USER);
48 maya 3227
49 zmatsuo 7174 switch (msg) {
50     case WM_INITDIALOG:
51     {
52 zmatsuo 7653 self = (CPrnAbortDlg *)lp;
53 zmatsuo 7174 SetWindowLongPtr(hDlgWnd, DWLP_USER, (LONG_PTR)self);
54 zmatsuo 9359 SetDlgTextsW(hDlgWnd, TextInfos, _countof(TextInfos), self->m_ts->UILanguageFileW);
55 zmatsuo 7174 return TRUE;
56     }
57 maya 3227
58 zmatsuo 7174 case WM_COMMAND:
59     {
60 zmatsuo 7653 const WORD wID = GET_WM_COMMAND_ID(wp, lp);
61 zmatsuo 7174 if (wID == IDOK) {
62     self->DestroyWindow();
63     }
64     if (wID == IDCANCEL) {
65     self->OnCancel();
66     }
67     return FALSE;
68 maya 3392 }
69 zmatsuo 7174 case WM_NCDESTROY:
70     self->PostNcDestroy();
71     return TRUE;
72    
73     default:
74     return FALSE;
75 maya 3392 }
76 zmatsuo 7174 return TRUE;
77     }
78 maya 3227
79 zmatsuo 7174 BOOL CPrnAbortDlg::Create(HINSTANCE hInstance, HWND hParent, PBOOL AbortFlag, PTTSet pts)
80     {
81     m_pAbort = AbortFlag;
82     m_hParentWnd = hParent;
83     m_ts = pts;
84    
85 zmatsuo 7936 SetDialogFont(m_ts->DialogFontName, m_ts->DialogFontPoint, m_ts->DialogFontCharSet,
86     m_ts->UILanguageFile, "Tera Term", "DLG_SYSTEM_FONT");
87 zmatsuo 8567 HWND hWnd = TTCreateDialogParam(
88     hInstance, MAKEINTRESOURCE(IDD_PRNABORTDLG), hParent,
89 zmatsuo 7174 (DLGPROC)OnDlgProc, (LPARAM)this);
90     if (hWnd == NULL)
91     {
92     return FALSE;
93 maya 3392 }
94 maya 3227
95 zmatsuo 7174 m_hWnd = hWnd;
96     ::EnableWindow(hParent,FALSE);
97     ::ShowWindow(hWnd, SW_SHOW);
98     ::EnableWindow(m_hWnd,TRUE);
99     return TRUE;
100 maya 3227 }
101    
102     void CPrnAbortDlg::OnCancel()
103     {
104 zmatsuo 7174 *m_pAbort = TRUE;
105 maya 3392 DestroyWindow();
106 maya 3227 }
107    
108 doda 6435 void CPrnAbortDlg::PostNcDestroy()
109 maya 3227 {
110 maya 3392 delete this;
111 maya 3227 }
112    
113 doda 6435 BOOL CPrnAbortDlg::DestroyWindow()
114 maya 3227 {
115 zmatsuo 7174 ::EnableWindow(m_hParentWnd,TRUE);
116     ::SetFocus(m_hParentWnd);
117     ::DestroyWindow(m_hWnd);
118     return TRUE;
119     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26