changeset 13:3e045b68738a

Finish EazyPrint implement.
author pyon@macmini
date Fri, 01 Jul 2011 19:54:15 +0900
parents 9452ed888d10
children
files TODO html/start.html include/symbol.h man/index.html src/htmlhelp.cpp src/myframe.cpp
diffstat 6 files changed, 40 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Sun Jun 26 13:43:46 2011 +0900
+++ b/TODO	Fri Jul 01 19:54:15 2011 +0900
@@ -5,7 +5,6 @@
 * change cursor.
 * close window by ESC.
 * change preview-image when listctrl is selected.
-* implement mask image.
 * implement edit image by other program.
 * implement print selected image.
 * implement print all images.
--- a/html/start.html	Sun Jun 26 13:43:46 2011 +0900
+++ b/html/start.html	Fri Jul 01 19:54:15 2011 +0900
@@ -17,9 +17,9 @@
 		<table border="1">
 			<tr bgcolor="#ffcc33"> <th>年月日</th>  <th>バージョン</th>  <th>内容</th> </tr>
             <!--
-            <tr> <td>2011.04.11</td> <td align="center">2.11</td> <td>プレビューモード搭載</td> </tr>
+            <tr> <td>2011.12.11</td> <td align="center">2.11</td> <td>プレビューモード搭載</td> </tr>
             -->
-            <tr> <td>2011.07.11</td> <td align="center">2.10</td> <td>イージープリント機能搭載</td> </tr>
+            <tr> <td>2011.07.01</td> <td align="center">2.10</td> <td>イージープリント機能搭載</td> </tr>
             <tr> <td>2011.06.30</td> <td align="center">2.9</td> <td>のぞき窓搭載</td> </tr>
 			<tr> <td>2011.04.01</td> <td align="center">2.8</td> <td>細かい機能追加</td> </tr>
 			<tr> <td>2011.03.31</td> <td align="center">2.7</td> <td>細かい機能追加</td> </tr>
@@ -28,3 +28,4 @@
 		</table>
 	</body>
 </html>
+
--- a/include/symbol.h	Sun Jun 26 13:43:46 2011 +0900
+++ b/include/symbol.h	Fri Jul 01 19:54:15 2011 +0900
@@ -1,10 +1,10 @@
 // Filename   : symbol.h
-// Last Change: 23-Jun-2011.
+// Last Change: 01-Jul-2011.
 //
 
 #define MYAPPNAME wxT("Searcher2")
 
 #define VER 2
 #define REV 10
-#define BLD 20110711
+#define BLD 20110701
 
--- a/man/index.html	Sun Jun 26 13:43:46 2011 +0900
+++ b/man/index.html	Fri Jul 01 19:54:15 2011 +0900
@@ -12,6 +12,7 @@
             <li> 5文字くらい入力したとき検索候補が表示されるようにした.
             <li> 被保険者情報が登録されていなくても検索できるようにした.
             <li> 最新画像の被保険者氏名部分を表示するようにした.
+            <li> 最新画像を簡単に印刷できるようにした.
         </ul>
 		<h2><font size="+1" color="green">機能変更</font></h2>
         <ul>
--- a/src/htmlhelp.cpp	Sun Jun 26 13:43:46 2011 +0900
+++ b/src/htmlhelp.cpp	Fri Jul 01 19:54:15 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : htmlhelp.cpp
-// Last Change: 04-Mar-2011.
+// Last Change: 01-Jul-2011.
 //
 #include "common.h"
 #include "htmlhelp.h"
