comparison src/myframe.cpp @ 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 bc2e2b304095
children 4967d1e2b30c
comparison
equal deleted inserted replaced
6:76db82822e73 7:7ac7d28699af
1 // Filename : myframe.cpp 1 // Filename : myframe.cpp
2 // Last Change: 13-Sep-2013. 2 // Last Change: 17-Oct-2013.
3 // 3 //
4 #include "main.h" 4 #include "main.h"
5 #include "db.h" 5 #include "db.h"
6 #include "about.h" 6 #include "about.h"
7 #include "kana.h" 7 #include "kana.h"
333 config->Read( wxT("zmax"), &zmax ); 333 config->Read( wxT("zmax"), &zmax );
334 } 334 }
335 /* 印刷 */ 335 /* 印刷 */
336 void MyFrame::PrintImages( wxString hhsno ) 336 void MyFrame::PrintImages( wxString hhsno )
337 { 337 {
338 bool mask_flag = false;
339 wxMessageDialog md( this, wxT("マクスしますか?"), wxT("印刷オプション"), wxYES_NO, wxDefaultPosition );
340 if ( md.ShowModal() == wxID_YES ) {
341 mask_flag = true;
342 }
343
338 // 印刷用の html を作成 344 // 印刷用の html を作成
339 wxArrayString path = GetPathByHhsNo( hhsno ); 345 wxArrayString path = GetPathByHhsNo( hhsno );
340 if ( path.IsEmpty() ) return; 346 if ( path.IsEmpty() ) return;
341 347
342 wxDir dir( path[0] ); 348 wxDir dir( path[0] );
355 file.Replace( wxFILE_SEP_PATH, wxT("/") ); 361 file.Replace( wxFILE_SEP_PATH, wxT("/") );
356 wxString tmpjpg = wxString::Format( wxT("%stmp%d.jpg"), tmpdir, n ); 362 wxString tmpjpg = wxString::Format( wxT("%stmp%d.jpg"), tmpdir, n );
357 363
358 if ( notyet_mask && IsMarksheet( file, zmin, zmax, lmin, lmax ) ) { // マークシート表面をマスクする 364 if ( notyet_mask && IsMarksheet( file, zmin, zmax, lmin, lmax ) ) { // マークシート表面をマスクする
359 wxImage img_org( file, wxBITMAP_TYPE_JPEG ); 365 wxImage img_org( file, wxBITMAP_TYPE_JPEG );
360 int ver = GetMarksheetVersion( file ); 366 if ( mask_flag ) {
361 if ( ver == 2 ) { 367 int ver = GetMarksheetVersion( file );
362 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name 368 if ( ver == 2 ) {
363 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no. 369 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name
364 img_org.SetRGB( m_mask3, 255, 255, 255 ); // barcode 370 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no.
365 } 371 img_org.SetRGB( m_mask3, 255, 255, 255 ); // barcode
366 else { // 古いマークシート ver == 1 372 }
367 img_org.SetRGB( m_mask1old, 255, 255, 255 ); // cm name 373 else { // 古いマークシート ver == 1
368 img_org.SetRGB( m_mask2old, 255, 255, 255 ); // cm no. 374 img_org.SetRGB( m_mask1old, 255, 255, 255 ); // cm name
369 img_org.SetRGB( m_mask3old, 255, 255, 255 ); // barcode 375 img_org.SetRGB( m_mask2old, 255, 255, 255 ); // cm no.
376 img_org.SetRGB( m_mask3old, 255, 255, 255 ); // barcode
377 }
370 } 378 }
371 img_org.SaveFile( tmpjpg ); 379 img_org.SaveFile( tmpjpg );
372 notyet_mask = false; 380 notyet_mask = false;
373 } 381 }
374 else { 382 else {
410 { 418 {
411 wxString rootdir; 419 wxString rootdir;
412 config->SetPath( wxT("/Index") ); 420 config->SetPath( wxT("/Index") );
413 config->Read( wxT("rootdir"), &rootdir ); 421 config->Read( wxT("rootdir"), &rootdir );
414 422
415 IndexDialog* index = new IndexDialog( this, wxID_ANY, wxT("インデックス作成"), wxDefaultPosition, wxSize( 700, 600 ), wxCAPTION|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxTAB_TRAVERSAL ); 423 IndexDialog* index = new IndexDialog( this, wxID_ANY, wxT("インデックス作成"), wxDefaultPosition, wxSize( 700, 600 ), wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP );
416 index->ShowWithEffect( wxSHOW_EFFECT_SLIDE_TO_BOTTOM ); 424 index->ShowModal();
417 index->SetRootdir( rootdir ); 425 index->SetRootdir( rootdir );
418 index->ShowModal();
419 } 426 }
420 /* マークシートパラメータ設定ダイアログ */ 427 /* マークシートパラメータ設定ダイアログ */
421 void MyFrame::OnMarkParam( wxCommandEvent& WXUNUSED(event) ) 428 void MyFrame::OnMarkParam( wxCommandEvent& WXUNUSED(event) )
422 { 429 {
423 SetParams( 2 ); 430 SetParams( 2 );