comparison src/bprint.cpp @ 22:92188f60323d default tip

Implement Masking function on Preview Dialog.
author pyon@macmini
date Sat, 04 Apr 2015 17:23:46 +0900
parents a2ad87cad48b
children
comparison
equal deleted inserted replaced
21:a2ad87cad48b 22:92188f60323d
1 // Filename : bprint.cpp 1 // Filename : bprint.cpp
2 // Last Change: 12-Aug-2014. 2 // Last Change: 2015-04-04 11:06:15.
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"
120 120
121 /* グリッドをクリア */ 121 /* グリッドをクリア */
122 void FrameBatchPrint::OnClear( wxCommandEvent& WXUNUSED(event) ) 122 void FrameBatchPrint::OnClear( wxCommandEvent& WXUNUSED(event) )
123 { 123 {
124 m_grid->ClearGrid(); 124 m_grid->ClearGrid();
125 }
126
127 /* CSVファイルから一括読込み */
128 void FrameBatchPrint::LoadCSV( wxString file )
129 {
130 m_grid->ClearGrid();
131
132 // ファイルから被保番リストを生成
133 wxTextFile csv;
134 csv.Open( file );
135
136 wxRegEx reHhs( wxT("^0[1238][0-9]{8}$") );
137 wxArrayString hhs;
138 for ( int n = 0; n < csv.GetLineCount(); n++ ) {
139 wxString hhsno = csv.GetLine( n ).BeforeFirst( ',', NULL );
140 if ( ! reHhs.Matches( hhsno ) )
141 continue;
142 hhs.Add( hhsno );
143 }
144 csv.Close();
145
146 //
147 int d = hhs.GetCount() - m_grid->GetNumberRows();
148 if ( d > 0 )
149 m_grid->AppendRows( d, true );
150
151 // グリッドに情報を読込み
152 wxArrayString res = GetHhsInfoAndPathByHhsNoList( hhs );
153 for ( int r = 0; r < res.GetCount(); r++ ) {
154 wxArrayString data = wxSplit( res[r], '_', '\\' );
155 m_grid->SetCellValue( r, 0, data[0] );
156 m_grid->SetCellValue( r, 1, data[1] );
157 m_grid->SetCellValue( r, 2, data[2] );
158 }
125 } 159 }
126 160
127 /* 一括印刷処理 */ 161 /* 一括印刷処理 */
128 void FrameBatchPrint::OnPrint( wxCommandEvent& WXUNUSED(event) ) 162 void FrameBatchPrint::OnPrint( wxCommandEvent& WXUNUSED(event) )
129 { 163 {