Mercurial > mercurial > hgweb_mover2.cgi
view src/dirview.cpp @ 25:b3b3b8e97b54 v2.2dev
Added tag v2.2 for changeset 5c99c6fa50df
author | pyon@macmini |
---|---|
date | Thu, 03 Nov 2011 15:47:25 +0900 |
parents | 868ccd73e238 |
children | 044cc2f5af81 |
line wrap: on
line source
// Filename : dirview.cpp // Last Change: 24-Oct-2011. // #include "dirview.h" // 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 ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetBackgroundColour( wxColour(wxT("WHEAT")) ); wxBoxSizer* bSizer; bSizer = new wxBoxSizer( wxHORIZONTAL ); m_listCtrlAll = new wxListCtrl( this, ID_LISTCTRLALL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_SINGLE_SEL ); itemCol.SetText( wxT("$BDLHV(B") ); m_listCtrlAll->InsertColumn( 0, itemCol ); m_listCtrlAll->SetColumnWidth( 0, 100 ); itemCol.SetText( wxT("$BHoJ]81<THV9f(B") ); m_listCtrlAll->InsertColumn( 1, itemCol ); m_listCtrlAll->SetColumnWidth( 1, 180 ); itemCol.SetText( wxT("$B%U%!%$%k?t(B") ); m_listCtrlAll->InsertColumn( 2, itemCol ); m_listCtrlAll->SetColumnWidth( 1, 100 ); bSizer->Add( m_listCtrlAll, 0, wxALL|wxEXPAND, 5 ); m_listCtrlThumbnail = new wxListCtrl( this, ID_LISTCTRLTHUMB, wxDefaultPosition, wxDefaultSize, wxLC_ICON ); bSizer->Add( m_listCtrlThumbnail, 0, wxALL|wxEXPAND, 5 ); m_bitmapPreview = new wxStaticBitmap( this, ID_BITMAPPREVIEW, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); bSizer->Add( m_bitmapPreview, 1, wxALL|wxEXPAND, 5 ); this->SetSizer( bSizer ); this->Layout(); this->Centre( wxBOTH ); } // destructor DirViewFrame::~DirViewFrame() { } // Event Table BEGIN_EVENT_TABLE( MyFrame, wxFrame ) EVT_LIST_ITEM_SELECTED( ID_LISTCTRLALL, DirViewFrame::OnThumbnail ) EVT_LIST_ITEM_SELECTED( ID_LISTCTRLTHUMB, DirViewFrame::OnPreview ) END_EVENT_TABLE() // Event Handlers void DirViewFrame::OnThumbnail(wxListEvent& event) { m_listCtrlThumbnail->DeleteAllItems(); /* m_imageList->RemoveAll(); wxDir dir(m_dir); wxString filename; if ( !dir.IsOpened() ) return; bool cout = dir.GetFirst( &filename, wxT("*.jpg"), wxDIR_FILES ); int i=0; wxListItem item; while ( cout ) { wxString f = m_dir + wxFILE_SEP_PATH + filename; wxFile file( f ); long len = file.Length(); if ( !m_checkBox->IsChecked() && len > 150000 ) { cout = dir.GetNext( &filename ); continue; } item.SetId(i); item.SetMask(wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_IMAGE); item.SetStateMask(wxLIST_STATE_SELECTED); item.SetState(wxLIST_STATE_SELECTED); item.SetImage(i); item.SetText(filename); m_listCtrl->InsertItem( item ); m_listCtrl->SetItem( item ); wxImage img( f, wxBITMAP_TYPE_JPEG ); wxBitmap bmp( img.Scale( 63, 89, wxIMAGE_QUALITY_HIGH ) ); m_imageList->Add( bmp ); cout = dir.GetNext( &filename ); i++; } */ return; } void DirViewFrame::OnPreview(wxListEvent& event) { } // Functions void DirViewFrame::ListAll(void) { }