Mercurial > mercurial > hgweb_mover2.cgi
view src/testframe.cpp @ 16:e60175dc675e v2.1
Added tag 13, v2.1 for changeset df439f9831d2
author | pyon@macmini |
---|---|
date | Sun, 23 Oct 2011 21:33:02 +0900 |
parents | 7bf900d47e9e |
children |
line wrap: on
line source
// Filename : testframe.cpp // Last Change: 08-Oct-2011. // #include "common.h" class TestFrame : public wxFrame { DECLARE_EVENT_TABLE() private: wxListCtrl* m_listCtrl; public: TestFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLOSE_BOX ); ~TestFrame(); void OnMessage(wxListEvent&); }; // constructor TestFrame::TestFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) { this->SetSize( 400, 600 ); this->SetBackgroundColour( wxColour(wxT("WHEAT")) ); wxBoxSizer* bSizer; bSizer = new wxBoxSizer( wxVERTICAL ); m_listCtrl = new wxListCtrl( this, ID_LSWHITE, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); wxListItem itemCol; itemCol.SetText( wxT("通番") ); m_listCtrl->InsertColumn( 0, itemCol ); m_listCtrl->SetColumnWidth( 0, 100 ); itemCol.SetText( wxT("被保険者番号") ); m_listCtrl->InsertColumn( 1, itemCol ); m_listCtrl->SetColumnWidth( 1, 180 ); itemCol.SetText( wxT("ファイル数") ); m_listCtrl->InsertColumn( 2, itemCol ); m_listCtrl->SetColumnWidth( 1, 100 ); bSizer->Add( m_listCtrl, 1, wxALL|wxEXPAND, 5 ); this->SetSizer( bSizer ); this->Layout(); this->Centre( wxBOTH ); m_listCtrl->InsertItem( 1, wxT("aaa") ); m_listCtrl->SetItem( 0, 1, wxT("bbb"), -1 ); m_listCtrl->InsertItem( 1, wxT("aa2") ); m_listCtrl->SetItem( 1, 1, wxT("bb2"), -1 ); } // destructor TestFrame::~TestFrame() { } // Event Table BEGIN_EVENT_TABLE( TestFrame, wxFrame ) EVT_LIST_ITEM_ACTIVATED( ID_LSWHITE, TestFrame::OnMessage ) END_EVENT_TABLE() // Event Handlers void TestFrame::OnMessage(wxListEvent& event) { wxListItem item = event.GetItem(); item.SetColumn(1); item.SetMask(wxLIST_MASK_TEXT); //int n = item.GetColumn(); //wxString msg_n = wxString::Format(wxT("%d"),n); //wxMessageBox( msg_n ); m_listCtrl->GetItem( item ); wxString msg = item.GetText(); wxMessageBox( msg ); }