@@ -24,7 +24,7 @@
 {
     // set the frame icon
     SetIcon(wxICON(sample));
-	m_htmlWin = new wxHtmlWindow( this, ID_HELP, wxDefaultPosition, wxSize(380,200) );
+	m_htmlWin = new wxHtmlWindow( this, ID_HELP, wxDefaultPosition, wxSize(800,1000) );
 
 	m_htmlWin->LoadPage( wxT("man/index.html") );
 	//m_htmlWin->SetRelatedFrame( m_parent, wxT("The Searcher v2 - %s") );
--- a/src/myframe.cpp	Sun Jun 26 13:43:46 2011 +0900
+++ b/src/myframe.cpp	Fri Jul 01 19:54:15 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : mainframe.cpp
-// Last Change: 24-Jun-2011.
+// Last Change: 01-Jul-2011.
 //
 #include "wx/html/htmprint.h"
 #include "wx/print.h"
@@ -165,7 +165,7 @@
 
 	wxRegEx reHhs(wxT("^0[1238][0-9]{8}$"));	// 1:被保番チェック
 	wxRegEx reCno(wxT("^[0-9]{1,2}$"));         // 2:開くフォルダの番号
-	wxRegEx rePrint(wxT("^\\.[0-9]*$"));         // 3:印刷するフォルダの番号
+	wxRegEx rePrint(wxT("^\\+$"));              // 3:印刷するフォルダの番号
 
 	wxString cmd;
 	cmd = this->GetLineText(0);
@@ -287,6 +287,7 @@
             htmlbody += wxT("</table>");
             htmlbody += wxT("<br />");
             htmlbody += wxT("<div>");
+            htmlbody += wxT("テンキーの「+」ボタンで番号1の画像を印刷できます.<br />");
             htmlbody += wxT("フォルダを開くには,番号を入力してください.<br />");
             htmlbody += wxT("他の被保険者を検索するには,被保番を入力してください.");
             htmlbody += wxT("</div>");
@@ -382,26 +383,45 @@
 // functions
 void MyCmdBox::PrintImages( wxString& path )
 {
-    wxHtmlPrintout* hpout = new wxHtmlPrintout( wxT("Searcher2") );
-    hpout->SetMargins( 0,0,0,0,0 );
-    wxPrintDialogData* pd;
-    wxPrinter* p = new wxPrinter( pd );
+    wxHtmlPrintout hpout( wxT("Searcher2") );
+    hpout.SetMargins( 0,0,0,0,0 );
+    wxPrintDialogData pd;
+    wxPrinter p( &pd );
 
     wxDir dir(path);
     wxString file;
     if ( !dir.IsOpened() ) return;
 
     bool cout = dir.GetFirst( &file, wxT("*.jpg"), wxDIR_FILES );
+    bool mask_flg = true;
+    wxRect cmname( wxPoint(156,224), wxSize(1204,122) );
+    wxRect cmno( wxPoint(856,1024), wxSize(1060,598) );
     while ( cout ) {
         file = path + wxFILE_SEP_PATH + file;
         file.Replace( wxT("\\"), wxT("/") );
         wxString html;
-        html = html + wxT("<html><body>");
-        html = html + wxT("<img src=\"") + file + wxT("\" width=\"750\" height=\"1060\"/>");
-        html = html + wxT("</body></html>");
         
-        hpout->SetHtmlText( html, wxEmptyString, false );
-        p->Print( NULL, hpout, false );
+        if ( mask_flg ) {       // 1枚目はマスクする
+            wxImage img_org( file, wxBITMAP_TYPE_JPEG );
+            img_org.SetRGB( cmname, 255, 255, 255 );
+            img_org.SetRGB( cmno,   255, 255, 255 );
+            img_org.SaveFile( wxT("tmp/tmp.jpg") );
+
+            html = html + wxT("<html><body>");
+            html = html + wxT("<img src=\"tmp/tmp.jpg\" width=\"750\" height=\"1060\"/>");
+            html = html + wxT("</body></html>");
+            hpout.SetHtmlText( html, wxEmptyString, false );
+            p.Print( NULL, &hpout, true );
+            pd = p.GetPrintDialogData();
+            mask_flg = false;
+        }
+        else {
+            html = html + wxT("<html><body>");
+            html = html + wxT("<img src=\"") + file + wxT("\" width=\"750\" height=\"1060\"/>");
+            html = html + wxT("</body></html>");
+            hpout.SetHtmlText( html, wxEmptyString, false );
+            p.Print( NULL, &hpout, false );
+        }
         cout = dir.GetNext( &file );
     }
     return;
@@ -617,6 +637,7 @@
 
     if ( f == NULL ) {
         HtmlHelpFrame *helpframe = new HtmlHelpFrame( wxT("Online Help"), ID_HELP ); 
+        helpframe->SetSize(600,600);
         helpframe->Show(true);
     }
     else {