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

Diff of /trunk/Src/wptDateDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC
# Line 1  Line 1 
1  /* wptDateDlg.cpp - Universal dialog to ask for a date  /* wptDateDlg.cpp - Universal dialog to ask for a date
2   *      Copyright (C) 2001, 2002, 2003 Timo Schulz   *      Copyright (C) 2001, 2002, 2003 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
6   * WinPT is free software; you can redistribute it and/or modify   * 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   * 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   * the Free Software Foundation; either version 2 of the License, or
9   * (at your option) any later version.   * (at your option) any later version.
10   *   *
11   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.   * GNU General Public License for more details.
15   *   *
16   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
20    
21  #include <windows.h>  #ifdef HAVE_CONFIG_H
22  #include <commctrl.h>  #include <config.h>
23    #endif
24  #include "gpgme.h"  
25  #include "../resource.h"  #include <windows.h>
26  #include "wptCommonCtl.h"  #include <commctrl.h>
27  #include "wptContext.h"  
28  #include "wptDlgs.h"  #include "gpgme.h"
29  #include "wptTypes.h"  #include "resource.h"
30    #include "wptCommonCtl.h"
31    #include "wptContext.h"
32  /* (common) Dialog box procedure to select a date. */  #include "wptDlgs.h"
33  BOOL CALLBACK  #include "wptTypes.h"
34  date_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  
35  {  
36      static date_s *udd;  /* (common) Dialog box procedure to select a date. */
37        BOOL CALLBACK
38      switch( msg ) {  date_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
39      case WM_INITDIALOG:  {
40          udd = (date_s *)lparam;      static date_s *udd;
41          if( udd == NULL )      
42              dlg_fatal_error( dlg, "Can't get dialog param" );      switch( msg ) {
43          if( udd->text )      case WM_INITDIALOG:
44              SetWindowText( dlg, udd->text );          udd = (date_s *)lparam;
45          SetForegroundWindow( dlg );          if( udd == NULL )
46          return TRUE;              dlg_fatal_error( dlg, "Can't get dialog param" );
47                    if( udd->text )
48      case WM_SYSCOMMAND:              SetWindowText( dlg, udd->text );
49          if( LOWORD( wparam ) == SC_CLOSE ) {          SetForegroundWindow( dlg );
50              udd->cancel = 1;          return TRUE;
51              EndDialog( dlg, TRUE );          
52          }      case WM_SYSCOMMAND:
53          return FALSE;          if( LOWORD( wparam ) == SC_CLOSE ) {
54                        udd->cancel = 1;
55      case WM_COMMAND:              EndDialog( dlg, TRUE );
56          switch( LOWORD( wparam) ) {          }
57          case IDOK:          return FALSE;
58              DateTime_GetSystemtime( GetDlgItem( dlg, IDC_DATE_DTP ), &udd->st );          
59              udd->cancel = 0;      case WM_COMMAND:
60              EndDialog( dlg, TRUE );          switch( LOWORD( wparam) ) {
61              return TRUE;          case IDOK:
62          }              DateTime_GetSystemtime( GetDlgItem( dlg, IDC_DATE_DTP ), &udd->st );
63          break;              udd->cancel = 0;
64      }              EndDialog( dlg, TRUE );
65                    return TRUE;
66      return FALSE;          }
67            break;
68        }
69        
70        return FALSE;
71  }  }

Legend:
Removed from v.32  
changed lines
  Added in v.48

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26