comparison src/hist.cpp @ 1:7b6dab24f4b8

Gui parts complete.
author pyon@macmini
date Sun, 04 Aug 2013 21:42:49 +0900
parents 0c0701a935f8
children c066fde99517
comparison
equal deleted inserted replaced
0:0c0701a935f8 1:7b6dab24f4b8
1 // Filename : hist.cpp 1 // Filename : hist.cpp
2 // Last Change: 21-Jul-2013. 2 // Last Change: 02-Aug-2013.
3 // 3 //
4 #include "hist.h" 4 #include "hist.h"
5 5
6 HistDialog::HistDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) 6 HistDialog::HistDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
7 : wxDialog( parent, id, title, pos, size, style ) 7 : wxDialog( parent, id, title, pos, size, style )
13 m_listCtrl = new wxListCtrl( this, ID_LISTHIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL ); 13 m_listCtrl = new wxListCtrl( this, ID_LISTHIST, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );
14 14
15 wxListItem itemCol; 15 wxListItem itemCol;
16 itemCol.SetText( wxT("歴番") ); 16 itemCol.SetText( wxT("歴番") );
17 m_listCtrl->InsertColumn( 0, itemCol ); 17 m_listCtrl->InsertColumn( 0, itemCol );
18 m_listCtrl->SetColumnWidth( 0, 50 ); 18 m_listCtrl->SetColumnWidth( 0, 40 );
19 itemCol.SetText( wxT("被保険者番号") ); 19 itemCol.SetText( wxT("被保険者番号") );
20 m_listCtrl->InsertColumn( 1, itemCol ); 20 m_listCtrl->InsertColumn( 1, itemCol );
21 m_listCtrl->SetColumnWidth( 1, 80 ); 21 m_listCtrl->SetColumnWidth( 1, 90 );
22 itemCol.SetText( wxT("氏名") ); 22 itemCol.SetText( wxT("氏名") );
23 m_listCtrl->InsertColumn( 2, itemCol ); 23 m_listCtrl->InsertColumn( 2, itemCol );
24 m_listCtrl->SetColumnWidth( 2, 80 ); 24 m_listCtrl->SetColumnWidth( 2, 80 );
25 itemCol.SetText( wxT("住所") ); 25 itemCol.SetText( wxT("住所") );
26 m_listCtrl->InsertColumn( 3, itemCol ); 26 m_listCtrl->InsertColumn( 3, itemCol );
27 m_listCtrl->SetColumnWidth( 3, 300 ); 27 m_listCtrl->SetColumnWidth( 3, 240 );
28 itemCol.SetText( wxT("検索時刻") ); 28 itemCol.SetText( wxT("検索日時") );
29 m_listCtrl->InsertColumn( 4, itemCol ); 29 m_listCtrl->InsertColumn( 4, itemCol );
30 m_listCtrl->SetColumnWidth( 4, 100 ); 30 m_listCtrl->SetColumnWidth( 4, 80 );
31 31
32 bSizerTop->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 ); 32 bSizerTop->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 );
33 33
34 wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL ); 34 wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL );
35 35
36 m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("キャンセル"), wxDefaultPosition, wxDefaultSize, 0 ); 36 m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("キャンセル"), wxDefaultPosition, wxDefaultSize, 0 );
37 bSizerBtn->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); 37 bSizerBtn->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
38 38
39 m_buttonSet = new wxButton( this, wxID_OK, wxT("セット"), wxDefaultPosition, wxDefaultSize, 0 ); 39 m_buttonSet = new wxButton( this, ID_SETHIST, wxT("セット"), wxDefaultPosition, wxDefaultSize, 0 );
40 bSizerBtn->Add( m_buttonSet, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); 40 bSizerBtn->Add( m_buttonSet, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
41 41
42 bSizerTop->Add( bSizerBtn, 0, wxALIGN_RIGHT|wxALL, 5 ); 42 bSizerTop->Add( bSizerBtn, 0, wxALIGN_RIGHT|wxALL, 5 );
43 43
44 this->SetSizer( bSizerTop ); 44 this->SetSizer( bSizerTop );
45 this->Layout(); 45 this->Layout();
46 46
47 this->Centre( wxBOTH ); 47 this->Centre( wxBOTH );
48 48
49 SetupHistoryList(); 49 ReadHistoryList();
50 } 50 }
51 51
52 HistDialog::~HistDialog() 52 HistDialog::~HistDialog()
53 { 53 {
54 } 54 }
55 55
56 // Event Table 56 // Event Table
57 BEGIN_EVENT_TABLE( HistDialog, wxDialog ) 57 BEGIN_EVENT_TABLE( HistDialog, wxDialog )
58 //EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir ) 58 EVT_LIST_ITEM_ACTIVATED( ID_LISTHIST, HistDialog::OnSelectItem )
59 //EVT_BUTTON( ID_HIST, MyFrame::OnHistory ) 59 EVT_BUTTON( ID_SETHIST, HistDialog::OnSet )
60 END_EVENT_TABLE() 60 END_EVENT_TABLE()
61 61
62 62
63 void HistDialog::SetupHistoryList( void ) { 63 void HistDialog::OnSelectItem( wxListEvent& WXUNUSED(event) )
64 {
65 }
64 66
67 void HistDialog::OnSet( wxCommandEvent& WXUNUSED(event) )
68 {
69
70 }
71
72 void HistDialog::ReadHistoryList( void )
73 {
65 wxTextFile file; 74 wxTextFile file;
66 wxString filename = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("history"); 75 wxString filename = wxGetCwd() + wxFILE_SEP_PATH + wxT("tmp") + wxFILE_SEP_PATH + wxT("history");
67 wxString buf; 76 wxString buf;
68 77
69 if ( file.Open( filename ) ) { 78 if ( file.Open( filename ) ) {