changeset 2:e4ba3cc9b4b1

large view ok.
author pyon@macmini
date Sat, 15 Oct 2011 22:03:00 +0900
parents b47bd4618c16
children 870860d435a1
files include/common.h include/myframe.h src/myframe.cpp
diffstat 3 files changed, 45 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/include/common.h	Sat Oct 15 20:07:12 2011 +0900
+++ b/include/common.h	Sat Oct 15 22:03:00 2011 +0900
@@ -7,8 +7,9 @@
 #include "wx/wxprec.h"
  
 #ifndef WX_PRECOMP
-    #include "wx/wx.h"
+    #include <wx/wx.h>
     #include <wx/icon.h>
+    #include <wx/splash.h>
     #include <wx/imaglist.h>
     #include <wx/dir.h>
     #include <wx/menu.h>
--- a/include/myframe.h	Sat Oct 15 20:07:12 2011 +0900
+++ b/include/myframe.h	Sat Oct 15 22:03:00 2011 +0900
@@ -52,6 +52,7 @@
         void OnParam(wxCommandEvent& event);
         void MakeDir(wxCommandEvent& event);
         void ToggleSelect(wxListEvent& event);
+        void ViewLarge(wxListEvent& event);
         void OnDetect(wxCommandEvent& event);
         void OnMove(wxCommandEvent& event);
         void OnMoveAndDetect(wxCommandEvent& event);
--- a/src/myframe.cpp	Sat Oct 15 20:07:12 2011 +0900
+++ b/src/myframe.cpp	Sat Oct 15 22:03:00 2011 +0900
@@ -169,7 +169,7 @@
     //EVT_BUTTON( ID_BUTTONUNDO, MyFrame::Undo )
     //EVT_LIST_ITEM_MIDDLE_CLICK( ID_LISTCTRLVIEW, MyFrame::ToggleSelect )
     EVT_LIST_ITEM_RIGHT_CLICK( ID_LISTCTRLVIEW, MyFrame::ToggleSelect )
-    //EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir )
+    EVT_LIST_ITEM_ACTIVATED(   ID_LISTCTRLVIEW, MyFrame::ViewLarge )
     EVT_CLOSE( MyFrame::SaveConfig )
 END_EVENT_TABLE()
 
@@ -306,6 +306,47 @@
 /* 画像を選択 */
 void MyFrame::ToggleSelect(wxListEvent& event)
 {
+    SetStatusText( wxEmptyString, 1 );
+    int i = event.GetIndex();
+    wxListItem item;
+    item.SetId(i);
+
+    //item.SetMask(wxLIST_MASK_STATE);
+    if ( item.GetState() & wxLIST_STATE_SELECTED ) {
+        wxMessageBox(wxT("a"));
+        item.SetState(~wxLIST_STATE_SELECTED);
+    }
+    else {
+        item.SetStateMask(wxLIST_STATE_SELECTED);
+        wxString filename = event.GetText();
+        wxString workdir = m_dirPickerWork->GetPath();
+        wxString imagefile = workdir + wxFILE_SEP_PATH + filename;
+        float b; long l;
+        if ( IsMarksheet( imagefile, &b, &l ) ) {
+            SetStatusText( wxString::Format(wxT("z = %f, l = %d"),b,l), 1 );
+        }
+    }
+    m_listCtrlView->SetItem( item );
+}
+
+/* 画像のスクリーン表示*/
+void MyFrame::ViewLarge(wxListEvent& event)
+{
+    int i = event.GetIndex();
+    wxListItem item;
+    item.SetId(i);
+
+    wxString filename = event.GetText();
+    wxString workdir = m_dirPickerWork->GetPath();
+    wxString imagefile = workdir + wxFILE_SEP_PATH + filename;
+
+    wxImage image( imagefile, wxBITMAP_TYPE_JPEG );
+    wxBitmap bmp( image.Scale( 707, 1000, wxIMAGE_QUALITY_HIGH ) );
+    wxSplashScreen* splash = new wxSplashScreen( bmp,
+            wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
+            3000, NULL, -1, wxDefaultPosition, wxDefaultSize,
+            wxSIMPLE_BORDER|wxSTAY_ON_TOP );
+    wxYield();
 }
 
 /* パラメータダイアログ */