Mercurial > mercurial > hgweb_mover2.cgi
comparison src/myframe.cpp @ 21:c540dc3eabe5 v2.2dev
add listctrl-dir
| author | pyon@macmini |
|---|---|
| date | Wed, 26 Oct 2011 20:40:53 +0900 |
| parents | df439f9831d2 |
| children | a2dd16b70c08 |
comparison
equal
deleted
inserted
replaced
| 20:d10eafafe31f | 21:c540dc3eabe5 |
|---|---|
| 1 // Filename : myframe.cpp | 1 // Filename : myframe.cpp |
| 2 // Last Change: 23-Oct-2011. | 2 // Last Change: 26-Oct-2011. |
| 3 // | 3 // |
| 4 | 4 |
| 5 #include "main.h" | 5 #include "main.h" |
| 6 #include "myframe.h" | 6 #include "myframe.h" |
| 7 #include "param.h" | 7 #include "param.h" |
| 137 m_listCtrlView->AssignImageList( m_imageList, wxIMAGE_LIST_NORMAL ); | 137 m_listCtrlView->AssignImageList( m_imageList, wxIMAGE_LIST_NORMAL ); |
| 138 //m_listCtrlView->SetDropTarget( new DnDFile(m_dirPickerWork) ); | 138 //m_listCtrlView->SetDropTarget( new DnDFile(m_dirPickerWork) ); |
| 139 this->SetDropTarget( new DnDFile(m_dirPickerWork) ); | 139 this->SetDropTarget( new DnDFile(m_dirPickerWork) ); |
| 140 | 140 |
| 141 wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); | 141 wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); |
| 142 | 142 wxGridSizer* gSizer = new wxGridSizer( 2, 2, 0, 0 ); |
| 143 | |
| 144 m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 ); | |
| 145 gSizer->Add( m_buttonMove, 0, wxALL, 5 ); | |
| 146 m_buttonMove->Enable(false); | |
| 143 m_buttonDetect = new wxButton( this, ID_BUTTONDETECT, wxT("検知"), wxDefaultPosition, wxDefaultSize, 0 ); | 147 m_buttonDetect = new wxButton( this, ID_BUTTONDETECT, wxT("検知"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 144 bSizerButton->Add( m_buttonDetect, 0, wxALL, 5 ); | 148 gSizer->Add( m_buttonDetect, 0, wxALL, 5 ); |
| 145 m_buttonMove = new wxButton( this, ID_BUTTONMOVE, wxT("移動"), wxDefaultPosition, wxDefaultSize, 0 ); | |
| 146 bSizerButton->Add( m_buttonMove, 0, wxALL, 5 ); | |
| 147 m_buttonMove->Enable(false); | |
| 148 | 149 |
| 149 m_buttonDel = new wxButton( this, ID_BUTTONDEL, wxT("削除"), wxDefaultPosition, wxDefaultSize, 0 ); | 150 m_buttonDel = new wxButton( this, ID_BUTTONDEL, wxT("削除"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 150 bSizerButton->Add( m_buttonDel, 0, wxALL, 5 ); | 151 gSizer->Add( m_buttonDel, 0, wxALL, 5 ); |
| 151 m_buttonUndo = new wxButton( this, ID_BUTTONUNDO, wxT("戻す"), wxDefaultPosition, wxDefaultSize, 0 ); | 152 m_buttonUndo = new wxButton( this, ID_BUTTONUNDO, wxT("戻す"), wxDefaultPosition, wxDefaultSize, 0 ); |
| 152 bSizerButton->Add( m_buttonUndo, 0, wxALL, 5 ); | 153 gSizer->Add( m_buttonUndo, 0, wxALL, 5 ); |
| 153 m_buttonUndo->Enable(false); | 154 m_buttonUndo->Enable(false); |
| 154 | 155 |
| 155 bSizerManip->Add( bSizerButton, 0, wxALIGN_CENTER_VERTICAL, 5 ); | 156 bSizerButton->Add( gSizer, 0, wxALL, 5 ); |
| 157 | |
| 158 m_listCtrlDir = new wxListCtrl( this, ID_LISTCTRLDIR, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL ); | |
| 159 wxListItem itemCol; | |
| 160 itemCol.SetText( wxT("通番") ); | |
| 161 m_listCtrlDir->InsertColumn( 0, itemCol ); | |
| 162 m_listCtrlDir->SetColumnWidth( 0, 50 ); | |
| 163 itemCol.SetText( wxT("被保険者番号") ); | |
| 164 m_listCtrlDir->InsertColumn( 1, itemCol ); | |
| 165 m_listCtrlDir->SetColumnWidth( 1, 100 ); | |
| 166 itemCol.SetText( wxT("ファイル数") ); | |
| 167 m_listCtrlDir->InsertColumn( 2, itemCol ); | |
| 168 m_listCtrlDir->SetColumnWidth( 2, 60 ); | |
| 169 | |
| 170 bSizerButton->Add( m_listCtrlDir, 1, wxEXPAND|wxALL, 5 ); | |
| 171 | |
| 172 bSizerManip->Add( bSizerButton, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); | |
| 156 | 173 |
| 157 bSizerTop->Add( bSizerManip, 1, wxEXPAND, 5 ); | 174 bSizerTop->Add( bSizerManip, 1, wxEXPAND, 5 ); |
| 158 | 175 |
| 159 this->SetSizer( bSizerTop ); | 176 this->SetSizer( bSizerTop ); |
| 160 this->Layout(); | 177 this->Layout(); |
| 181 EVT_SIZE( MyFrame::OnWinSize ) | 198 EVT_SIZE( MyFrame::OnWinSize ) |
| 182 EVT_MOVE( MyFrame::OnWinMove ) | 199 EVT_MOVE( MyFrame::OnWinMove ) |
| 183 EVT_MENU( ID_MENUITEMPARAM, MyFrame::OnParam ) | 200 EVT_MENU( ID_MENUITEMPARAM, MyFrame::OnParam ) |
| 184 EVT_MENU( ID_MENUITEMAPPDIR, MyFrame::OnOpenAppDir ) | 201 EVT_MENU( ID_MENUITEMAPPDIR, MyFrame::OnOpenAppDir ) |
| 185 EVT_MENU( wxID_EXIT, MyFrame::OnQuit ) | 202 EVT_MENU( wxID_EXIT, MyFrame::OnQuit ) |
| 203 EVT_LIST_ITEM_SELECTED( ID_LISTCTRLVIEW, MyFrame::GetImageInfo ) | |
| 204 EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLVIEW, MyFrame::ViewLarge ) | |
| 186 EVT_BUTTON( ID_BUTTONNEXTTHU, MyFrame::OnNextThursday ) | 205 EVT_BUTTON( ID_BUTTONNEXTTHU, MyFrame::OnNextThursday ) |
| 187 EVT_BUTTON( ID_BUTTONMKDIR, MyFrame::OnMakeDir ) | 206 EVT_BUTTON( ID_BUTTONMKDIR, MyFrame::OnMakeDir ) |
| 188 EVT_BUTTON( ID_BUTTONDETECT, MyFrame::OnDetect ) | 207 EVT_BUTTON( ID_BUTTONDETECT, MyFrame::OnDetect ) |
| 189 EVT_BUTTON( ID_BUTTONMOVE, MyFrame::OnMove ) | 208 EVT_BUTTON( ID_BUTTONMOVE, MyFrame::OnMove ) |
| 190 EVT_BUTTON( ID_BUTTONDEL, MyFrame::OnDelete ) | 209 EVT_BUTTON( ID_BUTTONDEL, MyFrame::OnDelete ) |
| 191 EVT_BUTTON( ID_BUTTONUNDO, MyFrame::OnUndo ) | 210 EVT_BUTTON( ID_BUTTONUNDO, MyFrame::OnUndo ) |
| 192 EVT_LIST_ITEM_SELECTED( ID_LISTCTRLVIEW, MyFrame::GetImageInfo ) | 211 EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLDIR, MyFrame::OnOpenHhsDir ) |
| 193 EVT_LIST_ITEM_ACTIVATED( ID_LISTCTRLVIEW, MyFrame::ViewLarge ) | |
| 194 EVT_CLOSE( MyFrame::SaveConfig ) | 212 EVT_CLOSE( MyFrame::SaveConfig ) |
| 195 END_EVENT_TABLE() | 213 END_EVENT_TABLE() |
| 196 | 214 |
| 197 // Event Handlers | 215 // Event Handlers |
| 198 /* 次の木曜日 */ | 216 /* 次の木曜日 */ |
| 480 m_buttonDetect->Enable(true); | 498 m_buttonDetect->Enable(true); |
| 481 SetStatusText( wxEmptyString, 0 ); | 499 SetStatusText( wxEmptyString, 0 ); |
| 482 m_timer.Start( 20*1000, wxTIMER_ONE_SHOT ); // restart | 500 m_timer.Start( 20*1000, wxTIMER_ONE_SHOT ); // restart |
| 483 } | 501 } |
| 484 | 502 |
| 503 /* 被保険者を開く */ | |
| 504 void MyFrame::OnOpenHhsDir(wxListEvent& event) | |
| 505 { | |
| 506 wxString hhsdir = m_textCtrlDist->GetValue(); | |
| 507 hhsdir.Append( wxFILE_SEP_PATH ); | |
| 508 | |
| 509 wxListItem item = event.GetItem(); | |
| 510 item.SetColumn(1); | |
| 511 item.SetMask(wxLIST_MASK_TEXT); | |
| 512 m_listCtrlDir->GetItem( item ); | |
| 513 hhsdir.Append( item.GetText() ); | |
| 514 wxString execmd = wxT("explorer ") + hhsdir; | |
| 515 wxExecute( execmd ); | |
| 516 } | |
| 517 | |
| 485 // 以下,定型もの | 518 // 以下,定型もの |
| 486 void MyFrame::OnTimer(wxTimerEvent& event) | 519 void MyFrame::OnTimer(wxTimerEvent& event) |
| 487 { | 520 { |
| 488 UpdateCache(); | 521 UpdateCache(); |
| 489 } | 522 } |
