view src/kana.cpp @ 0:0c0701a935f8

Start Development.
author pyon@macmini
date Sun, 21 Jul 2013 16:07:19 +0900
parents
children 7b6dab24f4b8
line wrap: on
line source

// Filename   : kana.cpp
// Last Change: 21-Jul-2013.
//

#include "kana.h"
#include "db.h"

KanaDialog::KanaDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) 
    : wxDialog( parent, id, title, pos, size, style )
{
	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
	
	wxBoxSizer* bSizerTop = new wxBoxSizer( wxVERTICAL );
	
    //
	wxBoxSizer* bSizerSearch = new wxBoxSizer( wxHORIZONTAL );

	m_searchCtrl = new wxSearchCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
	#ifndef __WXMAC__
	m_searchCtrl->ShowSearchButton( true );
	#endif
	m_searchCtrl->ShowCancelButton( false );
	bSizerSearch->Add( m_searchCtrl, 1, wxALL|wxEXPAND, 5 );

    m_checkBox = new wxCheckBox( this, wxID_ANY, wxT("部分一致"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizerSearch->Add( m_checkBox, 0, wxALL|wxEXPAND, 5 );

	bSizerTop->Add( bSizerSearch, 0, wxALL|wxEXPAND, 5 );
	
    //
	m_listCtrl = new wxListCtrl( this, ID_LISTKANA, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL );

    wxListItem itemCol;
    itemCol.SetText( wxT("被保険者番号") );
    m_listCtrl->InsertColumn( 0, itemCol );
    m_listCtrl->SetColumnWidth( 0, 80 );
    itemCol.SetText( wxT("カナ") );
    m_listCtrl->InsertColumn( 1, itemCol );
    m_listCtrl->SetColumnWidth( 1, 100 );
    itemCol.SetText( wxT("氏名") );
    m_listCtrl->InsertColumn( 2, itemCol );
    m_listCtrl->SetColumnWidth( 2, 100 );
    itemCol.SetText( wxT("生年月日") );
    m_listCtrl->InsertColumn( 3, itemCol );
    m_listCtrl->SetColumnWidth( 3, 60 );
    itemCol.SetText( wxT("住所") );
    m_listCtrl->InsertColumn( 4, itemCol );
    m_listCtrl->SetColumnWidth( 4, 180 );

	bSizerTop->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 );
	
    //
	wxBoxSizer* bSizerBtn = new wxBoxSizer( wxHORIZONTAL );
	
	m_buttonCancel = new wxButton( this, wxID_CANCEL, wxT("キャンセル"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizerBtn->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	m_buttonSet = new wxButton( this, wxID_OK, wxT("セット"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizerBtn->Add( m_buttonSet, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
	
	bSizerTop->Add( bSizerBtn, 0, wxALIGN_RIGHT|wxALL, 5 );
	
	this->SetSizer( bSizerTop );
	this->Layout();
	
	this->Centre( wxBOTH );
}

KanaDialog::~KanaDialog()
{
}

// Event Table
BEGIN_EVENT_TABLE( KanaDialog, wxDialog )
    //EVT_LIST_ITEM_ACTIVATED( ID_LIST, MyFrame::OnOpenHhsDir )
    //EVT_BUTTON( ID_HIST, MyFrame::OnHistory )
END_EVENT_TABLE()

// Event Handlers & Functions
/*
void KanaDialog::Search( void ) {

    wxTextFile file;
    wxString filename = wxGetCwd() + wxFILE_SEP_PATH + wxT(".history");
    wxString buf;

    if ( file.Open( filename ) ) {

        for ( size_t i = 0; i<file.GetLineCount(); i++ ) {

            int col = 0;
            m_listCtrl->InsertItem( i, -1 );
            buf.Printf( wxT("%02d"), i + 1 );
            m_listCtrl->SetItem( i, col, buf, -1 ); // No

            wxStringTokenizer tkz( file[i], wxT(":") );
            while ( tkz.HasMoreTokens() ) {
                col++;
                wxString token = tkz.GetNextToken();
                m_listCtrl->SetItem( i, col, token, -1 );
            }
            if ( i % 2 ) m_listCtrl->SetItemBackgroundColour( i, wxColour(wxT("WHEAT")) );
        }
    }
    file.Close();
}
*/