changeset 21:c540dc3eabe5 v2.2dev

add listctrl-dir
author pyon@macmini
date Wed, 26 Oct 2011 20:40:53 +0900
parents d10eafafe31f
children 4432aba77d6b
files include/common.h include/myframe.h src/main.cpp src/myframe.cpp
diffstat 4 files changed, 50 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/include/common.h	Tue Oct 25 20:02:55 2011 +0900
+++ b/include/common.h	Wed Oct 26 20:40:53 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : common.h
-// Last Change: 24-Oct-2011.
+// Last Change: 26-Oct-2011.
 //
 #ifndef __COMMON__
 #define __COMMON__
@@ -55,15 +55,13 @@
     ID_BUTTONMOVE,
     ID_BUTTONDEL,
     ID_BUTTONUNDO,
+    ID_LISTCTRLDIR,
 
     ID_TIMER,
 
     // param
 
     // dirview
-    ID_LISTCTRLALL,
-    ID_LISTCTRLTHUMB,
-    ID_BITMAPPREVIEW,
 };
 
 #if defined(__WXMSW__)
--- a/include/myframe.h	Tue Oct 25 20:02:55 2011 +0900
+++ b/include/myframe.h	Wed Oct 26 20:40:53 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : myframe.h
-// Last Change: 23-Oct-2011.
+// Last Change: 26-Oct-2011.
 //
 
 #ifndef __myframe__
@@ -45,6 +45,7 @@
 
         wxListCtrl*       m_listCtrlView;
 
+        wxListCtrl*       m_listCtrlDir;
         wxButton*         m_buttonDetect;
         wxButton*         m_buttonMove;
         wxButton*         m_buttonDel;
@@ -66,6 +67,7 @@
         void OnUndo(wxCommandEvent& event);
         void UpdateListImage(void);
         void UpdateCache(void);
+        void OnOpenHhsDir(wxListEvent& event);
         // $B0J2<!$Dj7?$b$N(B
         void OnTimer(wxTimerEvent& event);
         void OnIdle(wxIdleEvent& event);
--- a/src/main.cpp	Tue Oct 25 20:02:55 2011 +0900
+++ b/src/main.cpp	Wed Oct 26 20:40:53 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : main.cpp
-// Last Change: 25-Oct-2011.
+// Last Change: 26-Oct-2011.
 //
 
 #include "common.h"
@@ -93,7 +93,7 @@
     wxTextFile logfile;
     logfile.Open(wxT("log"));
     logfile.Clear();
-    logfile.AddLine( now.Format(wxT("%F %T ")) + wxT("[Application start...]") );
+    logfile.AddLine( now.Format(wxT("%Y-%m-%d %H:%M:%S ")) + wxT("[Application start...]") );
     logfile.Write();
     logfile.Close();
 }
--- a/src/myframe.cpp	Tue Oct 25 20:02:55 2011 +0900
+++ b/src/myframe.cpp	Wed Oct 26 20:40:53 2011 +0900
@@ -1,5 +1,5 @@
 // Filename   : myframe.cpp
-// Last Change: 23-Oct-2011.
+// Last Change: 26-Oct-2011.
 //
 
 #include "main.h"
@@ -139,20 +139,37 @@
     this->SetDropTarget( new DnDFile(m_dirPickerWork) );
 	
 	wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL );
+	wxGridSizer* gSizer = new wxGridSizer( 2, 2, 0, 0 );
 	
+	m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 );
+	gSizer->Add( m_buttonMove, 0, wxALL, 5 );
+    m_buttonMove->Enable(false);
 	m_buttonDetect = new wxButton( this, ID_BUTTONDETECT, wxT("検知"), wxDefaultPosition, wxDefaultSize, 0 );
-	bSizerButton->Add( m_buttonDetect, 0, wxALL, 5 );
-	m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 );
-	bSizerButton->Add( m_buttonMove, 0, wxALL, 5 );
-    m_buttonMove->Enable(false);
+	gSizer->Add( m_buttonDetect, 0, wxALL, 5 );
 
 	m_buttonDel = new wxButton( this, ID_BUTTONDEL, wxT("削除"), wxDefaultPosition, wxDefaultSize, 0 );
