Mercurial > mercurial > hgweb_mover.cgi
changeset 6:99d612849255
v0.3
author | pyon@macmini |
---|---|
date | Sat, 08 Oct 2011 17:00:33 +0900 |
parents | 3b734fd6ee2b |
children | bfa0800f1176 |
files | TODO include/common.h include/delwhite.h include/symbol.h makefile src/main.cpp src/myframe.cpp src/testframe.cpp |
diffstat | 8 files changed, 98 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/TODO Thu Oct 06 20:27:54 2011 +0900 +++ b/TODO Sat Oct 08 17:00:33 2011 +0900 @@ -3,17 +3,9 @@ =========================================================================== * Log : moved time, files, distination * Undo -* Open Explorer +* colored row --------------------------------------------------------------------------- Memo --------------------------------------------------------------------------- - file z size -img081.jpg 0.099714 2201365 -img086.jpg 0.102857 2183211 -img191.jpg 0.106571 2146197 -img361.jpg 0.104571 2195097 -ave. 0.103428 2181468 -5%up 0.108600 2290541 -5%down 0.098257 2072394
--- a/include/common.h Thu Oct 06 20:27:54 2011 +0900 +++ b/include/common.h Sat Oct 08 17:00:33 2011 +0900 @@ -1,5 +1,5 @@ // Filename : common.h -// Last Change: 05-Oct-2011. +// Last Change: 08-Oct-2011. // #ifndef __COMMON__ #define __COMMON__ @@ -13,6 +13,7 @@ enum { // mainframe ID_MAIN = wxID_HIGHEST + 1, + ID_TEST, ID_OPWORK, ID_WORKDIR,
--- a/include/delwhite.h Thu Oct 06 20:27:54 2011 +0900 +++ b/include/delwhite.h Sat Oct 08 17:00:33 2011 +0900 @@ -1,5 +1,5 @@ // Filename : delwhite.h -// Last Change: 04-Oct-2011. +// Last Change: 08-Oct-2011. // #ifndef __DELWHITE__ #define __DEWHITEL__ @@ -31,7 +31,6 @@ DECLARE_EVENT_TABLE() private: wxImageList* m_imageList; - wxListItem* m_listItem; protected: wxListCtrl* m_listCtrl;
--- a/include/symbol.h Thu Oct 06 20:27:54 2011 +0900 +++ b/include/symbol.h Sat Oct 08 17:00:33 2011 +0900 @@ -1,10 +1,10 @@ // Filename : symbol.h -// Last Change: 06-Oct-2011. +// Last Change: 08-Oct-2011. // #define MYAPPNAME wxT("AMover") #define VER 0 -#define REV 02 +#define REV 3 #define BLD 20111011
--- a/makefile Thu Oct 06 20:27:54 2011 +0900 +++ b/makefile Sat Oct 08 17:00:33 2011 +0900 @@ -1,6 +1,6 @@ # # Makefile for wxWidgets Application -# Last Change: 06-Oct-2011. +# Last Change: 08-Oct-2011. # by Takayuki Mutoh # @@ -98,7 +98,7 @@ endif -$(OBJDIR)/main.o: main.cpp main.h myframe.h common.h +$(OBJDIR)/main.o: main.cpp main.h myframe.h common.h testframe.cpp -mkdir -p $(OBJDIR) $(CXX) -c $< -o $@ $(CPPFLAGS)
--- a/src/main.cpp Thu Oct 06 20:27:54 2011 +0900 +++ b/src/main.cpp Sat Oct 08 17:00:33 2011 +0900 @@ -1,10 +1,11 @@ // Filename : main.cpp -// Last Change: 02-Oct-2011. +// Last Change: 08-Oct-2011. // #include "common.h" #include "main.h" #include "myframe.h" +#include "testframe.cpp" IMPLEMENT_APP(MyApp) @@ -25,10 +26,15 @@ ConfInit(); + /* MyFrame *mainframe = new MyFrame( NULL, ID_MAIN, wxT("A Mover") ); mainframe->SetSize( rect ); mainframe->SetMinSize( wxSize( 580, 680 ) ); mainframe->Show(true); + */ + TestFrame *tf = new TestFrame( NULL, ID_TEST, wxT("A Test") ); + tf->Show(true); + return true; }
--- a/src/myframe.cpp Thu Oct 06 20:27:54 2011 +0900 +++ b/src/myframe.cpp Sat Oct 08 17:00:33 2011 +0900 @@ -1,5 +1,5 @@ // Filename : mainframe.cpp -// Last Change: 06-Oct-2011. +// Last Change: 08-Oct-2011. // #include "symbol.h" #include "common.h" @@ -320,14 +320,15 @@ } /* 被保険者のフォルダを開く */ -void MyFrame::OnOpenHhsDir(wxListEvent& WXUNUSED(event)) +void MyFrame::OnOpenHhsDir(wxListEvent& event) { wxString hhsdir = m_textCtrlMoveDir->GetValue(); hhsdir.Append( wxFILE_SEP_PATH ); - long n = m_listCtrl->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED ); - wxListItem item; - item.SetId(n); - m_listCtrl->GetColumn( 1, item ); + + wxListItem item = event.GetItem(); + item.SetColumn(1); + item.SetMask(wxLIST_MASK_TEXT); + m_listCtrl->GetItem( item ); hhsdir.Append( item.GetText() ); wxMessageBox(hhsdir); //wxString execmd = wxT("explorer ") + hhsdir;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/testframe.cpp Sat Oct 08 17:00:33 2011 +0900 @@ -0,0 +1,76 @@ +// 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 ); +} +