/[winpt]/trunk/Src/wptDateDlg.cpp
ViewVC logotype

Annotation of /trunk/Src/wptDateDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (hide annotations)
Fri Sep 25 16:07:38 2009 UTC (15 years, 5 months ago) by twoaday
File size: 1623 byte(s)


1 werner 36 /* wptDateDlg.cpp - Universal dialog to ask for a date
2 twoaday 256 * Copyright (C) 2001, 2002, 2003, 2006 Timo Schulz
3 werner 36 *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 twoaday 328 * GNU General Public License for more details.
15 werner 36 */
16     #ifdef HAVE_CONFIG_H
17     #include <config.h>
18     #endif
19    
20     #include <windows.h>
21     #include <commctrl.h>
22    
23     #include "gpgme.h"
24 werner 47 #include "resource.h"
25 werner 36 #include "wptCommonCtl.h"
26     #include "wptContext.h"
27     #include "wptTypes.h"
28    
29    
30 twoaday 256 /* Dialog box procedure to select a date. */
31 werner 36 BOOL CALLBACK
32     date_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
33     {
34     static date_s *udd;
35    
36 twoaday 328 switch (msg) {
37 werner 36 case WM_INITDIALOG:
38     udd = (date_s *)lparam;
39 twoaday 256 if (!udd)
40     BUG (0);
41     if (udd->text)
42     SetWindowText (dlg, udd->text);
43     SetForegroundWindow (dlg);
44     return TRUE;
45 werner 36
46     case WM_COMMAND:
47 twoaday 256 switch (LOWORD (wparam)) {
48     case IDCANCEL:
49     udd->cancel = 1;
50     EndDialog (dlg, FALSE);
51     return TRUE;
52    
53 werner 36 case IDOK:
54 twoaday 256 DateTime_GetSystemtime (GetDlgItem (dlg, IDC_DATE_DTP), &udd->st);
55 werner 36 udd->cancel = 0;
56 twoaday 256 EndDialog (dlg, TRUE);
57 werner 36 return TRUE;
58     }
59     break;
60     }
61    
62     return FALSE;
63 twoaday 32 }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26