Mercurial > mercurial > hgweb_searcher03.cgi
comparison src/bprint.cpp @ 6:76db82822e73
Implement kana fuzzy search.
 Implement batch print log.
| author | pyon@macmini | 
|---|---|
| date | Wed, 18 Sep 2013 18:20:40 +0900 | 
| parents | bc2e2b304095 | 
| children | 4967d1e2b30c | 
   comparison
  equal
  deleted
  inserted
  replaced
| 5:bc2e2b304095 | 6:76db82822e73 | 
|---|---|
| 1 // Filename : bprint.cpp | 1 // Filename : bprint.cpp | 
| 2 // Last Change: 13-Sep-2013. | 2 // Last Change: 18-Sep-2013. | 
| 3 // | 3 // | 
| 4 | 4 | 
| 5 #include "bprint.h" | 5 #include "bprint.h" | 
| 6 #include "marksheet.h" | 6 #include "marksheet.h" | 
| 7 #include "dndfile.h" | 7 #include "dndfile.h" | 
| 118 void FrameBatchPrint::OnPrint( wxCommandEvent& WXUNUSED(event) ) | 118 void FrameBatchPrint::OnPrint( wxCommandEvent& WXUNUSED(event) ) | 
| 119 { | 119 { | 
| 120 wxPrintDialogData pd; | 120 wxPrintDialogData pd; | 
| 121 wxPrinter p( &pd ); | 121 wxPrinter p( &pd ); | 
| 122 p.PrintDialog( NULL ); | 122 p.PrintDialog( NULL ); | 
| 123 wxArrayString log; | |
| 123 | 124 | 
| 124 for ( int r = 0; r < m_grid->GetNumberRows(); r++ ) { | 125 for ( int r = 0; r < m_grid->GetNumberRows(); r++ ) { | 
| 125 wxString path = m_grid->GetCellValue( r, 2 ); | 126 wxString path = m_grid->GetCellValue( r, 2 ); | 
| 126 | 127 | 
| 127 // 印刷用の html を作成 | 128 // 印刷用の html を作成 | 
| 173 | 174 | 
| 174 hpout.SetHtmlText( html, wxEmptyString, false ); | 175 hpout.SetHtmlText( html, wxEmptyString, false ); | 
| 175 p.Print( NULL, &hpout, false ); | 176 p.Print( NULL, &hpout, false ); | 
| 176 | 177 | 
| 177 m_grid->SetCellValue( r, 3, wxT("処理済") ); | 178 m_grid->SetCellValue( r, 3, wxT("処理済") ); | 
| 179 log.Add( path ); | |
| 178 } | 180 } | 
| 181 WriteLog( log ); | |
| 179 } | 182 } | 
| 180 | 183 | 
| 181 /* 入力禁止 */ | 184 /* 入力禁止 */ | 
| 182 void FrameBatchPrint::SetGridReadOnly( void ) | 185 void FrameBatchPrint::SetGridReadOnly( void ) | 
| 183 { | 186 { | 
| 184 for ( int r = 0; r < m_grid->GetNumberRows(); r++ ) | 187 for ( int r = 0; r < m_grid->GetNumberRows(); r++ ) | 
| 185 for ( int c = 1; c < m_grid->GetNumberCols(); c++ ) | 188 for ( int c = 1; c < m_grid->GetNumberCols(); c++ ) | 
| 186 m_grid->SetReadOnly( r, c, true ); | 189 m_grid->SetReadOnly( r, c, true ); | 
| 187 } | 190 } | 
| 188 | 191 | 
| 189 | 192 /* 印刷ログ */ | 
| 193 void FrameBatchPrint::WriteLog( wxArrayString logline ) | |
| 194 { | |
| 195 wxDateTime now = wxDateTime::Now(); | |
| 196 wxString log_file = wxGetCwd() + wxFILE_SEP_PATH + wxT("log") + wxFILE_SEP_PATH + wxT("bp_") + now.Format( wxT("%Y%m%d%H%M%S.log") ); | |
| 197 wxTextFile file( log_file ); | |
| 198 file.Create(); | |
| 199 wxTextFile logfile; | |
| 200 logfile.Open( log_file ); | |
| 201 | |
| 202 for ( int n = 0; n < logline.GetCount(); n++ ) { | |
| 203 logfile.AddLine( logline[n] ); | |
| 204 } | |
| 205 logfile.Write(); | |
| 206 logfile.Close(); | |
| 207 } | |
| 208 | 
