Mercurial > mercurial > hgweb_searcher03.cgi
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 11:dfcf8c973219 | 12:52958cd4a073 |
|---|---|
| 1 // Filename : preview.cpp | 1 // Filename : preview.cpp |
| 2 // Last Change: 01-May-2014. | 2 // Last Change: 16-May-2014. |
| 3 // | 3 // |
| 4 | 4 |
| 5 #include "marksheet.h" | |
| 5 #include "preview.h" | 6 #include "preview.h" |
| 6 #define THUMB_W 60 | 7 #define THUMB_W 60 |
| 7 #define THUMB_H 75 | 8 #define THUMB_H 75 |
| 8 | 9 |
| 9 // サムネイルパネル | 10 // サムネイルパネル |
| 98 wxBoxSizer* bSizerMenu = new wxBoxSizer( wxVERTICAL ); | 99 wxBoxSizer* bSizerMenu = new wxBoxSizer( wxVERTICAL ); |
| 99 | 100 |
| 100 m_thumbPanel = new PThumbnailPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), wxSUNKEN_BORDER ); | 101 m_thumbPanel = new PThumbnailPanel( this, wxID_ANY, wxDefaultPosition, wxSize( 100, -1 ), wxSUNKEN_BORDER ); |
| 101 bSizerMenu->Add( m_thumbPanel, 0, wxALL|wxEXPAND, 5 ); | 102 bSizerMenu->Add( m_thumbPanel, 0, wxALL|wxEXPAND, 5 ); |
| 102 | 103 |
| 104 m_textInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1, 80 ), wxTE_MULTILINE|wxTE_READONLY|wxTE_NO_VSCROLL ); | |
| 105 m_textInfo->SetBackgroundColour( wxColour( 192, 192, 192 ) ); | |
| 106 bSizerMenu->Add( m_textInfo, 0, wxRIGHT|wxLEFT|wxBOTTOM, 5 ); | |
| 107 | |
| 103 m_buttonPrint = new wxButton( this, ID_PRINT, wxT("印刷"), wxDefaultPosition, wxDefaultSize, 0 ); | 108 m_buttonPrint = new wxButton( this, ID_PRINT, wxT("印刷"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 104 bSizerMenu->Add( m_buttonPrint, 0, wxALL, 5 ); | 109 bSizerMenu->Add( m_buttonPrint, 0, wxALL, 5 ); |
| 110 | |
| 105 bSizerMenu->Add( 0, 0, 0, 0, 5 ); | 111 bSizerMenu->Add( 0, 0, 0, 0, 5 ); |
| 106 | 112 |
| 107 m_buttonClose = new wxButton( this, wxID_CANCEL, wxT("閉じる"), wxDefaultPosition, wxDefaultSize, 0 ); | 113 m_buttonClose = new wxButton( this, wxID_CANCEL, wxT("閉じる"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 108 m_buttonClose->SetDefault(); | 114 m_buttonClose->SetDefault(); |
| 109 bSizerMenu->Add( m_buttonClose, 0, wxALL, 5 ); | 115 bSizerMenu->Add( m_buttonClose, 0, wxALL, 5 ); |
| 118 { | 124 { |
| 119 } | 125 } |
| 120 | 126 |
| 121 // Event Table | 127 // Event Table |
| 122 BEGIN_EVENT_TABLE( PreviewDialog, wxDialog ) | 128 BEGIN_EVENT_TABLE( PreviewDialog, wxDialog ) |
| 123 EVT_BUTTON( ID_PRINT, PreviewDialog::OnPrint ) | 129 EVT_BUTTON( ID_PRINT, PreviewDialog::OnPrint ) |
| 124 END_EVENT_TABLE() | 130 END_EVENT_TABLE() |
| 125 | 131 |
| 126 #define WIDTH 2480 | 132 #define WIDTH 2480 |
| 127 #define HEIGHT 3509 | 133 #define HEIGHT 3509 |
| 128 void PreviewDialog::SetPreviewImage( int n ) | 134 void PreviewDialog::SetPreviewImage( int n ) |
| 137 m_bitmap->SetBitmap( bmp ); | 143 m_bitmap->SetBitmap( bmp ); |
| 138 | 144 |
| 139 m_scrolledWindow->Scroll( 0, 0 ); | 145 m_scrolledWindow->Scroll( 0, 0 ); |
| 140 m_scrolledWindow->SetScrollbars( 10, 10, 0, h/10 ); | 146 m_scrolledWindow->SetScrollbars( 10, 10, 0, h/10 ); |
| 141 m_preview = m_imagefiles[n]; | 147 m_preview = m_imagefiles[n]; |
| 148 | |
| 149 // | |
| 150 float z; | |
| 151 long l; | |
| 152 GetScore( &z, &l, m_imagefiles[n] ); | |
| 153 wxString info = m_imagefiles[n].AfterLast( wxFILE_SEP_PATH ); | |
| 154 info += wxString::Format( wxT("\n%z = %f"), z ); | |
| 155 info += wxString::Format( wxT("\n%l = %ld"), l ); | |
| 156 m_textInfo->SetValue( info ); | |
| 142 } | 157 } |
| 143 | 158 |
| 144 void PreviewDialog::SetFiles( wxArrayString imagefiles, wxArrayString cachefiles ) | 159 void PreviewDialog::SetFiles( wxArrayString imagefiles, wxArrayString cachefiles ) |
| 145 { | 160 { |
| 146 m_imagefiles = imagefiles; | 161 m_imagefiles = imagefiles; |
| 147 m_cachefiles = cachefiles; | 162 m_cachefiles = cachefiles; |
| 148 m_thumbPanel->SetFiles( m_imagefiles, m_cachefiles ); | 163 m_thumbPanel->SetFiles( m_imagefiles, m_cachefiles ); |
| 164 | |
| 165 wxString title = wxT("プレビュー @ ") + m_imagefiles[0].BeforeLast( wxFILE_SEP_PATH ); | |
| 166 this->SetTitle( title ); | |
| 149 } | 167 } |
| 150 | 168 |
| 151 void PreviewDialog::OnPrint( wxCommandEvent& WXUNUSED(envet) ) | 169 void PreviewDialog::OnPrint( wxCommandEvent& WXUNUSED(event) ) |
| 152 { | 170 { |
| 153 wxString html; | 171 wxString html; |
| 154 html = html + wxT("<html><body>\n"); | 172 html = html + wxT("<html><body>\n"); |
| 155 | 173 |
| 156 wxString tmpjpg = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("preview.jpg"); | 174 wxString tmpjpg = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("preview.jpg"); |
