changeset 7:7ac7d28699af

Display DB update day. Ask print image with mask or not.
author pyon@macmini
date Thu, 17 Oct 2013 19:54:23 +0900
parents 76db82822e73
children 4967d1e2b30c
files Changes include/db.h include/index.h src/about.cpp src/db.cpp src/index.cpp src/myframe.cpp
diffstat 7 files changed, 77 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Changes	Wed Sep 18 18:20:40 2013 +0900
+++ b/Changes	Thu Oct 17 19:54:23 2013 +0900
@@ -1,3 +1,9 @@
+version 03.08
+2013-10-17
+ Display DB updated day. 
+ Ask print image with mask or not.
+
+----
 version 03.07
 2013-09-18
  Implement kana fuzzy search.
--- a/include/db.h	Wed Sep 18 18:20:40 2013 +0900
+++ b/include/db.h	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : db.h
-// Last Change: 11-Sep-2013.
+// Last Change: 16-Oct-2013.
 //
 #ifndef __DB_H__
 #define __DB_H__
@@ -26,6 +26,8 @@
 void UpdateIndex( wxString datedir, wxString date );
 // DBの整合性をチェック
 wxArrayString CheckDBs( void );
+// DBの更新日時を取得
+wxArrayString GetLastUpdate( void );
 
 #endif //__DB_H__
 
--- a/include/index.h	Wed Sep 18 18:20:40 2013 +0900
+++ b/include/index.h	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : index.h
-// Last Change: 23-Aug-2013.
+// Last Change: 16-Oct-2013.
 //
 
 #ifndef __INDEX_H__
--- a/src/about.cpp	Wed Sep 18 18:20:40 2013 +0900
+++ b/src/about.cpp	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : about.cpp
-// Last Change: 18-Jun-2012.
+// Last Change: 17-Oct-2013.
 //
 
 #include "common.h"
@@ -58,7 +58,7 @@
             m_richText->EndBold();
             m_richText->Newline();
         }
-        else if ( textfile[i].StartsWith( wxT("20")) ) {
+        else if ( textfile[i].StartsWith( wxT("20")) ) {    // year
             m_richText->BeginAlignment( wxTEXT_ALIGNMENT_RIGHT );
             m_richText->BeginItalic();
             m_richText->WriteText( textfile[i] );
@@ -74,6 +74,7 @@
             m_richText->BeginSymbolBullet( wxT("* "), 60, 0, wxTEXT_ATTR_BULLET_STYLE_SYMBOL );
             m_richText->WriteText( textfile[i] );
             m_richText->EndSymbolBullet();
+            m_richText->Newline();
         }
     }
     textfile.Close();
--- a/src/db.cpp	Wed Sep 18 18:20:40 2013 +0900
+++ b/src/db.cpp	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : db.cpp
-// Last Change: 18-Sep-2013.
+// Last Change: 16-Oct-2013.
 //
 
 #include "db.h"
@@ -250,6 +250,26 @@
 }
 
 //********** HHS-DB & CCN-DB **********//
+/* DBの更新日時を取得 */
+wxArrayString GetLastUpdate( void )
+{
+    wxArrayString date;
+    wxString dbFile;
+    wxDateTime t;
+    
+    dbFile = wxGetCwd() + wxFILE_SEP_PATH + wxT("db") + wxFILE_SEP_PATH + wxT("ccn.db");
+    wxFileName ccn( dbFile );
+    t = ccn.GetModificationTime();
+    date.Add( t.FormatISODate() );
+
+    dbFile = wxGetCwd() + wxFILE_SEP_PATH + wxT("db") + wxFILE_SEP_PATH + wxT("hhs.db");
+    wxFileName hhs( dbFile );
+    t = hhs.GetModificationTime();
+    date.Add( t.FormatISODate() );
+
+    return date;
+}
+
 /* DB整合性チェック */
 wxArrayString CheckDBs( void )
 {
@@ -320,3 +340,4 @@
 
     return result;
 }
+
--- a/src/index.cpp	Wed Sep 18 18:20:40 2013 +0900
+++ b/src/index.cpp	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : index.cpp
-// Last Change: 23-Aug-2013.
+// Last Change: 16-Oct-2013.
 //
 
 #include "index.h"
