Mercurial > mercurial > hgweb_searcher03.cgi
comparison src/kana.cpp @ 0:0c0701a935f8
Start Development.
| author | pyon@macmini |
|---|---|
| date | Sun, 21 Jul 2013 16:07:19 +0900 |
| parents | |
| children | 7b6dab24f4b8 |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:0c0701a935f8 |
|---|---|
| 1 // Filename : kana.cpp | |
| 2 // Last Change: 21-Jul-2013. | |
| 3 // | |
| 4 | |
| 5 #include "kana.h" | |
| 6 #include "db.h" | |
| 7 | |
| 8 KanaDialog::KanaDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) | |
| 9 : wxDialog( parent, id, title, pos, size, style ) | |
| 10 { | |
| 11 this->SetSizeHints( wxDefaultSize, wxDefaultSize ); | |
| 12 | |
| 13 wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL ); | |
| 14 | |
| 15 // | |
| 16 wxBoxSizer* bSizerSearch = new wxBoxSizer( wxHORIZONTAL ); | |
| 17 | |
| 18 m_searchCtrl = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); | |
| 19 #ifndef __WXMAC__ | |
| 20 m_searchCtrl->ShowSearchButton( true ); | |
| 21 #endif | |
| 22 m_searchCtrl->ShowCancelButton( false ); | |
| 23 bSizerSearch->Add( m_searchCtrl, 1, wxALL|wxEXPAND, 5 ); | |
| 24 | |
| 25 m_checkBox = new wxCheckBox( this, wxID_ANY, wxT("部分一致"), wxDefaultPosition, wxDefaultSize, 0 ); | |
| 26 bSizerSearch->Add( m_checkBox, 0, wxALL|wxEXPAND, 5 ); | |
| 27 | |
| 28 bSizerTop->Add( bSizerSearch, 0, wxALL|wxEXPAND, 5 ); | |
| 29 | |
| 30 // | |
| 31 m_listCtrl = new wxListCtrl( this, ID_LISTKANA, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL ); | |
| 32 | |
| 33 wxListItem itemCol; | |
| 34 itemCol.SetText( wxT("被保険者番号") ); | |
| 35 m_listCtrl->InsertColumn( 0, itemCol ); | |
| 36 m_listCtrl->SetColumnWidth( 0, 80 ); | |
| 37 itemCol.SetText( wxT("カナ") ); | |
| 38 m_listCtrl->InsertColumn( 1, itemCol ); | |
| 39 m_listCtrl->SetColumnWidth( 1, 100 ); | |
| 40 itemCol.SetText( wxT("氏名") ); | |
| 41 m_listCtrl->InsertColumn( 2, itemCol ); | |
| 42 m_listCtrl->SetColumnWidth( 2, 100 ); | |
| 43 itemCol.SetText( wxT("生年月日") ); | |
| 44 m_listCtrl->InsertColumn( 3, itemCol ); | |
| 45 m_listCtrl->SetColumnWidth( 3, 60 ); | |
| 46 itemCol.SetText( wxT("住所") ); | |
| 47 m_listCtrl->InsertColumn( 4, itemCol ); | |
| 48 m_listCtrl->SetColumnWidth( 4, 180 ); | |
| 49 | |
| 50 bSizerTop->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 ); | |
| 51 | |
| 52 // | |
| 53 wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL ); | |
| 54 | |
| 55 m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("キャンセル"), wxDefaultPosition, wxDefaultSize, 0 ); | |
| 56 bSizerBtn->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
| 57 | |
| 58 m_buttonSet = new wxButton( this, wxID_OK, wxT("セット"), wxDefaultPosition, wxDefaultSize, 0 ); | |
| 59 bSizerBtn->Add( m_buttonSet, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); | |
| 60 | |
| 61 bSizerTop->Add( bSizerBtn, 0, wxALIGN_RIGHT|wxALL, 5 ); | |
| 62 | |
| 63 this->SetSizer( bSizerTop ); | |
| 64 this->Layout(); | |
| 65 | |
| 66 this->Centre( wxBOTH ); | |
| 67 } | |
| 68 | |
| 69 KanaDialog::~KanaDialog() | |
| 70 { | |
| 71 } | |
| 72 | |
| 73 // Event Table | |
| 74 BEGIN_EVENT_TABLE( KanaDialog, wxDialog ) | |
| 75 //EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir ) | |
| 76 //EVT_BUTTON( ID_HIST, MyFrame::OnHistory ) | |
| 77 END_EVENT_TABLE() | |
| 78 | |
| 79 // Event Handlers & Functions | |
| 80 /* | |
| 81 void KanaDialog::Search( void ) { | |
| 82 | |
| 83 wxTextFile file; | |
| 84 wxString filename = wxGetCwd() + wxFILE_SEP_PATH + wxT(".history"); | |
| 85 wxString buf; | |
| 86 | |
| 87 if ( file.Open( filename ) ) { | |
| 88 | |
| 89 for ( size_t i = 0; i<file.GetLineCount(); i++ ) { | |
| 90 | |
| 91 int col = 0; | |
| 92 m_listCtrl->InsertItem( i, -1 ); | |
| 93 buf.Printf( wxT("%02d"), i + 1 ); | |
| 94 m_listCtrl->SetItem( i, col, buf, -1 ); // No | |
| 95 | |
| 96 wxStringTokenizer tkz( file[i], wxT(":") ); | |
| 97 while ( tkz.HasMoreTokens() ) { | |
| 98 col++; | |
| 99 wxString token = tkz.GetNextToken(); | |
| 100 m_listCtrl->SetItem( i, col, token, -1 ); | |
| 101 } | |
| 102 if ( i % 2 ) m_listCtrl->SetItemBackgroundColour( i, wxColour(wxT("WHEAT")) ); | |
| 103 } | |
| 104 } | |
| 105 file.Close(); | |
| 106 } | |
| 107 */ | |
| 108 |
