Mercurial > mercurial > hgweb_mover2.cgi
diff src/dirview.cpp @ 40:ce5b61376fd0 v2.7 tip
complete dirview.
author | pyon@macmini |
---|---|
date | Fri, 25 Nov 2011 22:08:47 +0900 |
parents | 044cc2f5af81 |
children |
line wrap: on
line diff
--- a/src/dirview.cpp Fri Nov 25 22:08:10 2011 +0900 +++ b/src/dirview.cpp Fri Nov 25 22:08:47 2011 +0900 @@ -1,20 +1,22 @@ // Filename : dirview.cpp -// Last Change: 24-Nov-2011. +// Last Change: 25-Nov-2011. // #include "dirview.h" -#define THUMB_W 160 -#define THUMB_H 226 +#define THUMB_W 240 +#define THUMB_H 340 // frame constructor DirViewFrame::DirViewFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) { + m_parent = parent; this->SetBackgroundColour( wxColour(wxT("WHEAT")) ); wxBoxSizer* bSizerTop = new wxBoxSizer( wxHORIZONTAL ); m_listCtrl = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); + m_listCtrl->SetBackgroundColour(wxT("LIGHT GREY")); bSizerTop->Add( m_listCtrl, 1, wxEXPAND|wxALL, 5 ); wxBoxSizer* bSizerButton = new wxBoxSizer( wxVERTICAL ); @@ -22,15 +24,14 @@ m_buttonExplorer = new wxButton( this, ID_BUTTONEXPLR, wxT("フォルダオープン"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerButton->Add( m_buttonExplorer, 1, wxALL, 5 ); m_buttonClose = new wxButton( this, ID_BUTTONCLOSE, wxT("閉じる"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerButton->Add( m_buttonClose, 1, wxALL, 5 ); + bSizerButton->Add( m_buttonClose, 1, wxALIGN_RIGHT|wxALL, 5 ); - bSizerTop->Add( bSizerButton, 0, wxALL, 5 ); + bSizerTop->Add( bSizerButton, 0, wxALIGN_BOTTOM|wxALL, 5 ); this->SetSizer( bSizerTop ); this->Layout(); this->Centre( wxBOTH ); - this->LoadListImage(); } // destructor @@ -48,8 +49,8 @@ void DirViewFrame::OnExplorer(wxCommandEvent& WXUNUSED(event)) { wxString execmd = wxT("explorer ") + m_dir; // hhsdir - //wxExecute( execmd ); - wxMessageBox( execmd ); + wxExecute( execmd ); + //wxMessageBox( execmd ); Close(true); } @@ -61,6 +62,11 @@ // Functions void DirViewFrame::LoadListImage() { + SetTitle( m_dir ); + wxRect rect( m_parent->GetScreenPosition(), wxSize(1800,420) ); + SetSize( rect ); + return; + wxImageList* imageList = new wxImageList( THUMB_W, THUMB_H ); m_listCtrl->AssignImageList( imageList, wxIMAGE_LIST_NORMAL ); @@ -71,8 +77,9 @@ wxImage thumbnail = image.Scale( THUMB_W, THUMB_H, wxIMAGE_QUALITY_HIGH ); wxBitmap bmp( thumbnail ); imageList->Add( bmp ); - m_listCtrl->InsertItem( i, filenames[i], i ); - m_listCtrl->SetItem( i, 0, filenames[i], i ); + wxFileName f( filenames[i] ); + m_listCtrl->InsertItem( i, f.GetFullName(), i ); + m_listCtrl->SetItem( i, 0, f.GetFullName(), i ); } }