-	bSizerButton->Add( m_buttonDel, 0, wxALL, 5 );
+	gSizer->Add( m_buttonDel, 0, wxALL, 5 );
 	m_buttonUndo = new wxButton( this, ID_BUTTONUNDO, wxT("戻す"), wxDefaultPosition, wxDefaultSize, 0 );
-	bSizerButton->Add( m_buttonUndo, 0, wxALL, 5 );
+	gSizer->Add( m_buttonUndo, 0, wxALL, 5 );
     m_buttonUndo->Enable(false);
+
+	bSizerButton->Add( gSizer, 0, wxALL, 5 );
+
+	m_listCtrlDir = new wxListCtrl( this, ID_LISTCTRLDIR, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
+    wxListItem itemCol;
+    itemCol.SetText( wxT("通番") );
+    m_listCtrlDir->InsertColumn( 0, itemCol );
+    m_listCtrlDir->SetColumnWidth( 0, 50 );
+    itemCol.SetText( wxT("被保険者番号") );
+    m_listCtrlDir->InsertColumn( 1, itemCol );
+    m_listCtrlDir->SetColumnWidth( 1, 100 );
+    itemCol.SetText( wxT("ファイル数") );
+    m_listCtrlDir->InsertColumn( 2, itemCol );
+    m_listCtrlDir->SetColumnWidth( 2, 60 );
+
+	bSizerButton->Add( m_listCtrlDir, 1, wxEXPAND|wxALL, 5 );
 	
-	bSizerManip->Add( bSizerButton, 0, wxALIGN_CENTER_VERTICAL, 5 );
+	bSizerManip->Add( bSizerButton, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
 	
 	bSizerTop->Add( bSizerManip, 1, wxEXPAND, 5 );
 	
@@ -183,14 +200,15 @@
     EVT_MENU( ID_MENUITEMPARAM,   MyFrame::OnParam )
     EVT_MENU( ID_MENUITEMAPPDIR,  MyFrame::OnOpenAppDir )
     EVT_MENU( wxID_EXIT,          MyFrame::OnQuit )
+    EVT_LIST_ITEM_SELECTED(  ID_LISTCTRLVIEW, MyFrame::GetImageInfo )
+    EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLVIEW, MyFrame::ViewLarge )
     EVT_BUTTON( ID_BUTTONNEXTTHU, MyFrame::OnNextThursday )
     EVT_BUTTON( ID_BUTTONMKDIR,   MyFrame::OnMakeDir )
     EVT_BUTTON( ID_BUTTONDETECT,  MyFrame::OnDetect )
     EVT_BUTTON( ID_BUTTONMOVE,    MyFrame::OnMove )
     EVT_BUTTON( ID_BUTTONDEL,     MyFrame::OnDelete )
     EVT_BUTTON( ID_BUTTONUNDO,    MyFrame::OnUndo )
-    EVT_LIST_ITEM_SELECTED(  ID_LISTCTRLVIEW, MyFrame::GetImageInfo )
-    EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLVIEW, MyFrame::ViewLarge )
+    EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLDIR, MyFrame::OnOpenHhsDir )
     EVT_CLOSE( MyFrame::SaveConfig )
 END_EVENT_TABLE()
 
@@ -482,6 +500,21 @@
     m_timer.Start( 20*1000, wxTIMER_ONE_SHOT ); // restart
 }
 
+/* 被保険者を開く */
+void MyFrame::OnOpenHhsDir(wxListEvent& event)
+{
+    wxString hhsdir = m_textCtrlDist->GetValue();
+    hhsdir.Append( wxFILE_SEP_PATH );
+
+    wxListItem item = event.GetItem();
+    item.SetColumn(1);
+    item.SetMask(wxLIST_MASK_TEXT);
+    m_listCtrlDir->GetItem( item );
+    hhsdir.Append( item.GetText() );
+    wxString execmd = wxT("explorer ") + hhsdir;
+    wxExecute( execmd );
+}
+
 // 以下,定型もの
 void MyFrame::OnTimer(wxTimerEvent& event)
 {