diff src/preview.cpp @ 12:52958cd4a073

Implement Force Mask button in Batch Print Mode.
author pyon@macmini
date Sun, 18 May 2014 19:49:15 +0900
parents dfcf8c973219
children bbd65edf71d4
line wrap: on
line diff
--- a/src/preview.cpp	Wed May 07 20:38:57 2014 +0900
+++ b/src/preview.cpp	Sun May 18 19:49:15 2014 +0900
@@ -1,7 +1,8 @@
 // Filename   : preview.cpp
-// Last Change: 01-May-2014.
+// Last Change: 16-May-2014.
 //
 
+#include "marksheet.h"
 #include "preview.h"
 #define THUMB_W 60
 #define THUMB_H 75
@@ -100,8 +101,13 @@
     m_thumbPanel = new PThumbnailPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), wxSUNKEN_BORDER );
 	bSizerMenu->Add( m_thumbPanel, 0, wxALL|wxEXPAND, 5 );
 
+    m_textInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 80 ), wxTE_MULTILINE|wxTE_READONLY|wxTE_NO_VSCROLL );
+	m_textInfo->SetBackgroundColour( wxColour( 192, 192, 192 ) );
+    bSizerMenu->Add( m_textInfo, 0, wxRIGHT|wxLEFT|wxBOTTOM, 5 );
+
 	m_buttonPrint = new wxButton( this, ID_PRINT, wxT("印刷"), wxDefaultPosition, wxDefaultSize, 0 );
 	bSizerMenu->Add( m_buttonPrint, 0, wxALL, 5 );
+
 	bSizerMenu->Add( 0, 0, 0, 0, 5 );
 	
 	m_buttonClose = new wxButton( this, wxID_CANCEL, wxT("閉じる"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -120,7 +126,7 @@
 
 // Event Table
 BEGIN_EVENT_TABLE( PreviewDialog, wxDialog )
-    EVT_BUTTON( ID_PRINT, PreviewDialog::OnPrint )
+    EVT_BUTTON( ID_PRINT,  PreviewDialog::OnPrint )
 END_EVENT_TABLE()
 
 #define WIDTH  2480
@@ -139,6 +145,15 @@
     m_scrolledWindow->Scroll( 0, 0 );
     m_scrolledWindow->SetScrollbars( 10, 10, 0, h/10 );
     m_preview = m_imagefiles[n];
+
+    //
+    float z;
+    long l;
+    GetScore( &z, &l, m_imagefiles[n] );
+    wxString info = m_imagefiles[n].AfterLast( wxFILE_SEP_PATH );
+    info += wxString::Format( wxT("\n%z = %f"), z );
+    info += wxString::Format( wxT("\n%l = %ld"), l );
+    m_textInfo->SetValue( info );
 }
 
 void PreviewDialog::SetFiles( wxArrayString imagefiles, wxArrayString cachefiles )
@@ -146,9 +161,12 @@
     m_imagefiles = imagefiles;
     m_cachefiles = cachefiles;
     m_thumbPanel->SetFiles( m_imagefiles, m_cachefiles );
+
+    wxString title = wxT("プレビュー @ ") + m_imagefiles[0].BeforeLast( wxFILE_SEP_PATH );
+    this->SetTitle( title );
 }
 
-void PreviewDialog::OnPrint( wxCommandEvent& WXUNUSED(envet) )
+void PreviewDialog::OnPrint( wxCommandEvent& WXUNUSED(event) )
 {
     wxString html;
     html = html + wxT("<html><body>\n");