@@ -136,11 +136,31 @@
 
 void IndexDialog::CheckHhs( void )
 {
+    wxArrayString date   = GetLastUpdate();
     wxArrayString result = CheckDBs();
 
+    m_richText->BeginBold();
+    m_richText->WriteText( wxT("最終更新年月日") );
+    m_richText->EndBold();
+    m_richText->Newline();
+    m_richText->BeginTextColour( wxColour( 0, 0, 255 ) );
+    m_richText->WriteText( wxT("インデックス:") );
+    m_richText->EndTextColour();
+    m_richText->WriteText( date[0] );
+    m_richText->Newline();
+
+    m_richText->BeginTextColour( wxColour( 0, 0, 255 ) );
+    m_richText->WriteText( wxT("被保険者情報:") );
+    m_richText->EndTextColour();
+    m_richText->WriteText( date[1] );
+    m_richText->Newline();
+    m_richText->Newline();
+
     for ( int i = 0; i < result.GetCount(); i++ ) {
         m_richText->WriteText( wxT("チェック対象 : ") );
+        m_richText->BeginTextColour( wxColour( 255, 0, 0 ) );
         m_richText->WriteText( result[i] );
+        m_richText->EndTextColour();
         m_richText->Newline();
     }
     m_richText->SetEditable( false );
--- a/src/myframe.cpp	Wed Sep 18 18:20:40 2013 +0900
+++ b/src/myframe.cpp	Thu Oct 17 19:54:23 2013 +0900
@@ -1,5 +1,5 @@
 // Filename   : myframe.cpp
-// Last Change: 13-Sep-2013.
+// Last Change: 17-Oct-2013.
 //
 #include "main.h"
 #include "db.h"
@@ -335,6 +335,12 @@
 /* 印刷 */
 void MyFrame::PrintImages( wxString hhsno )
 {
+    bool mask_flag = false;
+    wxMessageDialog md( this, wxT("マクスしますか?"), wxT("印刷オプション"), wxYES_NO, wxDefaultPosition );
+    if ( md.ShowModal() == wxID_YES ) {
+        mask_flag = true;
+    }
+
     // 印刷用の html を作成
     wxArrayString path = GetPathByHhsNo( hhsno );
     if ( path.IsEmpty() ) return;
@@ -357,16 +363,18 @@
 
         if ( notyet_mask && IsMarksheet( file, zmin, zmax, lmin, lmax ) ) {  // マークシート表面をマスクする
             wxImage img_org( file, wxBITMAP_TYPE_JPEG );
-            int ver = GetMarksheetVersion( file );
-            if ( ver == 2 ) {
-                img_org.SetRGB( m_mask1, 255, 255, 255 );   // cm name
-                img_org.SetRGB( m_mask2, 255, 255, 255 );   // cm no.
-                img_org.SetRGB( m_mask3, 255, 255, 255 );   // barcode
-            }
-            else {  // 古いマークシート ver == 1
-                img_org.SetRGB( m_mask1old, 255, 255, 255 );   // cm name
-                img_org.SetRGB( m_mask2old, 255, 255, 255 );   // cm no.
-                img_org.SetRGB( m_mask3old, 255, 255, 255 );   // barcode
+            if ( mask_flag ) {
+                int ver = GetMarksheetVersion( file );
+                if ( ver == 2 ) {
+                    img_org.SetRGB( m_mask1, 255, 255, 255 );   // cm name
+                    img_org.SetRGB( m_mask2, 255, 255, 255 );   // cm no.
+                    img_org.SetRGB( m_mask3, 255, 255, 255 );   // barcode
+                }
+                else {  // 古いマークシート ver == 1
+                    img_org.SetRGB( m_mask1old, 255, 255, 255 );   // cm name
+                    img_org.SetRGB( m_mask2old, 255, 255, 255 );   // cm no.
+                    img_org.SetRGB( m_mask3old, 255, 255, 255 );   // barcode
+                }
             }
             img_org.SaveFile( tmpjpg );
             notyet_mask = false;
@@ -412,10 +420,9 @@
     config->SetPath( wxT("/Index") );
     config->Read( wxT("rootdir"), &rootdir );
 
-    IndexDialog* index = new IndexDialog( this, wxID_ANY, wxT("インデックス作成"), wxDefaultPosition, wxSize( 700, 600 ), wxCAPTION|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxTAB_TRAVERSAL );
-    index->ShowWithEffect( wxSHOW_EFFECT_SLIDE_TO_BOTTOM );
+    IndexDialog* index = new IndexDialog( this, wxID_ANY, wxT("インデックス作成"), wxDefaultPosition, wxSize( 700, 600 ), wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
+    index->ShowModal();
     index->SetRootdir( rootdir );
-    index->ShowModal();
 }
 /* マークシートパラメータ設定ダイアログ */
 void MyFrame::OnMarkParam( wxCommandEvent& WXUNUSED(event) )