Mercurial > mercurial > hgweb_searcher03.cgi
annotate src/preview.cpp @ 22:92188f60323d default tip
Implement Masking function on Preview Dialog.
author | pyon@macmini |
---|---|
date | Sat, 04 Apr 2015 17:23:46 +0900 |
parents | de222bc84e48 |
children |
rev | line source |
---|---|
9 | 1 // Filename : preview.cpp |
22 | 2 // Last Change: 2015-04-03 11:57:55. |
9 | 3 // |
4 | |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
5 #include "marksheet.h" |
9 | 6 #include "preview.h" |
7 #define THUMB_W 60 | |
8 #define THUMB_H 75 | |
9 | |
10 | 10 // サムネイルパネル |
11 PThumbnailPanel::PThumbnailPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) | |
12 : wxPanel( parent, id, pos, size, style ) | |
13 { | |
14 m_parent = (PreviewDialog*)parent; | |
15 | |
16 wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL ); | |
17 this->SetBackgroundColour( wxColour( 192, 192, 192 ) ); | |
18 | |
19 wxString thumb = wxGetCwd() + wxFILE_SEP_PATH + wxT("image") + wxFILE_SEP_PATH + wxT("thumbnail.png"); | |
20 wxBitmap bmp = wxBitmap( thumb, wxBITMAP_TYPE_PNG ); | |
21 | |
22 m_bitmap0 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
23 bSizer->Add( m_bitmap0, 0, wxALL|wxALIGN_CENTER, 5 ); | |
24 m_bitmap0->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick0 ), NULL, this ); | |
25 | |
26 m_bitmap1 = new wxStaticBitmap(this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
27 bSizer->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER, 5 ); | |
28 m_bitmap1->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick1 ), NULL, this ); | |
29 | |
30 m_bitmap2 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
31 bSizer->Add( m_bitmap2, 0, wxALL|wxALIGN_CENTER, 5 ); | |
32 m_bitmap2->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick2 ), NULL, this ); | |
33 | |
34 m_bitmap3 = new wxStaticBitmap(this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
35 bSizer->Add( m_bitmap3, 0, wxALL|wxALIGN_CENTER, 5 ); | |
36 m_bitmap3->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick3 ), NULL, this ); | |
37 | |
38 m_bitmap4 = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
39 bSizer->Add( m_bitmap4, 0, wxALL|wxALIGN_CENTER, 5 ); | |
40 m_bitmap4->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick4 ), NULL, this ); | |
41 | |
42 m_bitmap5 = new wxStaticBitmap(this, wxID_ANY, bmp, wxDefaultPosition, wxSize( THUMB_W, THUMB_H ), 0 ); | |
43 bSizer->Add( m_bitmap5, 0, wxALL|wxALIGN_CENTER, 5 ); | |
44 m_bitmap5->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick5 ), NULL, this ); | |
45 | |
46 this->SetSizer( bSizer ); | |
47 this->Layout(); | |
48 } | |
49 | |
50 PThumbnailPanel::~PThumbnailPanel() | |
51 { | |
52 m_bitmap0->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick0 ), NULL, this ); | |
53 m_bitmap1->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick1 ), NULL, this ); | |
54 m_bitmap2->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick2 ), NULL, this ); | |
55 m_bitmap3->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick3 ), NULL, this ); | |
56 m_bitmap4->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick4 ), NULL, this ); | |
57 m_bitmap5->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( PThumbnailPanel::OnClick5 ), NULL, this ); | |
58 } | |
59 | |
60 // Functions | |
15 | 61 /* サムネイル画像作成 */ |
13 | 62 void PThumbnailPanel::SetFiles( wxArrayString imagefiles, wxArrayString cachefiles, int select ) |
10 | 63 { |
64 m_imagefiles = imagefiles; | |
65 | |
66 wxBitmap bmp; | |
13 | 67 m_imageList.Create( THUMB_W, THUMB_H ); |
68 | |
69 bmp.LoadFile( cachefiles[0], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
70 bmp.LoadFile( cachefiles[1], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
71 bmp.LoadFile( cachefiles[2], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
72 bmp.LoadFile( cachefiles[3], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
73 bmp.LoadFile( cachefiles[4], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
74 bmp.LoadFile( cachefiles[5], wxBITMAP_TYPE_PNG ); m_imageList.Add( bmp ); | |
75 SetImageList( select ); | |
10 | 76 } |
77 /* 画像クリックで拡大表示 */ | |
78 void PThumbnailPanel::OnClick0( wxMouseEvent& WXUNUSED(event) ) { Preview( 0 ); } | |
79 void PThumbnailPanel::OnClick1( wxMouseEvent& WXUNUSED(event) ) { Preview( 1 ); } | |
80 void PThumbnailPanel::OnClick2( wxMouseEvent& WXUNUSED(event) ) { Preview( 2 ); } | |
81 void PThumbnailPanel::OnClick3( wxMouseEvent& WXUNUSED(event) ) { Preview( 3 ); } | |
82 void PThumbnailPanel::OnClick4( wxMouseEvent& WXUNUSED(event) ) { Preview( 4 ); } | |
83 void PThumbnailPanel::OnClick5( wxMouseEvent& WXUNUSED(event) ) { Preview( 5 ); } | |
84 void PThumbnailPanel::Preview( int n ) | |
85 { | |
22 | 86 if ( n == 0 ) m_parent->EnableMaskButton( true ); |
87 else m_parent->EnableMaskButton( false ); | |
88 | |
10 | 89 if ( m_imagefiles.GetCount() < n + 1 ) return; |
13 | 90 SetImageList( n ); |
10 | 91 m_parent->SetPreviewImage( n ); |
92 } | |
13 | 93 /* サムネイル表示 */ |
94 void PThumbnailPanel::SetImageList( int selected ) | |
95 { | |
96 m_bitmap0->SetBitmap( m_imageList.GetBitmap(0) ); | |
97 m_bitmap1->SetBitmap( m_imageList.GetBitmap(1) ); | |
98 m_bitmap2->SetBitmap( m_imageList.GetBitmap(2) ); | |
99 m_bitmap3->SetBitmap( m_imageList.GetBitmap(3) ); | |
100 m_bitmap4->SetBitmap( m_imageList.GetBitmap(4) ); | |
101 m_bitmap5->SetBitmap( m_imageList.GetBitmap(5) ); | |
10 | 102 |
13 | 103 wxImage image = m_imageList.GetBitmap( selected ).ConvertToImage(); |
104 unsigned char *data = image.GetData(); | |
105 for ( int y = 0; y < THUMB_H; y++ ) | |
106 for ( int x = 0; x <THUMB_W; x++ ) | |
107 data[ ( y * THUMB_W + x ) * 3 + 2 ] = 255; // 文字色:黒(0,0,0)->青(0,0,255) | |
108 | |
109 wxBitmap bmp_mask( image ); | |
110 | |
111 switch ( selected ) { | |
112 case 0: | |
113 m_bitmap0->SetBitmap( bmp_mask ); | |
114 break; | |
115 case 1: | |
116 m_bitmap1->SetBitmap( bmp_mask ); | |
117 break; | |
118 case 2: | |
119 m_bitmap2->SetBitmap( bmp_mask ); | |
120 break; | |
121 case 3: | |
122 m_bitmap3->SetBitmap( bmp_mask ); | |
123 break; | |
124 case 4: | |
125 m_bitmap4->SetBitmap( bmp_mask ); | |
126 break; | |
127 case 5: | |
128 m_bitmap5->SetBitmap( bmp_mask ); | |
129 break; | |
130 } | |
131 } | |
10 | 132 |
133 //////////////////////////////////////////////////////// | |
134 // プレビューダイアログ | |
9 | 135 PreviewDialog::PreviewDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) |
136 : wxDialog( parent, id, title, pos, size, style ) | |
137 { | |
138 wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL ); | |
139 | |
14 | 140 m_scrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxALWAYS_SHOW_SB ); |
15 | 141 m_scrolledWindow->Connect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PreviewDialog::OnWheel ), NULL, this ); |
9 | 142 m_bitmap = new wxStaticBitmap( m_scrolledWindow, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); |
14 | 143 m_bitmap->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( PreviewDialog::OnDClick ), NULL, this ); |
15 | 144 m_bitmap->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( PreviewDialog::OnStartRGesture ), NULL, this ); |
145 m_bitmap->Connect( wxEVT_RIGHT_UP, wxMouseEventHandler( PreviewDialog::OnEndRGesture ), NULL, this ); | |
9 | 146 bSizerTop->Add( m_scrolledWindow, 1, wxALL|wxEXPAND, 5 ); |
147 | |
148 wxBoxSizer* bSizerMenu = new wxBoxSizer( wxVERTICAL ); | |
149 | |
10 | 150 m_thumbPanel = new PThumbnailPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), wxSUNKEN_BORDER ); |
151 bSizerMenu->Add( m_thumbPanel, 0, wxALL|wxEXPAND, 5 ); | |
9 | 152 |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
153 m_textInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 80 ), wxTE_MULTILINE|wxTE_READONLY|wxTE_NO_VSCROLL ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
154 m_textInfo->SetBackgroundColour( wxColour( 192, 192, 192 ) ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
155 bSizerMenu->Add( m_textInfo, 0, wxRIGHT|wxLEFT|wxBOTTOM, 5 ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
156 |
9 | 157 m_buttonPrint = new wxButton( this, ID_PRINT, wxT("印刷"), wxDefaultPosition, wxDefaultSize, 0 ); |
158 bSizerMenu->Add( m_buttonPrint, 0, wxALL, 5 ); | |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
159 |
22 | 160 m_buttonMaskPrint = new wxButton( this, ID_MPRINT, wxT("マスク印刷"), wxDefaultPosition, wxDefaultSize, 0 ); |
161 bSizerMenu->Add( m_buttonMaskPrint, 0, wxALL, 5 ); | |
162 m_buttonMaskPrint->Enable( false ); | |
163 | |
11 | 164 bSizerMenu->Add( 0, 0, 0, 0, 5 ); |
9 | 165 |
166 m_buttonClose = new wxButton( this, wxID_CANCEL, wxT("閉じる"), wxDefaultPosition, wxDefaultSize, 0 ); | |
167 m_buttonClose->SetDefault(); | |
168 bSizerMenu->Add( m_buttonClose, 0, wxALL, 5 ); | |
169 | |
170 bSizerTop->Add( bSizerMenu, 0, wxALL|wxEXPAND, 5 ); | |
171 | |
172 this->SetSizer( bSizerTop ); | |
173 this->Layout(); | |
174 } | |
175 | |
176 PreviewDialog::~PreviewDialog() | |
177 { | |
15 | 178 m_scrolledWindow->Disconnect( wxEVT_MOUSEWHEEL, wxMouseEventHandler( PreviewDialog::OnWheel ), NULL, this ); |
22 | 179 m_bitmap->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( PreviewDialog::OnDClick ), NULL, this ); |
180 m_bitmap->Disconnect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( PreviewDialog::OnStartRGesture ), NULL, this ); | |
181 m_bitmap->Disconnect( wxEVT_RIGHT_UP, wxMouseEventHandler( PreviewDialog::OnEndRGesture ), NULL, this ); | |
9 | 182 } |
183 | |
184 // Event Table | |
185 BEGIN_EVENT_TABLE( PreviewDialog, wxDialog ) | |
22 | 186 EVT_BUTTON( ID_PRINT, PreviewDialog::OnPrint ) |
187 EVT_BUTTON( ID_MPRINT, PreviewDialog::OnMaskPrint ) | |
9 | 188 END_EVENT_TABLE() |
189 | |
190 #define WIDTH 2480 | |
191 #define HEIGHT 3509 | |
15 | 192 /* プレビューするファイルをセット */ |
10 | 193 void PreviewDialog::SetPreviewImage( int n ) |
9 | 194 { |
15 | 195 m_preview = n; |
14 | 196 m_zoom = 1.0; |
197 SetZoom( m_zoom ); | |
9 | 198 |
14 | 199 // file info |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
200 float z; |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
201 long l; |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
202 GetScore( &z, &l, m_imagefiles[n] ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
203 wxString info = m_imagefiles[n].AfterLast( wxFILE_SEP_PATH ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
204 info += wxString::Format( wxT("\n%z = %f"), z ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
205 info += wxString::Format( wxT("\n%l = %ld"), l ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
206 m_textInfo->SetValue( info ); |
10 | 207 } |
208 | |
15 | 209 /* 倍率を指定しロード */ |
14 | 210 void PreviewDialog::SetZoom( float zoom ) |
211 { | |
212 int w, h; | |
213 m_scrolledWindow->GetSize( &w, &h ); | |
214 w = (int)( zoom * h * WIDTH / HEIGHT ); | |
215 h = (int)( zoom * h ); | |
216 | |
217 m_bitmap->SetBitmap( wxNullBitmap ); | |
218 wxImage img; | |
15 | 219 img.LoadFile( m_imagefiles[m_preview], wxBITMAP_TYPE_JPEG ); |
14 | 220 wxBitmap bmp( img.Scale( w, h, wxIMAGE_QUALITY_HIGH ) ); |
221 m_bitmap->SetBitmap( bmp ); | |
222 m_bitmap->Centre( wxHORIZONTAL ); | |
223 | |
224 m_scrolledWindow->Scroll( 0, 0 ); | |
225 m_scrolledWindow->SetScrollbars( 10, 10, 0, h/10 ); | |
226 } | |
227 | |
15 | 228 /* ファイル名を保持 */ |
13 | 229 void PreviewDialog::SetFiles( wxArrayString imagefiles, wxArrayString cachefiles, int select ) |
10 | 230 { |
231 m_imagefiles = imagefiles; | |
232 m_cachefiles = cachefiles; | |
13 | 233 m_thumbPanel->SetFiles( m_imagefiles, m_cachefiles, select ); |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
234 |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
235 wxString title = wxT("プレビュー @ ") + m_imagefiles[0].BeforeLast( wxFILE_SEP_PATH ); |
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
236 this->SetTitle( title ); |
9 | 237 } |
238 | |
15 | 239 /* コントロールキー + マウスホイール で画像を拡大・縮小 */ |
14 | 240 void PreviewDialog::OnWheel( wxMouseEvent& event ) |
241 { | |
242 if ( event.ControlDown() ) { | |
243 if ( event.GetWheelRotation() < 0 ) { | |
244 if ( m_zoom > 2.1 ) return; | |
245 m_zoom *= 1.3; | |
246 } | |
247 else { | |
248 if ( m_zoom <= 1.0 ) return; | |
249 m_zoom /= 1.3; | |
250 } | |
251 SetZoom( m_zoom ); | |
252 return; | |
253 } | |
254 event.Skip(); | |
255 } | |
256 | |
15 | 257 /* 画像のダブルクリックで倍率変更 */ |
14 | 258 void PreviewDialog::OnDClick( wxMouseEvent& WXUNUSED(event) ) |
259 { | |
260 if ( m_zoom > 2.1 ) m_zoom = 1.0; | |
261 else m_zoom *= 1.3; | |
262 | |
263 SetZoom( m_zoom ); | |
264 } | |
265 | |
15 | 266 /* 右ジェスチャー検知開始 */ |
267 void PreviewDialog::OnStartRGesture( wxMouseEvent& event ) | |
268 { | |
269 event.GetPosition( &cx, &cy ); | |
270 } | |
271 | |
272 /* 右ジェスチャー判定 */ | |
273 void PreviewDialog::OnEndRGesture( wxMouseEvent& event ) | |
274 { | |
275 int x, y; | |
276 event.GetPosition( &x, &y ); | |
277 | |
278 int dx = x - cx; | |
279 int dy = y - cy; | |
280 float rad = fabs( atan2( dy, dx ) ); | |
281 float pi = 3.14159; | |
282 | |
283 // 右へジェスチャー | |
284 if ( rad < pi/8 && dx > 0 ) { | |
285 if ( m_preview < m_imagefiles.GetCount() - 1 ) | |
286 m_preview++; | |
287 else | |
288 return; | |
289 m_thumbPanel->Preview( m_preview ); | |
290 } | |
291 // 左へジェスチャー | |
292 else if ( rad > pi/8*7 && rad < pi && dx < 0 ) { | |
293 if ( m_preview > 0 ) | |
294 m_preview--; | |
295 else | |
296 return; | |
297 m_thumbPanel->Preview( m_preview ); | |
298 } | |
299 // 右上ヘジェスチャー | |
300 else if ( rad > pi/8 && rad < pi/8*3 && dx > 0 ) { | |
301 Close(); | |
302 } | |
303 } | |
304 | |
305 /* 印刷 */ | |
12
52958cd4a073
Implement Force Mask button in Batch Print Mode.
pyon@macmini
parents:
11
diff
changeset
|
306 void PreviewDialog::OnPrint( wxCommandEvent& WXUNUSED(event) ) |
9 | 307 { |
308 wxString html; | |
309 html = html + wxT("<html><body>\n"); | |
310 | |
311 wxString tmpjpg = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("preview.jpg"); | |
312 | |
15 | 313 wxCopyFile( m_imagefiles[m_preview], tmpjpg, true ); |
9 | 314 |
315 html = html + wxT("<img src=\"") + tmpjpg + wxT("\" width=\"750\" height=\"1060\"/>"); | |
316 html = html + wxT("</body></html>"); | |
317 | |
318 // start printing | |
319 wxHtmlPrintout hpout( wxT("Searcher03") ); | |
320 hpout.SetMargins( 0, 0, 0, 0, 0 ); | |
321 wxPrintDialogData pd; | |
322 wxPrinter p( &pd ); | |
323 | |
324 hpout.SetHtmlText( html, wxEmptyString, false ); | |
325 p.Print( NULL, &hpout, true ); | |
326 } | |
327 | |
22 | 328 /* マスク印刷 */ |
329 void PreviewDialog::OnMaskPrint( wxCommandEvent& WXUNUSED(event) ) | |
330 { | |
331 wxString html; | |
332 html = html + wxT("<html><body>\n"); | |
333 | |
334 wxString tmpjpg = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("preview.jpg"); | |
335 | |
336 wxImage img_org( m_imagefiles[m_preview], wxBITMAP_TYPE_JPEG ); | |
337 int ver = GetMarksheetVersion( m_imagefiles[m_preview] ); | |
338 if ( ver == 2 ) { | |
339 img_org.SetRGB( m_mask1, 255, 255, 255 ); // cm name | |
340 img_org.SetRGB( m_mask2, 255, 255, 255 ); // cm no. | |
341 img_org.SetRGB( m_mask3, 255, 255, 255 ); // barcode | |
342 } | |
343 else { // 古いマークシート ver == 1 | |
344 img_org.SetRGB( m_mask1old, 255, 255, 255 ); // cm name | |
345 img_org.SetRGB( m_mask2old, 255, 255, 255 ); // cm no. | |
346 img_org.SetRGB( m_mask3old, 255, 255, 255 ); // barcode | |
347 } | |
348 img_org.SaveFile( tmpjpg ); | |
349 | |
350 html = html + wxT("<img src=\"") + tmpjpg + wxT("\" width=\"750\" height=\"1060\"/>"); | |
351 html = html + wxT("</body></html>"); | |
352 | |
353 // start printing | |
354 wxHtmlPrintout hpout( wxT("Searcher03") ); | |
355 hpout.SetMargins( 0, 0, 0, 0, 0 ); | |
356 wxPrintDialogData pd; | |
357 wxPrinter p( &pd ); | |
358 | |
359 hpout.SetHtmlText( html, wxEmptyString, false ); | |
360 p.Print( NULL, &hpout, true ); | |
361 } | |
362 | |
363 void PreviewDialog::EnableMaskButton( bool flag ) | |
364 { | |
365 if ( flag ) m_buttonMaskPrint->Enable( true ); | |
366 else m_buttonMaskPrint->Enable( false ); | |
367 } | |
368 |