comparison src/myframe.cpp @ 38:044cc2f5af81 v2.4 v2.7

small fix.
author pyon@macmini
date Thu, 24 Nov 2011 22:26:15 +0900
parents 3b54f3deeed9
children ce5b61376fd0
comparison
equal deleted inserted replaced
37:3b54f3deeed9 38:044cc2f5af81
1 // Filename : myframe.cpp 1 // Filename : myframe.cpp
2 // Last Change: 18-Nov-2011. 2 // Last Change: 24-Nov-2011.
3 // 3 //
4 4
5 #include "main.h" 5 #include "main.h"
6 #include "myframe.h" 6 #include "myframe.h"
7 #include "param.h" 7 #include "param.h"
8 #include "dndfile.h" 8 #include "dndfile.h"
9 #include "marksheet.h" 9 #include "marksheet.h"
10 #include "dirview.h"
10 11
11 #define LOGO_W 288 12 #define LOGO_W 288
12 #define LOGO_H 86 13 #define LOGO_H 86
13 #define HHSN_W 288 14 #define HHSN_W 288
14 #define HHSN_H 49 15 #define HHSN_H 49
45 46
46 m_menuFile->AppendSeparator(); // ---- 47 m_menuFile->AppendSeparator(); // ----
47 wxMenuItem* m_menuItemAutoDetect; 48 wxMenuItem* m_menuItemAutoDetect;
48 m_menuItemAutoDetect = new wxMenuItem( m_menuFile, ID_MENUITEMAUTOD, wxString( wxT("自動検知\tF2") ) , wxEmptyString, wxITEM_CHECK ); 49 m_menuItemAutoDetect = new wxMenuItem( m_menuFile, ID_MENUITEMAUTOD, wxString( wxT("自動検知\tF2") ) , wxEmptyString, wxITEM_CHECK );
49 m_menuFile->Append( m_menuItemAutoDetect ); 50 m_menuFile->Append( m_menuItemAutoDetect );
50 m_menuItemAutoDetect->Check(true); 51 m_menuItemAutoDetect->Check(false);
51 52
52 m_menuFile->AppendSeparator(); // ---- 53 m_menuFile->AppendSeparator(); // ----
53 wxMenuItem* m_menuItemParam; 54 wxMenuItem* m_menuItemParam;
54 m_menuItemParam = new wxMenuItem( m_menuFile, ID_MENUITEMPARAM, wxString( wxT("パラメータ\tAlt+P") ) , wxEmptyString, wxITEM_NORMAL ); 55 m_menuItemParam = new wxMenuItem( m_menuFile, ID_MENUITEMPARAM, wxString( wxT("パラメータ\tAlt+P") ) , wxEmptyString, wxITEM_NORMAL );
55 m_menuFile->Append( m_menuItemParam ); 56 m_menuFile->Append( m_menuItemParam );
456 if ( !cache_changed && by_autodetect ) return; 457 if ( !cache_changed && by_autodetect ) return;
457 458
458 // 本処理 459 // 本処理
459 m_listCtrlView->DeleteAllItems(); 460 m_listCtrlView->DeleteAllItems();
460 m_imageList->RemoveAll(); 461 m_imageList->RemoveAll();
461 wxListItem item;
462 m_textCtrlGuess->SetBackgroundColour(*wxWHITE); 462 m_textCtrlGuess->SetBackgroundColour(*wxWHITE);
463 463
464 if ( by_autodetect ) pd->Update( 0, wxT("処理開始") ); 464 if ( by_autodetect ) pd->Update( 0, wxT("処理開始") );
465 465
466 wxArrayString keys; 466 wxArrayString keys;
491 if ( i == 0 ) { // 1枚目はマークシートのはず 491 if ( i == 0 ) { // 1枚目はマークシートのはず
492 wxImage marksheet( ci->fullpath, wxBITMAP_TYPE_JPEG ); 492 wxImage marksheet( ci->fullpath, wxBITMAP_TYPE_JPEG );
493 493
494 // 氏名画像を表示 494 // 氏名画像を表示
495 wxImage name_image; 495 wxImage name_image;
496 name_image = marksheet.GetSubImage( wxRect( wxPoint(300,550), wxSize(640,190) ) ); 496 name_image = marksheet.GetSubImage( wxRect( wxPoint(300,550), wxSize(640,190) ) );
497 wxBitmap name_bmp = ( name_image.Scale( LOGO_W, LOGO_H, wxIMAGE_QUALITY_HIGH ) ); 497 wxBitmap name_bmp = ( name_image.Scale( LOGO_W, LOGO_H, wxIMAGE_QUALITY_HIGH ) );
498 m_bitmapName->SetBitmap( name_bmp ); 498 m_bitmapName->SetBitmap( name_bmp );
499 499
500 // 被保険者番号画像を表示 500 // 被保険者番号画像を表示
501 wxImage hhsno_image; 501 wxImage hhsno_image;
530 } 530 }
531 531
532 // 選択したものは青い画像を使う 532 // 選択したものは青い画像を使う
533 long i = -1; 533 long i = -1;
534 for ( ;; ) { 534 for ( ;; ) {
535 i = m_listCtrlView->GetNextItem(i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); 535 i = m_listCtrlView->GetNextItem( i, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
536 if ( i == -1 ) break; 536 if ( i == -1 ) break;
537 m_listCtrlView->SetItemImage( i, i+m_listCtrlView->GetItemCount() ); 537 m_listCtrlView->SetItemImage( i, i+m_listCtrlView->GetItemCount() );
538 } 538 }
539 539
540 by_autodetect = false; 540 by_autodetect = false;
543 543
544 /* 画像を選択したとき画像の情報をステータスバーに表示 */ 544 /* 画像を選択したとき画像の情報をステータスバーに表示 */
545 void MyFrame::OnItemSelected(wxListEvent& event) 545 void MyFrame::OnItemSelected(wxListEvent& event)
546 { 546 {
547 int i = event.GetIndex(); 547 int i = event.GetIndex();
548 int m = m_listCtrlView->GetSelectedItemCount(); 548 int m = m_listCtrlView->GetItemCount();
549 m_listCtrlView->SetItemImage( i, i+m ); // 青い画像 549 m_listCtrlView->SetItemImage( i, i+m ); // 青い画像
550 550
551 if ( m != 1 ) { 551 if ( m != 1 ) {
552 SetStatusText( wxString::Format(wxT("%d files selected."),m), 2 ); 552 SetStatusText( wxString::Format(wxT("%d files selected."),m), 2 );
553 return; 553 return;
717 717
718 item.SetColumn(1); 718 item.SetColumn(1);
719 item.SetMask(wxLIST_MASK_TEXT); 719 item.SetMask(wxLIST_MASK_TEXT);
720 m_listCtrlHhsDir->GetItem( item ); 720 m_listCtrlHhsDir->GetItem( item );
721 hhsdir.Append( item.GetText() ); 721 hhsdir.Append( item.GetText() );
722 wxString execmd = wxT("explorer ") + hhsdir; 722
723 wxExecute( execmd ); 723 DirViewFrame* dvf = new DirViewFrame( this, wxID_ANY, wxEmptyString );
724 dvf->m_dir = hhsdir;
725 dvf->Show(true);
724 } 726 }
725 727
726 /* 以下,定型もの ***********************************************/ 728 /* 以下,定型もの ***********************************************/
727 void MyFrame::OnTimer(wxTimerEvent& event) 729 void MyFrame::OnTimer(wxTimerEvent& event)
728 { 730 {